Hello,
I am working with DSP C55x and CCSv5.2 to test WDT, and I faced a problem about WDT.
I use CSL function to do watchdog reboot action.
Sometimes the example works success,
but sometimes it can't reboot when WDSVR countdown reach 0.
Do I missing anything? or any suggestions to solve this abnormal behavior?
Here is my example.
Void Enable_WDT()
{
/* Watchdog timer Object structure */
CSL_WdtObj wdtObj;
CSL_Status status;
CSL_WdtHandle hWdt = NULL;
WDTIM_Config hwConfig;
Uint16 counter;
/* Open the WDTIM module */
hWdt = (CSL_WdtObj *)WDTIM_open(WDT_INST_0, &wdtObj, &status);
if(NULL == hWdt)
{
return (CSL_TEST_FAILED);
}
hwConfig.counter = 0xFFFF;
hwConfig.prescale = 0x0FFF;
/* Configure the watch dog timer */
status = WDTIM_config(hWdt, &hwConfig);
if(CSL_SOK != status)
{
return (CSL_TEST_FAILED);
}
/* Start the watch dog timer */
status = WDTIM_start(hWdt);
if(CSL_SOK != status)
{
return (CSL_TEST_FAILED);
}
return (CSL_TEST_PASSED);
}