Posted on September 07, 2017 at 18:24 It's a topic covered frequently, please review prior postings, saves me having to repeat myself.
Read the ARM TRM (Technical Reference Manual) for the core. Get Joseph Yiu's book on the Cortex-Mx for an different perspective.
Hard Fault - Gross Error, you've done something stupid, reading/writing memory that doesn't exist, trashed the stack, errant pointers, alignment of 64-bit read/write. Trying to run 32-bit code, instructions not supported, FPU not enabled.
Cortex-M0, has less instructions and more alignment issues, will fault if you violate the rules.
Writes are deferred, error location likely to be 'imprecise' but within a few instructions of offending code, look at disassembly, look at registers.
Have a Handler
https://community.st.com/0D50X00009XkfOXSAZ
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..