Programming with a BMP on Arduino 1.6.9

Darius
Posts: 7
Joined: Mon Jul 04, 2016 12:20 am

Programming with a BMP on Arduino 1.6.9

Postby Darius » Mon Jul 04, 2016 12:31 am

Hi all,
I'm just trying out STM32Duino and so I cloned https://github.com/rogerclarkmelbourne/ ... _STM32.git and checked out the development branch.
I twiddled STM32F1/platform.txt to change 'runtime.tools.arm-none-eabi-gcc.path' to point to my build environment.

The build worked but flashing didn't - it wouldn't run GDB.
In the end I modified platform.txt like so

Code: Select all

tools.bmp_upload.cmd=/opt/local/bin/arm-none-eabi-gdb
tools.bmp_upload.upload.pattern="{cmd}" -cd "{build.path}" -b {upload.speed} {upload.verbose} -ex "set debug remote 0" -ex "set target-async off" -ex "set remotetimeout 60" -ex "set mem inaccessible-by-default off" -ex "set confirm off" -ex "set height 0" -ex "target extended-remote {serial.port}" -ex "monitor swdp_scan" -ex "attach 1" -ex "x/wx 0x8000004" -ex "monitor erase_mass" -ex "echo 0x8000004 expect 0xffffffff after erase\n" -ex "x/wx 0x8000004" -ex "file {build.project_name}.elf" -ex "load" -ex "x/wx 0x08000004" -ex "tbreak main" -ex "run" -ex "echo \n\n\nUpload finished!" -ex "quit"


i.e. call arm-none-eabi-gdb directly.

After that I can flash it and the blink example works.

I'm not sure what the 'right' answer is for the GDB issue..

User avatar
RogerClark
Posts: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Programming with a BMP on Arduino 1.6.9

Postby RogerClark » Mon Jul 04, 2016 12:45 am

You can try PM'ing @rickKimball, he added the BMP code and is the expert in this

Or try finding the thread about the BMP and post there, as Rick normally responds to that thread

Darius
Posts: 7
Joined: Mon Jul 04, 2016 12:20 am

Re: Programming with a BMP on Arduino 1.6.9

Postby Darius » Mon Jul 04, 2016 1:04 am

OK thanks.

Is there a canonical way to point Arduino to the tool chain, or is editing platform.txt it?

User avatar
RogerClark
Posts: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Programming with a BMP on Arduino 1.6.9

Postby RogerClark » Mon Jul 04, 2016 1:22 am

Darius wrote:OK thanks.

Is there a canonical way to point Arduino to the tool chain, or is editing platform.txt it?


I'm not sure quite what you mean

Where the IDE hides the toolchain varies depending on OS and also the IDE verison (its in a different location on WIndows between verison 1.6.5 and 1.6.9)

When I build the bootloader using the Make command, I had to add the path to the Windows %PATH evn var
I just looked at the verbose output from the IDE and then added the gcc bin folder to my PATH

So I can now get to gcc and gdb etc on the command line and in Make, without needing the full path.

Darius
Posts: 7
Joined: Mon Jul 04, 2016 12:20 am

Re: Programming with a BMP on Arduino 1.6.9

Postby Darius » Mon Jul 04, 2016 1:24 am

OK, I'll try putting it in my path and see how I go.

I didn't originally because I have arm-none-eabi-gcc v5.1.0 in my path - I downloaded 4.8 from Launchpad and put it in another directory because the boot loader repo suggests it doesn't work on any newer version.

User avatar
RogerClark
Posts: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Programming with a BMP on Arduino 1.6.9

Postby RogerClark » Mon Jul 04, 2016 2:07 am

Ah OK

I see you are running Linux

Rick, who added BMP support also uses Linux, so it does work on some distro's , but perhaps not yours.

Can you post any more questions to this thread

viewtopic.php?t=122

(If I get time I would move the thread myself, but I don't want to break the other thread as its an important source of information)

Darius
Posts: 7
Joined: Mon Jul 04, 2016 12:20 am

Re: Programming with a BMP on Arduino 1.6.9

Postby Darius » Mon Jul 04, 2016 2:15 am

I'm using OSX (Launchpad now host the official ARM GCC builds).

I'll take a look at that thread, thanks.

User avatar
RogerClark
Posts: 5466
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Programming with a BMP on Arduino 1.6.9

Postby RogerClark » Mon Jul 04, 2016 2:19 am

OK
It may not have been tested on OSX

User avatar
Rick Kimball
Posts: 724
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Programming with a BMP on Arduino 1.6.9

Postby Rick Kimball » Mon Jul 04, 2016 2:43 am

Darius wrote:Hi all,
I'm just trying out STM32Duino and so I cloned https://github.com/rogerclarkmelbourne/ ... _STM32.git and checked out the development branch.
I twiddled STM32F1/platform.txt to change 'runtime.tools.arm-none-eabi-gcc.path' to point to my build environment.


Why did you have to "twiddle" the platform.txt? If you install either the Board package for the Arduino Due or Zero ( better as you also get openocd for free) you should get a working arm-none-eabi-gcc toolchain with all the fixings.

Turn on verbose upload options in File/Preferences and post your output showing the failure.

Have you tested your BMP setup by hand? Does that work properly? I've not tested any of this recently. I think at one point I did try this on OS/X but I don't remember what version of OS/X it was maybe 10.11? Currently, I don't think I even have a BMP board configured at the moment. To be honest, I've just been using either an STLink clone, a Nucleo Board or a Discovery Board to program and debug.

-rick
-rick

Darius
Posts: 7
Joined: Mon Jul 04, 2016 12:20 am

Re: Programming with a BMP on Arduino 1.6.9

Postby Darius » Mon Jul 04, 2016 2:57 am

Rick Kimball wrote:
Darius wrote:Hi all,
I'm just trying out STM32Duino and so I cloned https://github.com/rogerclarkmelbourne/ ... _STM32.git and checked out the development branch.
I twiddled STM32F1/platform.txt to change 'runtime.tools.arm-none-eabi-gcc.path' to point to my build environment.


Why did you have to "twiddle" the platform.txt?

Turn on verbose upload options in File/Preferences and post your output showing the failure


I posted my reply to viewtopic.php?f=37&t=122&p=15531#p15531


Return to “Black Magic Probe & other”

Who is online

Users browsing this forum: No registered users and 1 guest