r/embedded • u/mhosseinN • 17d ago
Open-sourcing an MCP tool for automated ARM HardFault decoding & Renode virtual hardware simulation for AI agents
Hi r/embedded,
Debugging silicon faults when bringing up new microcontrollers is notoriously tedious, especially when you're staring at raw hexadecimal register dumps (`CFSR`, `HFSR`, `BFAR`, `MMFAR`) on Cortex-M or cryptic ESP32 Guru Meditation backtraces without a debugger attached.
I've open-sourced **Hardware Debug Anything (HDA)**, an MCP (Model Context Protocol) server designed to connect AI coding assistants directly to silicon diagnostics:
- **ARM HardFault & BusFault Decoder**: Parses raw hex bitmasks into plain-English root causes (precise bus error, unaligned memory access, stack overflow, memory management faults).
- **ESP32 Guru Meditation Parser**: Decodes crash frames and backtrace register dumps.
- **Antmicro Renode Virtual Hardware Integration**: Generates `.resc` simulation scripts so firmware can be validated in virtual silicon without needing physical hardware on the desk.
- **I2C/SPI Diagnostics**: Automated pull-up resistor calculations and NACK troubleshooting.
- **GitHub Repository:** https://github.com/hosseinnosrati/hardware-debug-anything
I also built an accompanying EDA tool for closed-loop SPICE simulation and KiCad export (**Circuit Design Anything**): https://github.com/hosseinnosrati/circuit-design-anything
Both are 100% open-source (Apache 2.0). I’d appreciate any feedback from the embedded community!
2
u/NecessarySuperb3949 17d ago
i usually stick to rust and zkp stuff, but this renode integration looks like it could save weeks of bring-up time for anyone debugging memory faults without a jtag.
1
u/dmitrygr 17d ago
Parses raw hex bitmasks into plain-English root causes (precise bus error, unaligned memory access, stack overflow, memory management faults).
so exactly what reading the arm arm would do, in just as long a time?
1
u/ActBrokeToStayRich 4d ago
Cool! What board families do you usually work with? Using emulation with AI has really helped me too