Mcu Reset Reason query

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

Mcu Reset Reason query

583 Views
CaoRq
Contributor II

Hi ,NXP

     I am using S32K3 chip now,but  I am facing a problem

    Boot and App both use the function Mcu_GetResetReason,but the function will clear the reset Reason in it's first call. So when Boot jump to App ,App cannot get the reset reason .

    Can you tell me how to solve it

    Thank you in advance

0 Kudos
Reply
1 Reply

555 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @CaoRq 

That's desired behavior. Here's the reason:

 

image.png 

image.png

If the flags are not cleared, you wouldn't be able to get the most recent source of reset next time. Only power-on reset clears the flag, so the flags would cumulate in the registers after "non-power-on" resets and it would not be possible to recognize which flag was set as the last one.

Solution - read the reset reason by Mcu_GetResetReason and store it in own variable for next use.

Regards,

Lukas

 

0 Kudos
Reply