This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Hard Fault on cortex M3 NXP

Note: This was originally posted on 20th June 2011 at http://forums.arm.com

I've coded a small program to download in a usb memory some data acquired from the LPC1768 Cortex M3.
I use IAR EW to code and J-Link LITE to program/debug the code.

So, when I test my program with debugger connected (either in debug or release mode) it works fine.

When I program the micro and run it without the debugger connected I obtain an Hard Fault exception.

When I check the value of HFSR it return 0x80000000 -> DEBUGEVT = 1 ?

Why? Where is my fault?

Thanks.

Alessandro
Parents
  • Note: This was originally posted on 20th June 2011 at http://forums.arm.com

    The most likely issue is that the program has called a function which try to communicate with the debugger.
    A breakpoint (BKPT) instruction is executed, and since there is no debugger attached, it went into hardfault instead.

    Keil website has an application note about debugging fault exception:
    http://www.keil.com/appnotes/docs/apnt_209.asp

    Please try to generate a disassemble code of the program image and see if there is any BKPT instruction generated, and trace what function call could have run the BKPT function.

    Hope this helps.

    regards,
    Joseph
Reply
  • Note: This was originally posted on 20th June 2011 at http://forums.arm.com

    The most likely issue is that the program has called a function which try to communicate with the debugger.
    A breakpoint (BKPT) instruction is executed, and since there is no debugger attached, it went into hardfault instead.

    Keil website has an application note about debugging fault exception:
    http://www.keil.com/appnotes/docs/apnt_209.asp

    Please try to generate a disassemble code of the program image and see if there is any BKPT instruction generated, and trace what function call could have run the BKPT function.

    Hope this helps.

    regards,
    Joseph
Children
No data