-
1Install the Toolchain
Install gcc-arm-embedded, stm32flash and dfu-util.
Most GNU/Linux distributions provide this as a package. E.g. on distributions with APT like Debian you can run
sudo apt install gcc-arm-none-eabi stm32flash dfu-util
-
2Download the blackmagic Firmware Repository
git clone --recursive https://github.com/blackmagic-debug/blackmagic.git cd blackmagic
-
3Build the Firmware
make PROBE_HOST=swlink
-
4Flash the Bootloader
Hook up the Blue Pill to the USB-UART adapter and set to bootstrap pins as shown and then connect the UART adapter to your computer via USB.
UART Adapter Blue Pill RX A9 TX A10 BOOT0 BOOT1 1 0 This causes the STM32 to run its system memory bootloader from ROM, which enables us to flash the firmware via UART. To do that, use stm32flash as shown. Replace /dev/ttyUSB0 with the correct device path of your UART adapter.
stm32flash -S 0x8000000 -v -w src/blackmagic_dfu.bin /dev/ttyUSB0
-
5Upload the Firmware
Set both bootstrap pins of the Blue Pill to 0 again and connect it to your computer via USB.
Upload the firmware binary using the dfu utility.
dfu-util -d 1d50:6018,:6017 -s 0x08002000:leave -D src/blackmagic.bin
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.