How to know the microcontroller restart reason

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

How to know the microcontroller restart reason

跳至解决方案
1,234 次查看
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 项奖励
回复
1 解答
1,197 次查看
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 项奖励
回复
4 回复数
1,181 次查看
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 项奖励
回复
1,198 次查看
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 项奖励
回复
1,180 次查看
sudhanshumehta
Contributor IV

for more details my reply is below

 

0 项奖励
回复
1,208 次查看
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 项奖励
回复