Part Number: LP-CC2652RB
Other Parts Discussed in Thread: SYSCONFIG, Z-STACK
I'm trying to enable watchdog functionality for a Zigbee project (ZED as temperature sensor) and have noticed that there seem to never be any system reboots. I've enabled watchdog from the syscfg file, configured the watchdog as described in the documentation (and the same way i've seen done in the watchdog example from Resource Explorer). Here's the way it is configured:
Board_initGeneral();
Watchdog_init();
Watchdog_Params_init(&wdgParams);
wdgParams.callbackFxn = wdgCallback;
wdgParams.resetMode = Watchdog_RESET_OFF; // tried Watchdog_RESET_ON as well, nothing different happens
wdgParams.debugStallMode = Watchdog_DEBUG_STALL_ON;
wdgHandle = Watchdog_open(CONFIG_WATCHDOG_0, &wdgParams);
if (!wdgHandle)
{
while (1)
;
}
uint32_t tickValue = Watchdog_convertMsToTicks(wdgHandle, 10000);
Watchdog_setReload(wdgHandle, tickValue);
Watchdog callback to be used with Watchdog_RESET_OFF:
Void wdgCallback(UArg handle){
while(1)
{
}
}
Now, i never reset the watchdog, thus i am expecting my app to crash every 10 seconds then repower. But that never happens.
When using Watchdog_RESET_OFF with the debugger functional, i can see that the debugger is forever stuck inside the callback, so the watchdog triggered correctly after the time configured. It never leaves and never transmits anything to the coordinator.
When using Watchdog_RESET_ON with the debugger, i can see that something happens as the debugger crashes and an unable to talk with the board. However, when looking at Home Assistant, i can see that the board sends the packets to the stack as per the configured reporting settings.
Are there some special settings that need to be done in the case of zigbee applications for the watchdog to work? My watchdog configuration seems identical to that offered in the examples; i don't see why would it not work.
Trying to use the watchdog came as a solution for the problem in which, after a device is removed from a coordinator, it seems to crash and require a hardware restart for it to be able to be repaired again. I figured that if i were to use a watchdog, the device would restart itself after some time and be ready to be repaired. Is there a more elegant solution for this issue?