How to know the microcontroller restart reason

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

How to know the microcontroller restart reason

Jump to solution
1,155 Views
sudhanshumehta
Contributor IV

Hello,

We are using MK221M controller. 

RTOS MQX4.2

I need to know the restart reason of microcontroller on every reboot.

Example: Microcontroller can restart due to Watchdog, power cycle etc. 

Can you please suggest me way to do that?

Thanks

Sudhanshu 

0 Kudos
Reply
1 Solution
1,118 Views
bobpaddock
Senior Contributor III
I've not used this part, does it have a Reset Control Module (RCM)?

Look for something like System Reset Status Register 0 (RCM_SRS0 and SRS1) etc.

Some times there are also 'sticky' copies. Better to use those results if available.

View solution in original post

0 Kudos
Reply
4 Replies
1,102 Views
sudhanshumehta
Contributor IV

IMG_0282.PNG

Yes RCM->SRS0, RCM->SRS1 are the registers. this is complete detail. bobpaddock was right. you can read printf ("\r\n Restart reason code %.02x %.02x", RCM->SRS0, RCM->SRS1);

0 Kudos
Reply
1,119 Views
bobpaddock
Senior Contributor III
I've not used this part, does it have a Reset Control Module (RCM)?

Look for something like System Reset Status Register 0 (RCM_SRS0 and SRS1) etc.

Some times there are also 'sticky' copies. Better to use those results if available.
0 Kudos
Reply
1,101 Views
sudhanshumehta
Contributor IV

for more details my reply is below

 

0 Kudos
Reply
1,129 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi @sudhanshumehta 

 

I would suggest you ask our partner, Embedded Access, for this question.

https://embedded-access.com/

 

Regards

Daniel

0 Kudos
Reply