embedded-debugger

使用 embedded-debugger-mcp 对 probe-rs 目标进行嵌入式硬件调试的工作流程。适用于需要由 Codex 或 Claude Code 检查调试探针、验证嵌入式调试器设置、启动 MCP 服务器、引导用户完成 ARM Cortex-M 或 RISC-V 的烧录/调试/RTT 工作流程,或在未安装 MCP 客户端时通过命令行提示进行操作的场景。

仓库最近推送
GitHub Stars
224
Forks
34
Issues / PRs
2

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "embedded-debugger":https://skillpi.com/zh/skills/deepskill-236ad26b0a8b8cfaa2f442ac30beccdadee3313dfcca0690ad4368e37257a114。安装前核对上游来源和版本:https://github.com/Adancurusul/embedded-debugger-mcp。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

使用 embedded-debugger-mcp 对 probe-rs 目标进行嵌入式硬件调试的工作流程。适用于需要由 Codex 或 Claude Code 检查调试探针、验证嵌入式调试器设置、启动 MCP 服务器、引导用户完成 ARM Cortex-M 或 RISC-V 的烧录/调试/RTT 工作流程,或在未安装 MCP 客户端时通过命令行提示进行操作的场景。

0 下载

介绍来源: third_party · Adancurusul · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: embedded-debugger
description: Embedded hardware debugging workflow for probe-rs targets using embedded-debugger-mcp. Use when Codex or Claude Code needs to inspect debug probes, validate embedded debugger setup, start the MCP server, guide a user through ARM Cortex-M/RISC-V flashing/debugging/RTT workflows, or operate without installing an MCP client by using the CLI plus prompts.

Embedded Debugger

Use the local embedded-debugger-mcp binary as the source of truth. Prefer CLI checks first, then MCP tools when an MCP client is available.

Entry Decision

  1. If the user has an MCP client configured, start or verify the server: embedded-debugger-mcp serve
  2. If the user wants no MCP install, use CLI-first mode: embedded-debugger-mcp doctor, embedded-debugger-mcp probes list, and embedded-debugger-mcp skill print-prompt.
  3. If hardware access is required, confirm the probe and target are connected before destructive actions such as flash erase or program.

CLI Workflow

Run these in order and report the exact outcome:

embedded-debugger-mcp doctor
embedded-debugger-mcp probes list
embedded-debugger-mcp config show

Use JSON for automation:

embedded-debugger-mcp doctor --json
embedded-debugger-mcp probes list --json

Backends

One tool set runs over two interchangeable engines, chosen at connect:

  • backend: "probe-rs" (default) — native probe-rs; supports flash and RTT.
  • backend: "openocd" (experimental) — talks to an already-running openocd over its GDB port via openocd_address (default 127.0.0.1:3333). Use for chips probe-rs does not cover well (e.g. Xtensa ESP32 via openocd-esp32). Memory access and halt/run/step/reset are validated on real ESP32-S3; flash and RTT are not available on this backend. Register reads currently use ARM gdb register numbers, so PC/SP are wrong on Xtensa (known limitation). diagnose_fault and unwind_exception are Cortex-M specific and do not apply to Xtensa targets.
    • Start openocd with gdb_memory_map disable, otherwise it probes flash on the GDB connect, fails, and REJECTS the connection. Example: openocd -f board/esp32s3-builtin.cfg -c "gdb_memory_map disable".

The AI uses the same tools regardless of backend; only connect differs.

MCP Workflow

Use MCP tools for session-based operations:

  1. list_probes
  2. connect (add backend: "openocd" and openocd_address to use OpenOCD)
  3. Read-only checks such as probe_info, get_status, and read_memory
  4. On a crash or halt, call diagnose_fault: it reads the Cortex-M SCB fault registers (CFSR/HFSR/MMFAR/BFAR/SHCSR/CPUID) plus PC/SP/LR and returns a compact structured evidence bundle in one call. Halt the target first for meaningful values; reason over the set fault bits yourself. Then call unwind_exception with elf_path to map the crash to a source line (full DWARF backtrace on probe-rs; faulting PC/LR on OpenOCD).
  5. Mutating operations only after the user confirms target, file path, and risk: write_memory, flash_erase, flash_program, run_firmware (probe-rs)
  6. RTT operations after firmware is running: rtt_attach, rtt_channels, rtt_read, rtt_write, rtt_detach (probe-rs)
  7. disconnect

Fetch authoritative info yourself

