Programming with a BMP on Arduino 1.6.9

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

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"


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
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?


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?


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.


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

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)


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.


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

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.

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.

Rick Kimball
Mon Jul 04, 2016 3:57 am
I loaded BMP onto a blue pill and tested it with the master branch and arduino 1.6.10 (built from source). It seems to work fine on linux.

Things to consider:

o Did you install the arm-none-eabi-g++ toolchain by using the Board Manager and then installing either the Arduino Zero or Due?

o Are you using a BMP you built yourself or one you purchased? If you built it your self have you tested it by connecting to it using arm-none-eabi-gdb on the command line and then interacting with it?

o If you have successfully used arm-none-eabi-gdb + your BMP device, have you selected the proper /dev/ttyXXXX for your os? The BMP device will show up as two different TTY devices. You want to set the PORT to the first of these devices in the Arduino IDE, the IDE uses the port you selected as the debug connection ( target extended-remote /dev/ttyXXXX ) I don’t know what the proper OS X ttyname is.

o If it is still not working, I noticed you said you checked out the development branch, I just tried the master branch and that works fine. Does the master branch work for you?

o The target device you are trying to program, does it have the bootloader on it? This will disable the debug ports and prevent you from using SWD to program the device. You have to change the BOOT0 jumper to “HI” to override this setting. When you select the board in the Arduino IDE, you must select BMP when you compile. That sets the macro flag -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG which keeps the SWD debug pins active. After you have regained access to the debug pins you can move the BOOT0 pin back to “Low” and then toggle the power on your target board.


RogerClark
Mon Jul 04, 2016 4:00 am
Looks like the OP has fixed this by installing the Due toolchain

Leave a Reply

Your email address will not be published. Required fields are marked *