I have used watchdog function and wanted to kick watchdog using a normal timer, every 5 seconds.
The timer of watchdog is set 10 sec by using setReload(). and my device uses power saving .
But the watchdog does not trigger after 10 sec, when a value of ReloadGet() and current value is compared. (refer Log_warning2)
So, i guess that watchdog timer is delayed in sleep mode, because the clock source of MCU is changed 48Mhz to 32Khz .
How can the watchdog be exactly triggered after 10 sec, when a system uses power saving mode.
//in board.c file /* * ========================== Watchdog begin ======================================= * */ #include <ti/drivers/Watchdog.h> #include <ti/drivers/watchdog/WatchdogCC26XX.h> WatchdogCC26XX_Object watchdogCC26XXObjects[CC2650_WATCHDOGCOUNT]; const WatchdogCC26XX_HWAttrs watchdogCC26XXHwAttrs[] = { { .baseAddr = WDT_BASE, .intNum = INT_WATCHDOG, } }; const Watchdog_Config Watchdog_config[] = { { &WatchdogCC26XX_fxnTable, &watchdogCC26XXObjects[0], &watchdogCC26XXHwAttrs[0] }, { NULL, NULL, NULL }, }; /* * ========================== Watchdog end ========================================= */ //............ //in task.c file #include <ti/drivers/Watchdog.h> #include <ti/drivers/watchdog/WatchdogCC26XX.h> #include<driverlib/watchdog.h> Clock_Struct watchdogKickTimer; Watchdog_Handle hWDT; void watchdogKickHandler(UArg arg) { Log_warning2("%d, %d", WatchdogReloadGet(), WatchdogValueGet()); Watchdog_clear(hWDT); } //... void someTask() { Watchdog_Params wp; Watchdog_Params_init(&wp); wp.callbackFxn = NULL; wp.debugStallMode = Watchdog_DEBUG_STALL_ON; wp.resetMode = Watchdog_RESET_ON; hWDT = Watchdog_open(CC2650_WATCHDOG0, &wp); Watchdog_setReload(hWDT, 10*1500000); // 10sec (WDT runs always at 48MHz/32) Util_constructClock(&watchdogKickTimer, watchdogKickHandler,5*1000, 5*1000, true, NULL) //kick watchdog, every 5 second }