Flashing STM32 over UART
A USB-TTL serial adapter can flash STM32WL without an SWD programmer, once the board is in the ROM bootloader.
The ROM bootloader listens on:
- USART1 — PA9 (TX), PA10 (RX)
- USART2 — PA2 (TX), PA3 (RX)
Connect the adapter's RX to the MCU's TX and the adapter's TX to the MCU's RX, with a common ground.
GUI — STM32CubeProgrammer
- Launch STM32CubeProgrammer.
- Select the UART connection and the serial port of your USB-TTL adapter.
- Put the board in the ROM bootloader.
- Click Connect.
- Open the
firmware-<target>-X.X.X.xxxxxxx.binfile and confirm the start address is0x08000000(the default). - Click Download.
CLI — STM32CubeProgrammer
STM32_Programmer_CLI -c port=/dev/ttyUSB0 br=115200 -w firmware-<target>-X.X.X.xxxxxxx.bin 0x08000000 -v -g 0x08000000
-v verifies the write and -g 0x08000000 starts the firmware once it finishes.