Updating and Debugging Firmware - OUWECAD/MOWE GitHub Wiki
Table of Contents
Updating Firmware
SWD Interface
ST Bootloader - Single Module
Debugging Firmware with uVision
Updating Firmware
There multiple methods to access the module MCU for programming and debugging and each has its own pros and cons. We will go through all these methods in detail.
SWD Interface
This method utilizes the Serial Wire Debug (SWD) interface on the ARM MCUs for updating and debugging firmware, one module at a time. It requires an external programmer/debugger device (e.g., ST LINK/V2 available as a stand-alone or on ST Nucleo boards, or KEIL ULINK2/ULINKpro) and any ARM development IDE.
The modules have their SWD pins available as SMD pads on the top surface for easy accessibility as shown below. Pins D (for SWD Data) and C (for SWD Clock) are used. The reset pin R is used in the process as well.

ST Bootloader - Single Module
This method utilizes ST factory-installed bootloader and permits updating MCU firmware via serial UART ports. Debugging cannot be performed here. All you need is a serial terminal software (e.g., RealTerm) and a connection to a specific module port. Do not forget to connect the GND pin to you PC in case you have a separate power supply.
Note: Only USART1 and USART2 can be used to update the firmware via ST factory-installed bootloader. The following table lists ports available for firmware bootloader-update in current modules.
| Module | Firmware bootloader-update port | Port Label |
|---|---|---|
| HO01R1 | P1 | 13 |
| HO01R2 | P1, P5 | 13, 17 |
| HO01R3 | P1 | P1 |
| HO02R0 | P1 | 13 |
| HO02R1 | P1, P5 | 13, 17 |
| HO02R2 | P1 | P1 |
| PO01R0 | P2 | 12 |
| PO02R0 | P2 | 12 |
You have to put the MCU in bootloader mode in order to connect with it. The bootloader mode can be activated in either three ways:
- Apply +3.3V to the boot pin B and reset the MCU. You can use a female-male ribbon jumper wire to get +3.3V from module power pins and apply it to the boot pin then cycle MCU power and remove the +3.3V afterwards.

- Use the firmware update commands
update - When modules arrive from factory, they will be already in bootloader mode. This happens also when modules have no firmware installed.
After you put the MCU in bootloader mode, you can use the ST Flash Loader Demonstrator utility to connect with the MCU and update the firmware. Note that if you enter bootloader mode via the update command, you have to close the serial port in your terminal software before being able to connect using the ST Flash Loader tool. Leave settings in the tool unmodified (57600 baudrate, even parity) and activate Jump to user program option in the Download to device section in the last page. Choose the appropriate compiled .hex file for your module. Note that in order to generate .hex files in uVision, you have to enable the option Create HEX File from the Output tab in the Target Options.