-
Notifications
You must be signed in to change notification settings - Fork 30
Serial flashing method
Caution
Warning! Using serial flashing requires doing micro soldering to the pin(s) of gd32, please use the SWD flashing method if you are not comfortable doing it!)
In the following cases, you might want to use serial for flashing your board:
- The SWD GPIO (PA13 PA14) is used as a GPIO, thus SWD is disabled
- You do not have a STlink V2 or any compatible SWD debug probe
- You want to use STM32 Cube Programmer
- Flash unlock fails
T1he gd32/stm32/mm32 bootloader is activated by pulling BOOT0 HIGH and BOOT1 LOW
The Serial pin in bootloader mode is different from the normal ones (pa9 TX pa10 RX)
GPIO | Description | wiring |
---|---|---|
BOOT0 | -- | connect to 3.3V |
PB2 | BOOT1 | connect to GND with 1K resistor |
PA9 | TX | RX |
PA10 | RX | TX |
VCC | 3.3V | |
GND | GND |
- On most board, the BOOT0 is directly soldered to GND pad, so you will have to lift the pin up with a sharp tool while heating it
- BOOT0 can be directly connected to 3.3v afterwards, just make sure there is no short circuit to GND from the pad it originally connect to
- BOOT1 must be pulled LOW through a 1K resistor, because it is used as a normal GPIO, if you hard pull it to GND it can cause a short circuit in the micro controller and destroy it, and if you use too high value it can get dragged by the load to HIGH
- TX and RX is PA9 PA10 which is always used by the motor blue and green phase, so you can solder the line to the gate driver ic they will not interfere with the signal and makes a larger solder pad to work with
- It is important never connect the battery when serial line is connected, because you can create a short circuit with the mosfets, power the board from CP2102 internal 3.3v source is enough (100ma)
- Make sure the usb to serial adapter is 3.3v not 5v(and also not +-15v!), or at least have a series resistor, otherwise it will not work I tried
video toturial of soldering: https://youtu.be/rUMzHYvKoW4
The example soldering job is definitely not the best but it did work
- Download STM32 Cube Programmer from official website or fileCR
- Select UART
- Plug in your board with usb to serial adapter
- Select your com port, 115200 baud, Even parity
- Click connect
- The flash should be read and if lock it will be unlocked automatically
-
Click open file and choose the hex file, then press download
-
After a while it should say download complete
After flashing, BOOT0 need to be connected to GND to boot normally again, or it will always boot to bootloader
SWD Flashers
SWD Flashing
- Flash via Keil
- Flash via PYocd
- Flash via StLink Utilities
- Flash via Stm32 Cube Programmer
- Flash via st-flash.exe
Submit New Layout