Skip to main content
fredy368
Associate
August 18, 2010
Question

Got Hard Fault exception in the UART IAP example

  • August 18, 2010
  • 2 replies
  • 547 views
Posted on August 18, 2010 at 12:24

Got Hard Fault exception in the UART IAP example

#iap

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    May 17, 2011
    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    fredy368
    fredy368Author
    Associate
    May 17, 2011
    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!