8051-mcu-debug
Use when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers, UART, or startup failures
Use when embedded firmware crashes, traps, faults, resets unexpectedly, jumps to default handlers, corrupts stack, or executes invalid instructions
$ npx -y skills add easyzoom/aix-skills --skill embedded-fault-debug --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/embedded-fault-debugContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when embedded firmware crashes, traps, faults, resets unexpectedly, jumps to default handlers, corrupts stack, or executes invalid instructions
name: embedded-fault-debug description: Use when embedded firmware crashes, traps, faults, resets unexpectedly, jumps to default handlers, corrupts stack, or executes invalid instructions
Use this skill to preserve crash evidence and find the first failing instruction. The agent should read architecture-specific fault state before reset, map addresses to symbols, and separate root cause from secondary symptoms.
Use this skill when:
Do not use this skill when the target cannot yet connect or flash; use `mcu-flashing-debug` first.
Ask for:
1. Preserve state. Do not reset or reflash until fault registers, PC, LR/RA, SP, and stack frame are captured.
1. Confirm image-symbol match. Ensure the ELF/MAP file matches the firmware currently running on target.
1. Identify the faulting address. Map PC, exception return address, `mepc`, stacked PC, or return address to a symbol and source line.
1. Classify the cause. Separate invalid memory access, illegal instruction, stack overflow, alignment, bus/peripheral access, watchdog, assert, and default handler cases.
1. Walk backward to the first bad state. Inspect caller, input pointers, stack bounds, interrupt context, DMA/cache interactions, and recent initialization.
1. Add a focused verification. Use a watchpoint, assertion, guard pattern, stack watermark, or minimal repro to prove the suspected cause.
Read SCB fault registers before reset:
CFSR = 0xE000ED28 HFSR = 0xE000ED2C MMFAR = 0xE000ED34 BFAR = 0xE000ED38
Decode stacked `r0-r3`, `r12`, `lr`, `pc`, and `xpsr` from MSP or PSP.
Read:
mcause, mepc, mtval, mtvec, mstatus, sp
Check whether `mcause` is interrupt or exception, and map `mepc` to source/disassembly.
Use available evidence:
Before claiming a fault is understood:
User:
程序跑一会儿就进 HardFault。
Agent:
1. Asks for chip, ELF, register dump, CFSR/HFSR, stacked PC, and whether reset happened. 1. Maps stacked PC to source. 1. Checks stack bounds, caller, interrupt context, and invalid memory access evidence. 1. Suggests a focused watchpoint or stack watermark before changing code.
AIX Skills is a public collection of Agent Skills, templates, and references for building repeatable AI workflows.
Use when debugging 8051-compatible microcontrollers, 51 MCU firmware, STC download issues, Keil C51 projects, interrupts, timers, UART, or startup failures
Use when integrating, evaluating, configuring, or debugging Avem embedded C framework modules, event-driven components, drivers, middleware, or application…
Use when integrating or debugging Li-ion charger/fuel gauge ICs (BQ24295, BQ27441, MAX17048) over I2C, covering charge start, watchdog host mode, NTC/JEITA…
Use when integrating, designing, or debugging BLE GATT services, characteristics, descriptors, MTU, notifications, indications, pairing, connection parameters,…
Use when debugging embedded bootloaders, application jumps, vector table offsets, firmware upgrade flow, OTA state, image validation, rollback, or boot…
Use when integrating, porting, configuring, or debugging CAN bus libraries, CANBus-Triple, MCP2515, CAN frames, bit timing, filters, or embedded automotive…