diff options
author | xengineering <me@xengineering.eu> | 2022-02-13 12:51:29 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2022-02-13 12:51:29 +0100 |
commit | 2d11c1a21b1e4ec18047815203895de6e6c63b6f (patch) | |
tree | afd883dfe36c9ba6f6d171ee40bb6061a8e61244 | |
parent | c583ad032a537d48691e3fc39758081ca2149ad3 (diff) | |
download | ledcontrol-2d11c1a21b1e4ec18047815203895de6e6c63b6f.tar ledcontrol-2d11c1a21b1e4ec18047815203895de6e6c63b6f.tar.zst ledcontrol-2d11c1a21b1e4ec18047815203895de6e6c63b6f.zip |
Add documentation for firmware upload with stm32flash
-rw-r--r-- | firmware/README.txt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/firmware/README.txt b/firmware/README.txt index d24eab5..7836bc2 100644 --- a/firmware/README.txt +++ b/firmware/README.txt @@ -43,6 +43,39 @@ Mention that you do not have to quit GDB to upload new compiled firmware. Just call `load` and `run` again. +Upload firmware via serial bootloader +------------------------------------- + +STM32 microcontrollers have a built-in serial bootloader to flash firmware. It +is activated if pin BOOT0 is pulled to 3.3 V, BOOT1 to 0 V (GND) and the +microcontroller is restarted. In this state it is possible to flash firmware +with just a USB to serial adapter via USART1 (PA9 and PA10). This works with a +FTDI USB to UART adapter (3.3 V TTL logic and 5 V VCC). + +To upload a *.bin firmware to the MCU just follow these steps. You will need to +install the stm32flash utility (maybe via AUR): + +- connect: + - GND (UART adapter) to GND (MCU) + - RX (UART adapter, yellow in my case) to PA9 (MCU) + - TX (UART adapter, orange in my case) to PA10 (MCU) + - VCC (UART adapter) to VCC (MCU) just if no other power source is + connected! +- set BOOT0 to 1 (3.3 V) and BOOT1 to 0 (GND) +- reboot MCU +- flash firmware with stm32flash + +To flash and verify `firmware.bin` via `/dev/ttyUSB0` use this command: + + stm32flash -w firmware.bin -v /dev/ttyUSB0 + +It can then be started with: + + stm32flash -g 0x0 /dev/ttyUSB0 + +For further details run `man stm32flash`. + + External References ------------------- |