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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,062 次查看
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 ?

标签 (1)
标记 (3)
1 解答
848 次查看
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

在原帖中查看解决方案

2 回复数
849 次查看
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

848 次查看
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 项奖励
回复