How to fix the hardfault error that occurs after debugging the code into the board ?

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

How to fix the hardfault error that occurs after debugging the code into the board ?

Jump to solution
1,061 Views
ganeshramachand
Contributor IV

150034_150034.jpgASKNXP.jpg

As shown in the screenshot above. I am getting this hardfault problem when I try to debug the UART Boot loader code -AN4767 (whose features I slightly modified according to the Board and the Controller I am using) on a custom board fitted with MKE02Z64VLD2. I am using Docklight v2.1 for serial communication.

The Problem Is,

I debug the code. It debugs fine.

Then I press the resume button in the Kinetis Design Studio IDE (Version 2). No problem occurs.

I open the Docklight and send some characters like this,

150062_150062.jpgDocklightfor nxp.jpg

For the first time when I send FC 49 am receiving the character FF back. But when I try to send a character for the second or third or nth time. I am ending up with this Hardfault.

Then I re-debug the code, I send a character again, I am receiving a character back, but again when i try to send it the second (or any number of times) like previous attempts I am ending up with HardFault.

How to fix this ?

Labels (1)
1 Solution
847 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Ganesh,

Could you set breakpoint to check when run to which place  , then it run to Hardfault ?

You'd better step by step to check when it crash , or you can also take screenshot about the steps.

And have you change the code ?

Another point , when it crash , please check the data of  "uiRepeatCount" ?

pastedImage_0.png

BR

Alice

View solution in original post

2 Replies
848 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Ganesh,

Could you set breakpoint to check when run to which place  , then it run to Hardfault ?

You'd better step by step to check when it crash , or you can also take screenshot about the steps.

And have you change the code ?

Another point , when it crash , please check the data of  "uiRepeatCount" ?

pastedImage_0.png

BR

Alice

847 Views
ganeshramachand
Contributor IV

Thanks Alice. Its fixed now. When you come online, kindly check this thread and reply. How to change the linker file settings for loading the application file into the board ?

Thanks in advance.

0 Kudos
Reply