Why this is happening ? Hard fault error at Clock_Ip_InitClock() function

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

Why this is happening ? Hard fault error at Clock_Ip_InitClock() function

跳至解决方案
3,832 次查看
kyf
Contributor V

Hello NXP team.

 

I'm getting hard fault error at Clock_Ip_InitClock() function. If I recompile the code with different optimization this may go away and if I change the code for example add a new variable or something insignificant the hardfault error may not happen again.

 

kyf_0-1674575634473.png

 

I get interrupted many times while debugging other code and I can't find the reason why this is happening.

 

Have you ever had any similar report ?
Can I do anything to find out the real reason for the hard fault error?

 

Kind regards,

kyf

 

0 项奖励
回复
1 解答
3,684 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @kyf 

I could not replicate your problem using Clock_Ip_Example and all optimization levels.To be in the same context, could you try that example?

It would also help me to know what optimization level you are using. And also, have you tested in different EVBs?

在原帖中查看解决方案

0 项奖励
回复
8 回复数
3,716 次查看
kyf
Contributor V

Hello @VaneB .

I've attached the clocks in this reply. I don't want to claim that I've replicated this with examples code because I don't have any example code to share with you regarding this issue. But i remember having the same error with example code (with slightly mods). The issue there was that I had changed optimization level and the same issue occurred.

Kind regards,

kyf.

0 项奖励
回复
3,703 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @kyf 

From what I understood, this problem started when the optimization was changed. Am I correct?

0 项奖励
回复
3,690 次查看
kyf
Contributor V

@VaneB  Yes, this happens only after optimization level change. I have tried many times to delete the build folder and rebuild from scratch but the error keeps popping up. Unless I add any code to my project it does not disappear.

0 项奖励
回复
3,685 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @kyf 

I could not replicate your problem using Clock_Ip_Example and all optimization levels.To be in the same context, could you try that example?

It would also help me to know what optimization level you are using. And also, have you tested in different EVBs?

0 项奖励
回复
3,660 次查看
kyf
Contributor V

@VaneBthank you for your efforts.

Sadly, I can not share the project that I'm working and I haven't stored any copy of a project that I had this issue. If the same happens again I will store the project and all it's settings in order to sent it to you for testing.

Kind regards,

kyf

0 项奖励
回复
3,752 次查看
kyf
Contributor V

Hello @VaneB, thank you for replying to my request.

 

I'm using S32K344 with RTD v2.0. I'm working my project at the moment with the S32K3x4EVBQ172 devboard.

I've noticed last time that I've got this error, just only by adding some extra lines of code for example some nop instructions the error did ceased to occur.

 

1. Can you guide me in order to narrow down the cause of this issue ?

If you need any extra information from my side please let me know.

 

 

Kind regards,

kyf

0 项奖励
回复
3,727 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @kyf 

Could you help me by sharing the settings you made to the clocks?
Does this error happen to you in any of the examples provided with the RTD?

0 项奖励
回复
3,820 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @kyf 

When executing the code examples, do you get the hard fault error in the Clock_Ip_InitClock() function or is this only presented in your code?

Also, can you tell us the MCU that you are using? And also, which software?

 

B.R.

VaneB

0 项奖励
回复