Get a cheap ST-Link clones (Around $4), refer to the schematics for the SWD pinout.
There's no support for custom bootloaders.
Usually the board will have a connector with pn named "G V C D" (GND, VDD,SWCLK, SWDIO).
If not named, just use a multimeter and check which pins goes where.
Then connection is as follows.
Connect VDD only if not being powered by station power supply!
Download the binary STM32SolderingStation.bin for your station (Listed in the Readme), also found in BOARDS folder, and flash it using ST-Link.
Usually the STM32 comes read-protected. Follow this workflow to program it.
(Click for bigger picture)
Just open and program the new binary.
Because this firmware stores the settings in the flash, don't make a full chip erase!
In any case, the firmware will check the settings and reset them if not valid.
Some STM32 have the debug port disabled, in this case the only way to access is connecting nRST pin to the ST-Link.
There're several ST-Link clones with a flaw in nRST pin, which is wired wrong by design, and won't able to connect.
Temporaly short nRST (STM32 pin 7) to gnd, click "connect" button, wait 1-2 seconds and release nRST, now it should recognice it.
Usually nRST is connected to a capacitor, only requiring to short the capacitor as showed in this picture:
- Download the binary STM32SolderingStation.bin for your station (Listed in the Readme), also found in BOARDS folder. Rename it fw.bin
- Install OpenOCD
If running Ubuntu/Debian: sudo apt install openocd - create a file with the following content or download it
source [find interface/stlink.cfg]
source [find target/stm32f1x.cfg]
# Set RDP to level 0
init
reset halt
stm32f1x unlock 0
reset halt
#Program
program fw.bin 0x08000000
exit
- Connect the st-link programmer and from the console
$ openocd -f ocd-program.cfg
Open On-Chip Debugger 0.11.0-rc2
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.232297
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080033f0 msp: 0x20002800
Info : device id = 0x20036410
Warn : STM32 flash size failed, probe inaccurate - assuming 128k flash
Info : flash size = 128kbytes
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080033f0 msp: 0x20002800
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080033f0 msp: 0x20002800
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **