The BPM is basically the best flashing tool for STM32/ARM chips. Get the hex file for whatever you're flashing (build it, download it, whatever), then follow these directions.
First install the arm compiler:
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt-get install gcc-arm-embedded
Or just run as sudo...
Once the toolchain is installed and the code and bootloader are compiled, you can hook the probe up directly to your device and use gdb to flash the code to the module.
Once you're hooked up, start up the ARM gdb and scan for the device.
Follow these steps to get everything working:
% arm-none-eabi-gdb
[...]
(gdb) target extended-remote /dev/ttyACM0
(gdb) monitor swdp_scan
(gdb) attach 1
(gdb) set mem inaccessible-by-default off
(gdb) load build/clouds_bootloader/clouds_bootloader.hex
[...]
(gdb) load build/clouds/clouds.hex
[...]
(gdb) quit
After running the final load, you should see the module blink through it's bootup and then turn off all of it's LEDs.
Unplug the programmer, power cycle the module, and make sure it boots up by blinking it's leds!
You should have a working module now!
getting started: https://github.com/blacksphere/blackmagic/wiki/Getting-Started
Useful commands (and debugging help): https://github.com/blacksphere/blackmagic/wiki/Useful-GDB-commands
GDB will use any .gdbinit
files it finds in the current directory. For the BMP, @kbob uses this:
target extended-remote /dev/cu.usbmodemBDEAA9F1
monitor swdp_scan
attach 1
set confirm off
set mem inaccessible-by-default off
define lc
load
continue
end
define lr
load
run
end
The examples often can use the flash
target via make flash
. Just make sure you've got udev rules set up right or whatever...