SuperAPI AI Directory

probe-rs

Coding & development

View repository

Updated 10-15 21:36

About this skill

probe-rs download and debugging

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-rs executable file path or command name
  • gdb_exe:arm-none-eabi-gdb path,gdb subcommand requires
  • gdb_port: default GDB port
  • dap_port: reserved for interactive DAP sessions
  • operation_mode:1 execute directly / 2 output a risk summary but do not block / 3 confirm 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-rs required for the main backend
  • protocol:swd or jtag
  • probe: probe selector, format VID:PID[:Serial]
  • speed: debugging speed kHz
  • connect_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 running list subcommand to confirm available probes
  • .bin flashing must explicitly provide the address
  • workflow build-debug only 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-rs to drive J-Link, you usually need to switch to WinUSB, 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 existing jlink skill