Cortex-M fault decoder
Paste the fault status registers from a crashed Cortex-M and see what each bit means.
Decoder
Enter at least one register value in hexadecimal, then press Decode.
Everything runs in your browser. The values you enter are not sent anywhere.
How to use it
- Stop in your fault handler, or read the registers from a crash log.
- Copy the value of
CFSR, and ofHFSRandSFSRif you have them. - Paste them above and press Decode.
In GDB you can read a register with its address:
(gdb) x/wx 0xE000ED28
What the registers are
| Register | Address | What it reports |
|---|---|---|
| CFSR | 0xE000ED28 | MemManage, BusFault and UsageFault causes |
| HFSR | 0xE000ED2C | Why a HardFault was taken |
| SFSR | 0xE000EDE4 | SecureFault causes, on Armv8-M with TrustZone |
The status bits stay set until software clears them, so a value can show more than one fault if earlier ones were never cleared.
The cheat sheet lists every bit in one place.