Content originally posted in LPCWare by CodeRedSupport on Mon Jul 26 06:17:59 MST 2010
I made 3 points in my, you only commented on the 2nd. To repeat the others:
When the HardFault occurs, the Core Registers view will show some additional information to help determine the cause of the Fault. e.g. VECTPC will show the PC that caused the fault, and the tooltip will show where that is in your code. Look at this to help you determine where your code has gone wrong.
Also, note that the heap and the stack share memory.
- The heap starts at the end of your RAM data and grows 'up' (larger addresses)
- The stack starts as the top of RAM and grows 'down (small addresses)
There is no stack checking, so the two can grow to overwrite each other. So one possibility is that this has happened.