Tool/software:
Hi,
We are using a custom board with CC2652R7. Our application uses Bluetooth, OAD and TI-RTOS, base on the ble5stack simple_peripheral_oad_on_chip tirtos7 example.
We are noticing strange behaviour with the watchdog;
Main issue is that it is not resetting our device. We are expecting code execute to begin from main.c, but it seems to just hang and never come back alive again.
Secondary issue is that we are only getting the watchdog to trigger an attempted reset at all when a debugger is plugged in. Without debugger, our board is continuing happily well past the watchdog timeout, even without any watchdog_clear calls.
Some more detail:
Our application remains awake for x seconds before going into sleep state. While it is awake we are kicking the WD with a watchdog_clear(). We are able to make the WD trigger here by removing the kicks. But it does not reset the device as we expect, it is just hanging (debugger shows 'no symbols are defined' when we reconnect, just like this post).
Watchdog params:// initialise the watchdog
Watchdog_init();
Watchdog_Params_init(&m_hal_stateWatchdogParams);
m_hal_stateWatchdogParams.resetMode = Watchdog_RESET_ON;
m_hal_stateWatchdogParams.callbackFxn = (Watchdog_Callback)hal_stateWatchdogCallback;
m_hal_stateWatchdogParams.debugStallMode = Watchdog_DEBUG_STALL_ON;
Second issue more detail:
We have a watchdog callback function. Inside this function we are incrementing an 8-bit counter. We then compare to see if the counter is > 20. If it is NOT >20 then we clear the watchdog and wait for the next callback. If it is >20 then we want the watchdog reset to be triggered so we do nothing and the watchdog should handle the rest for us.
The issue we see here is this; when stepping through with debugger the counter is reaching 20 and then the next callback the board loses connection (great, watchdog has worked). BUT: if we resume and let is run with no breakpoints, then we can occasionally jump in and see the value of the counter. It is reaching 20 and then getting reset back to 0 before counting up again! It is like the watchdog reset is re-initialising the counter variable but not actually causing a reset.
Do you have any ideas that might help us to progress, or knowledge that we have not picked up on?
Thank you,
Liam