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
3,760 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
Reply
1 Solution
3,612 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
Reply
8 Replies
3,644 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
Reply
3,631 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
Reply
3,618 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
Reply
3,613 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
Reply
3,588 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
Reply
3,680 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
Reply
3,655 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
Reply
3,748 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
Reply