2021-02-22 03:19 AM
2021-02-22 03:27 AM
Have a look to STM32CubeIDE user manual: https://www.st.com/resource/en/user_manual/dm00629856-stm32cubeide-user-guide-stmicroelectronics.pdf
See 'Fault Analyzer' section.
2021-02-22 03:57 AM
The Hard Fault mechanism is standard for Cortex-M - there's a lot of info available online; eg,
and follow all the links.
In particular, I'd emphasise the recommendation of Joseph Yiu's Definitive Guide books.
2021-02-22 04:03 AM
I want to understand more how to recover from the hardfault after understanding the line of error
2021-02-22 05:04 AM
Recover how? In the sense of fixing the source code, or continuing execution?
Usually you should be able to relate the failing assembler code to something you were doing in C, ie accessing a pointer, touching memory incorrectly, returning from a subroutine, etc. Several diagnostic dumping routines have been posted here over the years, review some of those.
Continuing execution would take some serious skillz, you'd have to unpack the instruction flow and figure out how to remediate the situation before returning and rerunning the code, or advancing the code. It might be easier to use some try/catch exception code where you could at least manage and contain the failure.
2021-02-22 08:24 PM
Ya ok thank you for the suggestion