Metadata-Version: 2.4
Name: cfsr-decoder
Version: 1.1.0
Summary: Zero-dependency ARM Cortex-M fault status register decoder CLI
Author-email: Trust & Thread <contact@trustandthread.com>
Project-URL: Homepage, https://www.trustandthread.com
Project-URL: Bug Tracker, https://github.com/GaneshMba4066/cfsr-decoder/issues
Project-URL: Documentation, https://www.trustandthread.com/firmware-checklist/
Keywords: arm,cortex-m,stm32,hardfault,firmware,debugging,cfsr
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Embedded Systems
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# cfsr-decoder

A zero-dependency ARM Cortex-M fault status register decoder for embedded systems students, hobbyists, and firmware engineers.

Whenever an STM32, RP2040, NXP, or SAM microcontroller locks up in an infinite `HardFault_Handler` loop, the CPU writes the failure cause into the ARM core registers (`CFSR`, `HFSR`, `BFAR`, `MMFAR`). 

Decoding those bitmasks manually from the ARM Architecture Reference Manual is slow. `cfsr-decode` turns raw hex register dumps into clear, plain-English diagnostics and recovery steps.

---

## Quick Start (Zero Dependencies)

Runs directly with standard Python 3.6+:

```bash
# General syntax
python cfsr_decode.py <CFSR_HEX> [BFAR_HEX] [MMFAR_HEX] [HFSR_HEX]

# Try a realistic unaligned access fault
python cfsr_decode.py 0x00010200 0x20001FF7

# View all built-in examples
python cfsr_decode.py --example