You are a capable model: prefer fetching ground truth over relying on memorized or hardcoded chip data. This skill points you to sources; it does not embed register tables. In order of authority:

  1. The target itself (runtime, most authoritative for this exact chip): registers are self-described by the GDB target description; memory is read with read_memory; core identity from CPUID / the connected target.
  2. The firmware ELF (what is actually running): symbols and source lines come from DWARF — use unwind_exception (pass elf_path) to map addresses to file:line.
  3. The chip datasheet / reference manual (external, per-chip): for a peripheral or fault register, find the peripheral's base in the memory-map chapter, add the register offset, then read_memory. Search the vendor document for the exact value; do not guess addresses from memory. CMSIS-SVD files are a machine-readable source for register maps.
  4. ARM Cortex-M architecture registers (SCB fault regs, CPUID) are fixed by the ARM architecture and identical across vendors — diagnose_fault reads them. They do not exist on non-Cortex-M targets (e.g. Xtensa ESP32).

Do not hardcode or invent register/peripheral addresses. If a value is not recoverable from the target, the ELF, or a cited datasheet, say so.

Know your versions

Behavior and target support depend on tool versions — check them before concluding something is unsupported or broken:

  • probe-rs version determines which chips and architectures are supported (e.g. Xtensa support is comparatively new). Check embedded-debugger-mcp doctor.
  • OpenOCD version and fork matter: the Espressif fork (openocd-esp32) is needed for Xtensa ESP32, and some targets need flags like gdb_memory_map disable. Check openocd --version.
  • Probe firmware (ST-Link / J-Link) can affect connectivity; probes list reports the connected probe.

Safety Rules

  • Treat flash erase, flash program, memory write, reset, run, and RTT write as mutating hardware operations.
  • Prefer read-only discovery before mutation.
  • Respect project configuration limits for file paths, file sizes, memory ranges, and flash erase permissions.
  • Do not claim hardware success from command text alone; cite the command or MCP tool result that produced the evidence.

Prompt Reference

For a reusable CLI+Skill prompt, read references/default-prompt.md.

版本历史

  1. v0.3.0 GitHub ↗
    原版更新说明

    Dual debug backend and AI-facing crash diagnosis. ### Added - **Dual backend** behind a single `DebugBackend` trait, selected at `connect`: - `probe-rs` (default) — native probe-rs; full flash and RTT support. - `openocd` (experimental) — talks to an already-running `openocd` over the GDB Remote Serial Protocol (`openocd_address`, default `127.0.0.1:3333`). The AI uses the same tool set for both; only `connect` differs. - `diagnose_fault` — reads the Cortex-M SCB fault registers (CFSR/HFSR/MMFAR/BFAR/SHCSR/CPUID) plus PC/SP/LR in one call and returns a compact structured evidence bundle with the set fault bits. Reports raw evidence; it does not assert a root cause. - `unwind_exception` — maps a crash to source lines. On the probe-rs backend it returns a full DWARF backtrace via probe-rs's own unwinder; on the OpenOCD backend it reads the Cortex-M exception stack frame and maps the faulting PC/caller LR. Requires an `elf_path` built with debug info. - 24 MCP tools total (added `diagnose_fault`, `unwind_exception`). ### Validated on real hardware - OpenOCD backend verified end-to-end on a real **ESP32-S3** (openocd-esp32): connect, memory read/write, halt/run/step/reset, and register reads (PC/SP/LR) are correct. ### Notes / limitations - OpenOCD register reads use `monitor reg <name>` (openocd resolves names per architecture), so PC/SP/LR work across ARM/Xtensa/RISC-V. Start openocd with `gdb_memory_map disable` or it may reject the GDB connection. - `diagnose_fault` and `unwind_exception` are Cortex-M specific and do not apply to Xtensa (ESP32) targets. Their probe-rs paths delegate to probe-rs's tested DWARF/register code; they are unit-tested but not yet exercised on a physical Cortex-M crash.

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 提供完整的嵌入式硬件调试工作流,支持 ARM Cortex-M 和 RISC-V 架构
  • 集成 probe-rs 和 OpenOCD 双后端,覆盖烧录、调试、RTT、故障诊断等核心功能
  • 面向开发者高频刚需场景,实用价值高
触发精准95/100

亮点

  • 触发描述精准完整,覆盖 MCP 模式与 CLI 模式多种使用场景
  • 边界清晰,明确指出适用 Codex/Claude Code 等 AI 助手的调试需求
结构规范82/100

待提升项

  • 缺少 When to Use 显式章节和端到端完整示例 原报告严重程度:轻微

    文档结构良好但缺少显式的 When to Use 章节和完整的端到端操作示例

    改进建议:建议补充 When to Use 章节和至少一个完整的从连接探针到调试的端到端示例

亮点

  • 文档结构清晰,分模块描述 CLI 和 MCP 工作流
  • 包含安全规则和版本检查建议,提升执行规范性
执行可靠88/100

亮点

  • 工具来源明确,参数说明详细,覆盖主要异常场景
  • 对不可逆操作(如 flash erase/program)强调用户确认,安全性高
  • 提供版本检查建议,避免因工具版本导致执行失败
证据可验 (前四项均值)89/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。