Wraps the probe-rs CLI for embedded probe discovery, firmware flashing, memory access, GDB debugging and RTT log reading.
- What it does
- Provides a structured wrapper around the probe-rs command line tool, covering probe enumeration, target info, firmware flashing (elf/hex/bin/uf2), erase, reset, memory read and write, one-shot GDB debugging and RTT log capture. It ships Python scripts for execution, GDB and RTT, plus layered configuration for tool paths, ports and project parameters such as chip, protocol, probe selector and speed. Commands return JSON output and risky operations are flagged by risk level.
- When to use it
- Use it when working with probe-rs, cargo-embed, DAP, RTT, CMSIS-DAP, ST-Link or J-Link, or when flashing firmware, reading chip info, connecting under reset, selecting a probe, or pulling a backtrace from an embedded target.
- Requirements
- Requires the probe-rs CLI on the system, Python 3 (py -3 on Windows) to run the bundled scripts, and arm-none-eabi-gdb for the gdb subcommand. A skill-level config.json and a project-level .embeddedskills/config.json supply executable paths, ports, chip, protocol, probe selector and speed; a chip value must be supplied explicitly. Physical probe hardware and USB access are needed.
probe-rs 下载与调试
本 skill 提供 probe-rs CLI 的结构化包装,覆盖探针发现、目标信息、烧录、复位、内存读写、one-shot GDB 调试和 RTT 日志读取。
Windows 下优先使用 py -3 调用脚本;若 arm-none-eabi-gdb 已在 PATH 中,gdb 子命令可自动发现,不强依赖 skill config.json。
配置
环境级配置(skill/config.json)
首次使用前建议在 skill 目录下创建 config.json:
exe:probe-rs 可执行文件路径或命令名
gdb_exe:arm-none-eabi-gdb 路径,gdb 子命令需要
gdb_port:默认 GDB 端口
dap_port:预留给交互式 DAP 会话
operation_mode:1 直接执行 / 2 输出风险摘要但不阻塞 / 3 执行前确认
工程级配置(.embeddedskills/config.json)
chip:芯片型号,probe-rs 主后端必填
protocol:swd 或 jtag
probe:探针选择器,格式 VID:PID[:Serial]
speed:调试速率 kHz
connect_under_reset:连接时是否保持 reset
参数优先级:CLI 参数 > 工程配置(.embeddedskills/config.json)> state.json > skill 配置(config.json)> 默认值
各层职责:skill config.json 提供工具路径与端口等环境级常量;.embeddedskills/config.json 提供芯片、协议等工程级参数;CLI 参数在单次调用中覆盖一切。
子命令
典型调用
核心规则
- 不自动猜测
chip,缺失时直接报错
- 多探针场景建议显式提供
--probe;若未检测到任何探针,应提示用户检查 USB 连接并重试;若探针配置错误(如 VID:PID 不匹配),应报告具体错误信息并建议运行 list 子命令确认可用探针
.bin 烧录必须显式提供地址
workflow build-debug 只走 one-shot 诊断包装,不启动需要人工接管的长期 DAP 会话
- Windows 下若要用
probe-rs 驱动 J-Link,通常需要切换到 WinUSB,这会影响 SEGGER 官方工具继续使用;若仍依赖 J-Link 官方工具链,优先继续用现有 jlink skill