Getting an STM32 Device Ready to Flash
Both flashing methods need the board in the right state before you can write firmware. The three methods below are ordered most convenient first:
- Meshtastic Client and BOOT0 enter the ROM bootloader, which a UART flash needs.
- SWDSWD (Serial Wire Debug). A two-pin debug and programming interface, used on STM32 devices to enter bootloader mode and flash firmware. resets the MCUMCU (Microcontroller Unit). The microcontroller that runs the firmware on a device. The hardware tables list the MCU for each supported board. and connects to it directly for an SWD flash; it does not use the ROM bootloader.
Meshtastic Client
Once Meshtastic firmware is installed, the board can be rebooted into the ROM bootloader without touching the hardware:
- Connect to the node over USBUSB (Universal Serial Bus). The wired connection used to power a device, flash firmware onto it, and communicate with it over serial. (or BLEBLE (Bluetooth Low Energy). The default wireless connection between a node and a phone client.).
- Run
meshtastic --enter-dfu, or select the equivalent option in the app.
On boards whose USBUSB (Universal Serial Bus). The wired connection used to power a device, flash firmware onto it, and communicate with it over serial. serial port connects to the ROM bootloader UARTUART (Universal Asynchronous Receiver-Transmitter). A serial interface used to communicate with a device over its pins or through a USB-to-serial bridge., this allows firmware upgrades over UART with no extra wiring.
BOOT0
On boards that route the BOOT0 pin to a pad, jumper, or switch:
- Tie BOOT0 high (to 3V3).
- Reset or power-cycle the board. It comes out of reset in the ROM bootloader.
- Flash the firmware over UART.
- Return BOOT0 to ground (or let it float if the board has a pull-down) and reset again to run the firmware.
Some boards, such as the Wio-E5, do not expose the BOOT0 pin; use another method.
SWD
An SWDSWD (Serial Wire Debug). A two-pin debug and programming interface, used on STM32 devices to enter bootloader mode and flash firmware. programmer such as an ST-LINK writes firmware straight to flash over the SWDSWD (Serial Wire Debug). A two-pin debug and programming interface, used on STM32 devices to enter bootloader mode and flash firmware. pins. It resets and halts the MCUMCU (Microcontroller Unit). The microcontroller that runs the firmware on a device. The hardware tables list the MCU for each supported board. to do this, so it never uses the ROM bootloader and needs neither BOOT0 nor a working Meshtastic client. That makes it the only option for a board that is not already running Meshtastic firmware and has no reachable BOOT0 pin. Continue at Flashing over SWD.
For the BOOT0 pin location, UARTUART (Universal Asynchronous Receiver-Transmitter). A serial interface used to communicate with a device over its pins or through a USB-to-serial bridge. pins, and any board-specific steps, see the documentation for your board.