embedded-debug-optimization
Installation
SKILL.md
Embedded Debugging & Resource Optimization
Follow this systematic triage workflow for firmware crashes, watchdog resets, and Flash/RAM/timing optimization.
Workflow
-
Capture exact failure evidence
- Obtain the full crash dump, reset reason (
esp_reset_reason(), STM32RCC->CSRflags), register dump (PC,LR,SP,CFSR,HFSR,EXCVADDR), and the exact matching.elfbinary built from the same commit. - If live hardware is connected, capture logs safely using
serial_capture.py(never hang on an interactive monitor).
- Obtain the full crash dump, reset reason (
-
Decode crash addresses to source lines
- Run decode_crash.py against the crash log and
.elffile:python scripts/decode_crash.py --elf path/to/firmware.elf --log crash.txt - Alternatively pass raw hex addresses via
--addrs 0x400d1234 0x08004abc. - Consult Fault Triage Reference to classify the root cause (null/unaligned pointer, stack overflow, bus fault, cache-disabled flash access in ISR, watchdog starvation).
- Run decode_crash.py against the crash log and