This skill provides probe-rs a structured wrapper for the CLI, covering probe discovery, target information, flashing, reset, memory read/write, one-shot GDB debugging, and RTT log reading.
On Windows, prefer using py -3 to invoke the script; if arm-none-eabi-gdb is already in PATH ,gdb subcommand can be auto-discovered, without a hard dependency on the skill config.json。
configuration
Environment-level configuration (skill/config.json)
Before first use, it is recommended to create in the skill directory config.json:
{
"exe": "probe-rs",
"gdb_exe": "C:\\Program Files\\Arm\\GNU Toolchain mingw-w64-x86_64-arm-none-eabi\\bin\\arm-none-eabi-gdb.exe",
"gdb_port": 3333,
"dap_port": 50000,
"operation_mode": 1
}
exe:probe-rsexecutable file path or command namegdb_exe:arm-none-eabi-gdbpath,gdbsubcommand requiresgdb_port: default GDB portdap_port: reserved for interactive DAP sessionsoperation_mode:1execute directly /2output a risk summary but do not block /3confirm before execution
Project-level configuration (.embeddedskills/config.json)
{
"probe-rs": {
"chip": "STM32F407VGTx",
"protocol": "swd",
"probe": "",
"speed": 4000,
"connect_under_reset": false
}
}
chip: chip model,probe-rsrequired for the main backendprotocol:swdorjtagprobe: probe selector, formatVID:PID[:Serial]speed: debugging speed kHzconnect_under_reset: whether to hold reset when connecting
Parameter priority:CLI parameters > project configuration (.embeddedskills/config.json) > state.json > skill configuration (config.json) > default values
Responsibilities of each layer: skill config.json provides environment-level constants such as tool paths and ports;.embeddedskills/config.json provides project-level parameters such as chip and protocol; CLI parameters override everything in a single invocation.
Subcommand
| Subcommand | Purpose | Risk |
|---|---|---|
list |
Enumerate available probes | Low |
info |
View probe and target information | Low |
flash |
Flash firmware (elf/hex/bin/uf2) | High |
erase |
Erase chip non-volatile storage | High |
reset |
Reset target chip | High |
read-mem |
Read memory | Low |
write-mem |
Write memory | High |
attach / run |
Wrap probe-rs attach/run | Low |
gdb |
Start GDB Server and perform one-shot debugging | Low |
rtt |
Read RTT logs | Low |
Typical invocation
# 列出探针
py -3 <skill-dir>/scripts/probe_rs_exec.py list --json
# 烧录 ELF
py -3 <skill-dir>/scripts/probe_rs_exec.py flash --chip STM32F407VGTx --file build/app.elf --json
# 烧录 BIN(必须提供地址)
py -3 <skill-dir>/scripts/probe_rs_exec.py flash --chip STM32F407VGTx --file build/app.bin --address 0x08000000 --json
# 读取内存
py -3 <skill-dir>/scripts/probe_rs_exec.py read-mem --chip STM32F407VGTx --address 0x20000000 --length 16 --width b32 --json
# one-shot backtrace
py -3 <skill-dir>/scripts/probe_rs_gdb.py backtrace --chip STM32F407VGTx --elf build/app.elf --json
# RTT
py -3 <skill-dir>/scripts/probe_rs_rtt.py --chip STM32F407VGTx --json
Core rules
- Do not automatically guess
chip, report an error directly when missing - In multi-probe scenarios, it is recommended to explicitly provide
--probe; if no probe is detected, prompt the user to check the USB connection and retry; if the probe configuration is incorrect (e.g., VID:PID mismatch), report the specific error message and suggest runninglistsubcommand to confirm available probes .binflashing must explicitly provide the addressworkflow build-debugonly goes through the one-shot diagnostic wrapper, and does not start long-term DAP sessions that require manual takeover- On Windows, if you want to use
probe-rsto driveJ-Link, you usually need to switch toWinUSB, this will affect the continued use of SEGGER's official tools; if you still rely on the J-Link official toolchain, prioritize continuing to use the existingjlinkskill