#debugging #swd #stlink #black-magic-probe

app stlink-tool-rs

A tool to flash chinese ST-link dongles

2 unstable releases

0.2.0 Mar 11, 2023
0.1.0 Mar 11, 2023

#886 in Embedded development

Download history 9/week @ 2024-02-23 5/week @ 2024-03-01 2/week @ 2024-03-08 4/week @ 2024-03-15 108/week @ 2024-03-22 18/week @ 2024-03-29

132 downloads per month

MIT license

19KB
384 lines

stlink-tool-rs

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-rs [options] firmware.bin
Options:
	-p	Probe the ST-Link adapter
	-h	Show help

stlink-tool-rs has been tested under Linux.

Compiling

Prerequisite - Rust toolchain.

cargo build

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 :

Thanks

This is a reimplementation in rust of https://github.com/UweBonnes/stlink-tool/tree/stlinkv21 Mainly for the purpose of learning some Rust, with a real project.

Dependencies

~9MB
~168K SLoC