Bfd fault logger

From Sonder4/STM32-BFD-Kit · View interactive version

Bfd fault logger is an AI agent skill from the GitHub repository Sonder4/STM32-BFD-Kit. Use when recording STM32 hardware faults such as HardFault, BusFault, and UsageFault, then exporting structured fault reports.

How to use this skill

Skill file

BFD Fault Logger

Self-Improvement Loop (Required)

Use this skill to archive fault evidence in structured formats.

Quick Start

  1. Create logs/hw_error/.
  2. Capture fault context before reset.
  3. Save records, classify, and export reports.

Core Commands

# Record one HardFault example
python3 - <<'PY'
import sys
sys.path.append('.codex/skills/bfd-fault-logger/scripts')
from error_logger import HardwareErrorLogger
logger = HardwareErrorLogger(storage_path='logs/hw_error')
record = logger.record_hard_fault(
    registers={"PC":"0x08004567","LR":"0x08002345","SP":"0x2001FFF0"},
    cfsr='0x00000200', hfsr='0x40000000',
    stack_trace=['0x08004567','0x08002345']
)
print(record.id)
PY
# Classify records
python3 ./.codex/skills/bfd-fault-logger/scripts/error_classifier.py
# Export reports
python3 ./.codex/skills/bfd-fault-logger/scripts/error_exporter.py
mv -f test_report.json logs/hw_error/
mv -f test_report.csv logs/hw_error/

Workflow

  1. Capture and store fault context.
  2. Classify severity and source.
  3. Export JSON/CSV/HTML reports.

Hard Rules

Scripts

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.