Seven Tips for Debugging like a PRO: (2) Debug a HardFault
- Scenario
Enter debug mode and find out the project is stuck in the hard fault handler.
- Debug Tips
Find the last instruction before entering the hard fault.
Under Debug mode.
1.Get SP (Stack Pointer) value.
2.Use SP value to find the stack in the Memory window.
3.The 7th value of the stack is the address of the last instruction.
4.Use the address to find the last instruction in the Disassembly window.