← 返回命令列表

Linux command

st-util 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start GDB server

st-util

Start on a specific port

st-util -p [4242]

Start with verbose output

st-util -v

Start in multi-target mode

st-util -m

Connect to a specific ST-Link by serial number

st-util --serial [serial-number]

Start with semihosting enabled

st-util --semihosting

说明

st-util starts a GDB server that bridges the GNU Debugger (GDB) to STM32 microcontrollers through an ST-Link programmer/debugger. It implements the GDB remote serial protocol, allowing standard GDB commands for setting breakpoints, stepping through code, and inspecting memory and registers. By default, the server listens on port 4242 for GDB connections. Multi-target mode (-m) supports debugging multiple ST-Link devices simultaneously. Semihosting enables the target firmware to perform I/O operations (such as printf) through the debug connection. It is part of the open-source stlink toolset.

参数

-p _PORT_
GDB server port.
-v
Verbose output.
-m
Multi-target mode.
--serial _SN_
Device serial.
--semihosting
Enable semihosting.
-n
No reset on connect.

FAQ

What is the st-util command used for?

st-util starts a GDB server that bridges the GNU Debugger (GDB) to STM32 microcontrollers through an ST-Link programmer/debugger. It implements the GDB remote serial protocol, allowing standard GDB commands for setting breakpoints, stepping through code, and inspecting memory and registers. By default, the server listens on port 4242 for GDB connections. Multi-target mode (-m) supports debugging multiple ST-Link devices simultaneously. Semihosting enables the target firmware to perform I/O operations (such as printf) through the debug connection. It is part of the open-source stlink toolset.

How do I run a basic st-util example?

Run `st-util` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -p _PORT_ do in st-util?

GDB server port.