Page 1 of 2

Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 12:31 am
by Darius
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..

Re: Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 12:45 am
by RogerClark
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

Re: Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 1:04 am
by Darius
OK thanks.

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

Re: Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 1:22 am
by RogerClark
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.

Re: Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 1:24 am
by Darius
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.

Re: Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 2:07 am
by RogerClark
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

http://www.stm32duino.com/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)

Re: Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 2:15 am
by Darius
I'm using OSX (Launchpad now host the official ARM GCC builds).

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

Re: Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 2:19 am
by RogerClark
OK
It may not have been tested on OSX

Re: Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 2:43 am
by Rick Kimball
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

Re: Programming with a BMP on Arduino 1.6.9

Posted: Mon Jul 04, 2016 2:57 am
by Darius
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 http://www.stm32duino.com/viewtopic.php ... 531#p15531