Posts

Debugging a hard fault in ARM Cortex-M4

Image
2 I am at my wit's end trying to debug a hard fault on an EFR32BG12 processor. I've been following the instructions in the Silicon Labs knowledge base here: https://www.silabs.com/community/mcu/32-bit/knowledge-base.entry.html/2014/05/26/debug_a_hardfault-78gc I've also been using the Keil app note here to fill in some details: http://www.keil.com/appnotes/files/apnt209.pdf I've managed to get the hard fault to occur quite consistently in one place. When the hard fault occurs, the code from the knowledge base article gives me the following values (pushed onto the stack by the processor before calling the hard fault handler): Name Type Value Location ~~~~ ~~~~ ~~~~~ ~~~~~~~~ cfsr uint32_t 0x20000 (Hex) 0x2000078c hfsr uint32_t 0x40000000 (Hex) 0x20000788 mmfar uint32_t 0xe000ed34 (Hex) 0x20000784 bfar uint32_t 0xe000ed38 (Hex) 0x20000780 r0 uint32_t 0x0 (Hex) 0x2000077c r1 uint32_t 0x8 (Hex) 0x20000778 r2 uint32_t 0x0 (Hex) 0x20000774 r3 uint32_t 0x0 (Hex) 0...