Hardfault Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hardfault Error

972 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dore on Mon Jan 13 02:07:43 MST 2014
Hi,

I have the boot code and application code in my case.
I have programmed them into the flash.
And while testing my boot loading functionality I am having an issue that while flashing the application code from the boot code, the controller goes to the Hardfault error.
At the same time it is not consistent, it is random.
Can anyone tell your experience with the Hardfault error and the relevant reasons?
Is there any possibility to disable that?

Best Regards,
Dore
0 Kudos
Reply
4 Replies

944 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Jan 21 08:44:28 MST 2014
So have you tried debugging it as previously suggested? Random crashes like this are often stack related.

Regards,
LPCXpresso Support
0 Kudos
Reply

944 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dore on Tue Jan 21 07:17:10 MST 2014
We had taken care of jumping with the bottom bit enabled/set.
Please note our issue doesnt happen always. Most of the times it works fine. I can say 7 out of 10 times new firmware loading is successful.
3 times it fails.
0 Kudos
Reply

944 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Jan 13 07:54:02 MST 2014
Information on debugging hard faults with the LPCXpresso IDE can be found at:

http://www.lpcware.com/content/faq/lpcxpresso/debugging-hard-fault

One common cause of issues when using a secondary boot loader is that the BX branch instruction used to branch off from the bootloader to the main application code must ensure that the bottom bit of the address value is set, to ensure that no attempt is made to switch into ARM state (which does not exist on Cortex-M class devices).

Regards,
LPCXpresso Support
0 Kudos
Reply

944 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Mon Jan 13 02:13:55 MST 2014
Hi Dore,

a hardfault is a consequence of a programming error in your boot code or application.
To prevent that hardfault occurs you must find out what problem is in boot code or application.

Here is a helpful page:
http://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html

Perhaps your environment already supports displaying info about the occured hardfault.

Best regards,

Martin
0 Kudos
Reply