2021-02-15 11:21 PM
2021-02-16 01:59 PM
Debug HardFault as usually - trace back from stack the offending instructions/data, best observed in disasm.
"SD loop" is *your* program, regardless of whether you used some "library" or not.
JW
2021-02-16 11:17 PM
Thanks for your reply. I appreciate that the "SD Loop" is my loop, regardless of library usage, I was mearly pointing out that this is whare the HardFault_Handler problem was being generated. My question was really how do I find out what the problem is?
2021-02-17 03:01 AM
https://stackoverflow.com/questions/53253652/debugging-a-hard-fault-in-arm-cortex-m4
Clive wrote about debugging hardfault many times on this forum, too; try searching.
JW
2021-02-17 03:26 AM
And as other threads about hardfaults mention, the SCB fault registers should tell you about reason and location.
2021-02-17 08:55 AM
[shameless self-plug] fault registers cheatsheet [/shameless self-plug]
JW
2021-02-17 09:05 AM
https://community.st.com/s/global-search/hard_fault_handler_c
https://community.st.com/s/question/0D53W00000QSKcmSAH/how-to-parse-raw-stack-data-in-hex-stm32f4