一键导入
mcu-gdb-debugger
Use for MCU firmware debugging with GDB/gdbserver, probe or QEMU targets, flash/attach flows, and Cortex-M fault analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use for MCU firmware debugging with GDB/gdbserver, probe or QEMU targets, flash/attach flows, and Cortex-M fault analysis.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Configure clangd language server for Zephyr RTOS projects with cross-compilation toolchains. Use when setting up clangd for Zephyr, nRF Connect SDK, or ARM cross-compilation projects, or when clangd shows errors like "Unknown Arm architecture profile" or "failed to resolve include".
Use when debugging embedded firmware through SEGGER J-Link RTT - capture RTT output, send RTT console commands, or open an interactive RTT console.
Use for Linux C/C++ GDB crash, core dump, and hang debugging.
Use when committing staged changes with a Conventional Commit.
Use when starting any coding task with unclear requirements, vague feature requests, or ambiguous bug fixes - before writing implementation code. Triggers automatic domain inference (Embedded, Python, DevOps, Zephyr, etc.) and compiles rigorous Markdown prompts with reconnaissance, HITL clarification, TDD workflow, and selectively applied domain constraints.
| name | mcu-gdb-debugger |
| description | Use for MCU firmware debugging with GDB/gdbserver, probe or QEMU targets, flash/attach flows, and Cortex-M fault analysis. |
Use debugger evidence to close the embedded firmware debug loop: identify the exact target setup, connect through the correct gdbserver, halt/load/attach, reproduce, inspect CPU and fault state, make the smallest code change, rebuild, reflash, and verify on the same reproduction.
Use for MCU firmware running on bare metal, RTOS, QEMU, or probe-connected boards where the key artifact is an ELF file and the debug path is GDB plus a gdbserver backend.
Before editing firmware, collect or infer:
-gdb, vendor IDE server, or an already-running server.If any of ELF, target, probe, or backend is unknown, inspect the repo build files, board configs, launch configs, README, CI scripts, or user-provided command history before guessing.
references/backend-patterns.md for backend-specific command patterns.arm-none-eabi-gdb <firmware.elf>.target extended-remote or target remote, then confirm the target halted state.monitor reset halt or the backend equivalent before loading or inspecting early boot state.load for flash/RAM download sessions, or skip load when attaching to existing firmware.main, fault handlers, assert handlers, suspicious source locations, and producer locations for bad state.references/hardfault-playbook.md.Adapt this sequence to the backend and target:
set pagination off
set confirm off
file build/firmware.elf
target extended-remote :3333
monitor reset halt
load
monitor reset halt
break main
continue
For attach-only sessions:
file build/firmware.elf
target remote :3333
monitor halt
info registers
bt
For every stop, record:
pc, lr, sp, xpsr, plus msp, psp, and control on Cortex-Mbt and the first application-owned framepcCFSR, HFSR, BFAR, MMFAR, active stack pointer, and stacked pc/lr/xpsrDo not treat "the board resets less often" or "GDB no longer stops immediately" as sufficient verification. Re-run the same trigger after rebuild and reload.
Load only what is needed:
references/setup-and-session.md for the end-to-end MCU debug loop and safety checks.references/backend-patterns.md for OpenOCD, pyOCD, J-Link, ST-LINK, QEMU, and generic gdbserver command patterns.references/hardfault-playbook.md for Cortex-M fault registers, exception frame recovery, and mapping PC/LR/SP/xPSR/CFSR/HFSR/BFAR/MMFAR to likely root causes..debug/ when creating files.continue or step loop running without a breakpoint, timeout, or visible stop condition.