- Home
- Skills
- Testing & Debugging
- HardFault Triage: Embedded Crash Analysis
More screenshots
Works with the AI Agents you already use
HardFault Triage: Embedded Crash Analysis
Read a microcontroller crash like a flight recorder: capture the fault registers before they decay, classify the signature, resolve the PC to a source line, and name the defect class.
$5
HardFault Triage: Embedded Crash Analysis
Example session with this skill installed
Our sensor node hard-faults every few hours, always during startup self-test. The dump shows a precise bus fault with BFAR = 0x40023800, and the PC resolves into adc_read(). What's the defect and the fix?
- Read your context and instructions
- Compiled the hardfault triage
TRIAGE — produced by the skill's four-step protocol, in order.
Capture: precise bus fault (CFSR bus-fault bits set, BFAR valid), fault address 0x40023800. Before resolving anything, the .elf and .map were verified against the shipped build — mismatched artifacts are the most common cause of confident, wrong locations. PC resolves into adc_read(); the stacked LR points at the startup self-test's read call.
Classify: precise fault, and the fault address sits exactly on a peripheral register block base (0x40023800 is the ADC). That signature is the classic init-ordering one: the peripheral is being touched while its clock is gated, so the bus access itself faults. Not a pointer bug — a precise fault at a peripheral base address almost never is, and the SRAM-address signatures (null pointer, use-after-free, heap overflow) don't fit an address in the peripheral region.
Locate: addr2line puts the PC on the first register read inside adc_read(), called only from the self-test at this point in boot.
Root-cause: in the startup sequence the self-test runs before the ADC's clock-enable step. The intermittence fits: on most boots an earlier driver touches the clock tree and leaves that clock on; on failing boots nothing has enabled it yet, so the self-test's first read faults. Timing luck, not a timing bug.
Finding, in the skill's required format: precise bus fault at 0x40023800 in adc_read() during startup self-test — ADC clock enable ordered after first use; fix is to move the clock enable ahead of the self-test. Logged alongside: this unit had its individual BusFault handler disabled, so the fault escalated to HardFault — enable the individual handlers in the next build so the next capture names the fault directly.
Connects securely to your tools. The creator never sees your data.
About this skill
When a microcontroller hard-faults, the register file and the stacked exception frame are a recording of the final moments — and most crash debugging fails because nobody reads it. This skill is the routine for reading it: capture, classify, locate, root-cause, always in that order. It starts with what makes a capture trustworthy: a naked fault handler that snapshots the fault-status and fault-address registers before any other code runs, a re-entry guard so the handler can't fault recursively into silence, and a dump over whatever output the field unit actually has. Then classification: the fault-status bits form signatures, and the skill teaches the common ones — a precise bus fault at a peripheral base is an unclocked peripheral, an imprecise fault points back at DMA and buffer lifetimes, an invalid-state fault means the PC is lying and the real story is a smashed pointer or return address. Location comes next: addr2line first, the map file when the line number isn't enough, and the stacked LR as a free first backtrace link — with an explicit check that the ELF and map files match the build that crashed, because mismatched artifacts produce precise, confident, wrong answers. Root-cause closes the loop with a signature-to-defect-class table and a required finding format: signature → location → defect class → fix, in one sentence, or the triage isn't done. A complete worked example walks a 20-minute intermittent crash from a fault address one byte past a heap boundary to the missing +1 for a NUL terminator. Leverage is built in: a fault capture record template, a pre-triage checklist, and a severity decision table. It closes with the edge cases that burn people — crashes that corrupt their own exception frame, escalated faults with overwritten evidence, debugger heisenbugs — plus anti-patterns and a pre-delivery quality gate.
- It cannot triage a crash you didn't capture: with no register dump and no matching build artifacts, the honest output is the instrumentation to add, not a root cause.
- Register names and frame layout are Cortex-M specific; other cores need their equivalent register set substituted in step 1.
- Imprecise faults (async DMA, write buffers) identify a suspect window, not a single instruction — the skill says so rather than inventing precision.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 24 days ago
Permissions
No special permissions declared or detected