Watchdog Timer and NMI handler documentation

5 posts / 0 new
Last post
Dave.Renzo
Offline
Last seen:2 years 7 months ago
Joined:2015-10-08 13:21
Watchdog Timer and NMI handler documentation

Hi Support,

I am running into a problem with a design I'm working on and I would like to use the watchdog timer to try and recover . Is there any documentation that describes the Watchdog timer and NMI's? Thanks.

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi Dave,

Hi Dave,

You can find some info about the NMI and Hardfault Handlers in the UM-B-051 section 7, since you are in DEVELOPMENT_DEBUG the NMI handler will save the state of the proccessor in order for the user to debug, if you 're not in DEVELOPMENT_DEBUG the da will reset and the boot rom will execute.

Thanks MT_dialog

Dave.Renzo
Offline
Last seen:2 years 7 months ago
Joined:2015-10-08 13:21
I looked at the info in

I looked at the info in section 7.2.5.2 of UM-B051 and need a bit of clarification. From that section:

"In development debug mode, the ASSERT_ERROR() and ASSERT_WARNING() macros are defined
as breakpoints. Upon detecting erroneous condition the program will halt and the user can attach the
debugger and figure out what caused the error"

The problem I'm experiencing seems to be happening when I am using extended sleep mode. If I use the watch dog timer while in DEVELOPMENT_DEBUG will I be able to connect the debugger in the event of NMI? Because as it is right now the code won't run when extended sleep is enabled and a debug session is open in keil uVision 5. Is there a way to restore the debug session within keil?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi Dave,

Hi Dave,

When operating in extended sleep and the watchdog timer elapses the DEBUG module is turned on by the NMI Handler, also the registers of the proccesor are stored in the address 0x81850 (or to the 0x81800 by the hardfault handler). If your program has stopped in the NMI you can reconnect the debugger in order to check the PC counter and firgure out what caused the program to crash.

In order to re-attach the debugger you do the following:

1) Create a copy of your project xxx.uvprojx in your project's application folder.

2) Open this new project and go to the project options, in the debug tab do the following.

3)禁用加载在启动应用程序检查box and erase the link in the initialization file.

4) Click on the settings of the debugger and disable the reset after connect check box.

5) Click ok and close the project options.

Now when the problem occurs you can run this new project in order to re - attach the debugger and read the memory locations i ve mentioned previously (in the memory window choose the view as unsigned long). You can find the program counter as the 7th unsigned long number in the memory view.

Thanks MT_dialog

Dave.Renzo
Offline
Last seen:2 years 7 months ago
Joined:2015-10-08 13:21
Thanks, that's exactly what I

Thanks, that's exactly what I needed.

Topic locked