How to debug different types of Hardfaults in STM32. How to understand and recover the faults
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 3:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 3: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 3: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.
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 4:03 AM
I want to understand more how to recover from the hardfault after understanding the line of error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 5: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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-22 8:24 PM
Ya ok thank you for the suggestion
