Skip to content

U85 module programming

iliasam edited this page Dec 29, 2021 · 23 revisions

This module can be programmed in two different ways: with a special programmer (like St-Link) or by UART.

Using programmer

Connect "PWRON" line to VBAT line - to power on module.
You need to connect SWDIO, SWCLK, NRST, GND to your programmer (ST-Link for example).
Notice that NRST must be connected! You programmer must have special reset pin (cheap Chinese St-Link dongles don't have it).
You need to select "Connect under Reset" and Reset mode: "Hardware Reset" in options of your programmer software.
This method is recommending if you are planning to change source code.

Using UART bootloader

This STM32 have integrated UART bootloader (DFU), that is stored in ROM (it is not possible to erase it).
This bootloader can be used for loading firmware to MCU without programmer. Only USB-UART converter is needed.
You need to connect BOOT0 line to VBAT and reset module to enter to bootloader. Laser is usually on in this mode.

Pinout for UART programming:
drawing

Use "STM32CubeProgrammer" utility for working with bootloader. Select "UART" mode near "Connect" button.

Original firmware of the module is locked, so you will have such message after connection:
drawing
So you need to set "Read Unprotect" switch (it is at right) and try to connect again. If everything is OK you should be able to load new firmware to MCU.
You can find build firmware here (*.hex files): https://github.com/iliasam/Laser_tape_reverse_engineering/tree/master/Code/CortexM0
Select "Firmware_dist_calculation_fast_boot.hex" to use it with Arduino.

If you don't need to have debugging functions by SWD, it is preferred to use "_boot.hex" files.
Program hex file to MCU and connect "BOOT0" pin to GND (or leave it floating) to disable bootloader.
Reset module power at the end.

Clone this wiki locally