ormus-solutions/libreembed-claude-code/debug-trace-patterns
- community
Checking that the SKILL.md file is still in the repository.
Cortex-M debug patterns: CFSR decoding after a HardFault, addr2line from fault PC to source line, GDB commands for live faults, stack canaries, ITM printf, and DWT data watchpoints. Use when chasing a crash, a hang, or memory corruption on target.
Install
npx vskill@latest install ormus-solutions/libreembed-claude-code/debug-trace-patternsSKILL.md
debug-trace-patterns
Knowledge Base
Practical debug patterns for ARM Cortex-M firmware. Tools: OpenOCD, GDB, J-Link, logic analyzer.
Pattern 1: Decode CFSR After HardFault
Given a CFSR value (e.g., from monitor mdw 0xE000ED28), decode:
Pattern 2: addr2line — Fault PC to Source Line
The -i flag follows inline function chains.
Pattern 3: GDB Commands for Live Fault Debugging
Pattern 4: Stack Corruption Detection with Canary
FreeRTOS alternative: uxTaskGetStackHighWaterMark(NULL) returns minimum free stack words ever observed for the current task.
Pattern 5: ITM Trace Printf
Host: ST-Link SWV viewer in STM32CubeIDE, or J-Link SWO Viewer, or OpenOCD tpiu + PuTTY serial.
Pattern 6: DWT Data Watchpoint (without debugger)
Use DWT comparators to detect writes to a specific address at runtime:
Anti-Patterns
- Using printf for timing analysis: printf is slow (UART or ITM) and perturbs timing. Use DWT->CYCCNT or toggle a GPIO on oscilloscope.
- Compiling with -O0 always: some bugs are optimizer-sensitive. Debug with -Og (debug optimizations) to get accurate backtraces while keeping most debug info.
- Ignoring IMPRECISERR: it means the fault address is not directly available. Enable BFHFNMIGN + process in NMI to find the source.
- Not initializing DWT before using cycle counter: CoreDebug->DEMCR bit must be set first, or DWT->CYCCNT stays 0.
References
- ARM CoreSight Architecture Specification: IHI0029
- OpenOCD documentation: openocd.org/doc/html/
- Percepio Tracealyzer: trace tool for FreeRTOS
- "Hard Fault Analysis" by Joseph Yiu (ARM community blog)
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/debug-trace/skills/debug-trace-patterns/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ormus-solutions/libreembed-claude-code/debug-trace-patterns)