LPC4357: Cannot detect watchdog reset

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

LPC4357: Cannot detect watchdog reset

跳至解决方案
1,710 次查看
johanborkhuis
Contributor III

I am trying to implement the WWDT function in the LPC4357. According to the user manual (section 38.5) I should be able to read the Watchog Mode register and determine if a watchdog reset was performed:

When the Watchdog Timer is configured so that a watchdog event will cause a reset and the counter reaches zero, the CPU will be reset, loading the stack pointer and program counter from the vector table as in the case of external reset. The Watchdog time-out flag (WDTOF) can be examined to determine if the Watchdog has caused the reset condition. The WDTOF flag must be cleared by software.

After a reset however the WDTOF is always 0, even if I break inside the Reset handler. How can I determine if the reset was caused by a watchdog timeout?

Regards,

Johan Borkhuis

标签 (2)
1 解答
1,182 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Johan,

    Thanks a lot for your patience.

    I already get the feedback from our according department. This problem already be confirmed, WDTOF can't be used as the watchdog timeout reset flag.

    Now, a workaround may help you.

    Just refer to use RGU mechanism with software flag to do it.

Capture.PNG

   You can define a variable in the RAM, after you enable watchdog, you can give a fixed value to that variable, then check the variable value before RAM initialization after code start, if it is the data which you defined after enable the watchdog, it means the reset is caused by the watchdog reset.

   Wish it helps you. Until now, I didn't find any other useful register to detect the watchdog timeout reset in LPC4357, so you can try the above RAM method workaround.

Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

5 回复数
1,183 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Johan,

    Thanks a lot for your patience.

    I already get the feedback from our according department. This problem already be confirmed, WDTOF can't be used as the watchdog timeout reset flag.

    Now, a workaround may help you.

    Just refer to use RGU mechanism with software flag to do it.

Capture.PNG

   You can define a variable in the RAM, after you enable watchdog, you can give a fixed value to that variable, then check the variable value before RAM initialization after code start, if it is the data which you defined after enable the watchdog, it means the reset is caused by the watchdog reset.

   Wish it helps you. Until now, I didn't find any other useful register to detect the watchdog timeout reset in LPC4357, so you can try the above RAM method workaround.

Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,182 次查看
johanborkhuis
Contributor III

Kerry,

Thank you for the answer. We had already made a solution that was comparable to this one, not using the RAM but using the RTC scratch area, as this area will not be cleaned by any startup code and can also be used to store other restart reasons.

Regards,

Johan Borkhuis

0 项奖励
1,182 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Johan Borkhuis,

   Thank you for your question.

   After the test on my side, I also reproduced your problem, I already help you to check it with our according department.

  Any updated information, will let you know, please wait patiently.

Kerry

1,182 次查看
johanborkhuis
Contributor III

Kerry,

Did you already get an answer from the other department?

Regard,

Johan Borkhuis

0 项奖励
1,182 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Johan,

   Our according department also reproduced this problem, they are still checking it now.

  Any updated information, I will let you know.

  Thanks a lot for your understanding.

Kerry

0 项奖励