2024-10-03 06:29 AM
Hi,playing around a program found hard fault handler on debugging Can anyone help to proceed that
2024-10-03 06:43 AM - edited 2024-10-03 06:44 AM
2024-10-03 07:35 AM - edited 2024-10-03 07:37 AM
Look at what's actually faulting.
Most likely bad address or point, or misalignment. The CM0(+) do not tolerate misaligned 32-bit access.
Have a handler that outputs actionable detail, this is NOT done with a while(1) loop.
You can inspect the registers and stack in the debugger, but it's not nearly as helpful as printing something out, especially in the field or end-users, who aren't going to have access.
Instrument your code so you've got some first idea as to where it's going, what it's doing, and where it is failing.