I did modify the WDT example to generate a warning interrupt before the CPU is reseted but i couldn't get the GREEN led on or that the interrupt is called before the WTD resets the CPU.
The warning is configured for 2 second and the timeout with 6 seconds.
config.timeoutValue = wdtFreq * 6;
config.warningValue = wdtFreq * 2;
If i disable the reset then the interrupt was called after 6 seconds with the warning flag set instead of the timeout flag.
Can anyone help me here with this problem?
Solved! Go to Solution.
CLOCK_SetClkDiv(kCLOCK_DivWdtClk, 64U, true);
config.warningValue = 0x3FF;
You were right, the interrupt is working, but the time frame between the interrupt and the watchdog reset was so short that I didn't notice when he led turned on and when the watchdog reseted the board the led was off again, and the debugger didn't stop in the interrupt as well for the same reason.
CLOCK_SetClkDiv(kCLOCK_DivWdtClk, 64U, true);
config.warningValue = 0x3FF;
You were right, the interrupt is working, but the time frame between the interrupt and the watchdog reset was so short that I didn't notice when he led turned on and when the watchdog reseted the board the led was off again, and the debugger didn't stop in the interrupt as well for the same reason.
Hi,
Hi,
void delayWwdtWindow(void)
{
/* For the TV counter register value will decrease after feed watch dog,
* we can use it to as delay. But in user scene, user need feed watch dog
* in the time period after enter Window but before warning intterupt.
*/
while (WWDT->TV > WWDT->WINDOW)
{
__NOP();
}
}
It seams that you don't really understand how this example works.
The first time when the program starts the timeOutResetEnable is set to true. If there is a watchdog reset then it will feed the Watchdog.
If the timeOutResetEnable is true then the Watchdog won't be feed.
I have changed now the settings to:
config.timeoutValue = wdtFreq * 6;
config.warningValue = 510;
config.windowValue = wdtFreq * 6;
So this are the set values:
What i want is that before the processor is resettled that the WDT_BOD_IRQHandler is called and i can do some things before the reset.
Can you give me some example how can achieve that?