Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Level 2
Level 2
First solution authored First like received 5 questions asked
At present, when debugging the watchdog module, the following problems are encountered:
(1) The current requirement is to use the watchdog module to time out and then generate a reset under certain circumstances. After the first timeout reset, the program runs again. At this time, the second watchdog timeout reset will cause the program to hang up and enter a permanent reset. I have such processing in the interrupt service routine of my watchdog module as shown. According to the manual, in theory, it shouldn't go into a permanent reset on the second reset.


(2) When connecting the debugger for online debugging, the watchdog module cannot run. What should be done to realize the online debugging of the watchdog module?
Looking forward to your reply!
1 Reply
250 sign-ins 250 solutions authored 5 questions asked

Hello @tony ,

It is not clear which function of WDT do you want to have.

If the WDT is enabled then you need to serve it before timer overflow. In case when you don’t serve it, WDT goes in the prewarning state, after additional 256 cycles the MC goes to WDT reset. 

When MC becomes WDT reset at twice, MC goes to ‘permanent reset’.  

on the other hand, you can disable WDT via set ‘DISWDT’ in *.asm to deactivate WDT, for example.

additionally, you need to check the Errata Manual (WDT_X.002) to avoid the permanent reset’. In short: you should clear the internal flag via set WDTCS.CLRIRF=1 in the interrupt service routine of 'WDT prewarning' otherwise a further WDT overflow will lead to a permanent reset of the device.

please be aware that for testing you should not use debug tool because in debug mode the WDT is disabled.

Best regards,

Sampath Selvaraj