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

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

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

Jump to solution
1,508 Views
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 Kudos
1 Solution
1,360 Views
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?

View solution in original post

0 Kudos
8 Replies
1,392 Views
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 Kudos
1,379 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @kyf 

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

0 Kudos
1,366 Views
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 Kudos
1,361 Views
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 Kudos
1,336 Views
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 Kudos
1,428 Views
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 Kudos
1,403 Views
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 Kudos
1,496 Views
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 Kudos