cancel
Showing results for 
Search instead for 
Did you mean: 

Got Hard Fault exception in the UART IAP example

fredy368
Associate II
Posted on August 18, 2010 at 12:24

Got Hard Fault exception in the UART IAP example

#iap

2 REPLIES 2
Posted on May 17, 2011 at 14:03

Absent any specific code example, or example of the data being uploaded, one might reasonably surmise that what you are uploading is invalid, and you are either jumping to, or executing, code which touches memory it should not.

You are likely to get a Hard Fault if you execute code on an even boundary (PC), the STM32 supports only 16-bit THUMB code, not 32-bit ARM.

You set your stack pointer (SP) outside of RAM, or incorrectly aligned.

Touch memory outside the normal RAM, FLASH, or Peripheral space, or was incorrectly aligned.

Suggest you attach at JTAG debugger to the system and step through the code, observing the memory/register settings when it faults. Or instrument the Hard Fault handler to display details of the faulting code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
fredy368
Associate II
Posted on May 17, 2011 at 14:03

Hi clive1,

Thanks for your kindly help! I found what is wrong on the code.

Yup, due to incorrect address assigned, it points to a wrong address and then caused this problem. Thanks again!