How stlink-org/stlink works
STLINK is a suite for programming and debugging STM32 devices through ST-LINK probes. The main workflow is to connect to a probe, identify or access the target, then read, erase, or program flash; companion tools expose chip information, trace capture, GDB debugging, and remote probe access. The shared library contains USB/remote transport and STM32-specific operations. The README establishes the suite’s capabilities, while sampled source confirms selected tool and library behavior; unsampled implementation links are omitted where ownership is uncertain.
Main entry points: stlink.h STLINK API · gdb-server.c GDB server · flash.c st-flash · server.c st-server
Components 21
User tools
- st-flash
src/st-flash/flash.c - Flash options
src/st-flash/flash_opts.c - st-info
src/st-info/info.c - stlink-gui
src/stlink-gui/gui.c
Debug and trace
- st-trace
src/st-trace/trace.c - GDB server
src/st-util/gdb-server.c - GDB protocol
src/st-util/gdb-remote.c - Semihosting
src/st-util/semihosting.c
STLINK library
- STLINK API
inc/stlink.h - Flash operations
src/stlink-lib/common_flash.c - Chip identification
src/stlink-lib/chipid.c - Option bytes
src/stlink-lib/option_bytes.c
Probe transport
- st-server
src/st-server/server.c - USB backend
src/stlink-lib/usb.c - Remote backend
src/stlink-lib/remote.c
Other components
- User
- ST-LINK probe
- STM32 target
- GDB client
- Remote stlink tools
- TCP connection
Connections 26
- User → st-flash: runs
- st-flash → Flash options: parses options
- User → st-info: runs
- st-info → STLINK API: probes and queries
- User → stlink-gui: uses
- stlink-gui → STLINK API: accesses device
- User → st-trace: runs
- st-trace → STLINK API: configures trace
- User → GDB server: starts debugging
- GDB client → GDB server: sends commands
- GDB server → GDB protocol: handles protocol
- GDB server → Semihosting: handles requests
- GDB server → STLINK API: controls target
- User → st-server: starts service
- Remote stlink tools → TCP connection: sends requests
- TCP connection → st-server: forwards requests
- st-server → STLINK API: forwards operations
- st-flash → STLINK API: manipulates flash
- STLINK API → Flash operations: uses
- STLINK API → Chip identification: identifies chip
- STLINK API → Option bytes: accesses options
- STLINK API → USB backend: uses local transport
- STLINK API → Remote backend: uses remote transport
- USB backend → ST-LINK probe: communicates over USB
- Remote backend → TCP connection: communicates over TCP
- ST-LINK probe → STM32 target: programs and debugs