debug-trace-patterns

debug-trace-patterns is a skill for Claude Code from HermeticOrmus/LibreEmbed-Claude-Code. It costs 68 tokens per session (1,708 once invoked), scanned A, original, MIT.

A reference guide for diagnosing faults in ARM Cortex-M microcontroller firmware using OpenOCD, GDB, J-Link, and a logic analyzer.

In plain words
What is it for?
Use it to decode HardFault status values, identify invalid memory accesses or divide-by-zero errors, and map a faulting program address to a source line.
Why use it?
It helps turn a processor fault report into a likely cause and source-code location, reducing guesswork during firmware debugging.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/user/project/src/sensor.c:87.

Part of the debug-trace plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to decode HardFault status values, identify invalid memory accesses or divide-by-zero errors, and map a faulting program address to a source line.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add HermeticOrmus/LibreEmbed-Claude-Code
Claude Code
/plugin install debug-trace

Made for: Claude Code.

Or install debug-trace, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for debug-trace-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/debug-trace-patterns/github.svg)](https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/debug-trace-patterns)
Your own site
<a href="https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/debug-trace-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/debug-trace-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for debug-trace-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/debug-trace-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/debug-trace-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,708 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.01708
Opus 5.5 $0.00027 $0.00683
Sonnet 5.5 $0.00014 $0.00342
Haiku 4.5 $0.00007 $0.00171

Measured 2mo ago against content hash 3a7d8b36fe25, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

debug-trace-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/debug-trace/skills/debug-trace-patterns/SKILL.md · 179 lines

How it starts

The opening of the file, as written. The whole thing — 179 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

CFSR = 0x00020000 → UFSR.INVSTATE (bit 17)
  Cause: Attempted to execute code with Thumb bit cleared in xPSR.
  Common cause: function pointer stored with bit 0 cleared (missing |1 for Thumb).

CFSR = 0x00000400 → BFSR.IMPRECISERR (bit 10)
  Cause: Imprecise bus error. BFAR is not valid.
  Common cause: DMA write to invalid address, async fault from write buffer.
  Fix: set SCB->CCR |= SCB_CCR_BFHFNMIGN_Msk temporarily to locate source.

CFSR = 0x00008200 → BFSR.PRECISERR + BFSR.BFARVALID
  Cause: Precise data bus error. BFAR = 0xE000ED38 contains fault address.
  Common cause: null pointer dereference, access to unmapped memory region.

CFSR = 0x02000000 → UFSR.DIVBYZERO (bit 25)
  Cause: Integer divide by zero.
  Fix: enable div-by-zero trap: SCB->CCR |= SCB_CCR_DIV_0_TRP_Msk.

Pattern 2: addr2line — Fault PC to Source Line

# Convert stacked PC to source file + line number
arm-none-eabi-addr2line -e firmware.elf -f -i 0x08003A24

# Output:
# sensor_read
# /home/user/project/src/sensor.c:87

# Also inspect LR to find the caller:
arm-none-eabi-addr2line -e firmware.elf -f -i 0x080038F6

The -i flag follows inline function chains.


Pattern 3: GDB Commands for Live Fault Debugging

# Full embedded debug session
arm-none-eabi-gdb firmware.elf
(gdb) target remote :3333       # OpenOCD GDB server
(gdb) monitor reset halt
(gdb) load

# After a fault occurs:
(gdb) info registers            # All CPU registers
(gdb) p/x *((uint32_t*)0xE000ED28)   # CFSR
(gdb) p/x *((uint32_t*)0xE000ED2C)   # HFSR
(gdb) p/x *((uint32_t*)0xE000ED34)   # MMFAR
(gdb) p/x *((uint32_t*)0xE000ED38)   # BFAR
(gdb) x/16xw $sp                # Stack dump
(gdb) backtrace                 # Unwind stack (requires -g and no -O2 optimization)

# Watchpoints: halt when variable changes
(gdb) watch g_critical_var
(gdb) rwatch *(uint32_t*)0x20001000   # Hardware read watchpoint (DWT)

Read the full file on GitHub · 179 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +5 lines · +68 tokens per session 3a7d8b36fe25
  2. 3mo ago First seen · 174 lines · 0 tokens per session scan A 352b85953fcc

Subscribe to this mod's changes

debug-trace-patterns is a skill published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (50 stars, last pushed 1mo ago), licensed MIT. It adds 68 tokens to every session and 1,708 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

debug-trace-patterns compared with skills from other repositories

debug-trace-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
debug-trace-patternsHermeticOrmus/LibreEmbed-Claude-CodeSkill501mo agoMITA68Claude Code
volt-otatonone-ai/tononeSkill842d agoMITA70Claude Code
volt-firmwaretonone-ai/tononeSkill842d agoMITA76Claude Code
volt-powertonone-ai/tononeSkill842d agoMITA65Claude Code
volt-drivertonone-ai/tononeSkill842d agoMITA63Claude Code
volt-recontonone-ai/tononeSkill842d agoMITA52Claude Code
iot-expertpersonamanagmentlayer/pclSkill461mo agoApache-2.0A59Claude Code