5
1
Fork
You've already forked stlink-tool
2
Firmware uploader for ST-Link
  • C 94.8%
  • Makefile 5.2%
2026年06月20日 14:47:59 -07:00
docs fix : only v2-1 checks for the magic number 2026年04月06日 07:52:01 +02:00
src fix : only v2-1 checks for the magic number 2026年04月06日 07:52:01 +02:00
tiny-AES-c @12e7744b49 Update tiny-Aes 2021年11月08日 20:37:46 +01:00
.clang-format misc : update .clang_format 2026年04月04日 23:45:11 +02:00
.clang-tidy Added clang-tidy and clang-format configurations matching Black Magic Debug 2024年01月26日 18:29:13 +00:00
.gitignore feat : allow booting straight to the app 2026年04月04日 22:14:55 +02:00
.gitmodules Initial commit 2018年01月20日 21:34:48 +01:00
CODE_OF_CONDUCT.md coc: Added abuse contact. 2026年06月20日 14:47:59 -07:00
Makefile Fixed the build errors caused by implicit decls becoming invalid by going to C11 2024年01月26日 20:18:29 +00:00
README.md fix : only v2-1 checks for the magic number 2026年04月06日 07:52:01 +02:00

stlink-tool

libusb tool for flashing chinese ST-Link dongles. Please note that similarly to ST's updater, the uploaded firmware won't replace the bootloader (meaning that you should be able to reflash the original afterwards using ST's firmware update utility).

Usage: ./stlink-tool [options] firmware.bin
Options:
	-p	Probe the ST-Link adapter
	-m	Embed magic number to make STLink V2-1 application start on power on
	-h	Show help

stlink-tool has been tested under Linux and macOS. With sakana280's fork you can use it under Windows.

Compiling

Required dependencies :

  • C compiler (both clang and gcc seems to work great)
  • libusb1
  • git
git clone https://github.com/jeanthom/stlink-tool
cd stlink-tool
git submodule init
git submodule update
make

Firmware upload protocol

ST's firmware upload protocol is USB's DFU protocol with some twists. Every DFU command is issued with the 0xF3 prefix, and the command set does not exactly match USB's.

Some documentation :