Tool/software: TI-RTOS
Hi all,
I'm trying to add a watchdog to my application, but I'm running into issues when the device goes to sleep. I'm using Event_pend as a semaphore, and basically the watchdog works well as long as events occur within the watchdog reload period. If There is no event to wake up the device, then the watchdog will trigger.
The documentation (DriverLib) clearly specifies that the watchdog should stop counting when the device goes into sleep/ standby mode
Power Management Once started, the Watchdog will keep running in Active or Idle mode. When the device enters Standby mode, the Watchdog timer will stop counting down but the counter value will be preserved. When the device wakes up from Standby, the Watchdog timer will continue to count down from the previous counter value. This means that if a system goes into Standby 50% of the time and the Watchdog reload value is set to 1 second, the Watchdog timer will actually time out in 2 seconds. A system which is only in Active/Idle mode for 1% of the time, the Watchdog timer will time out in 100 seconds. However, if a bug locks up the application in Active mode, the Watchdog timer will time out in the configured time.
Here is my main loop:
for (;;) { /******** SEMAPHORE WAIT **************************************************************************************************/ // Waits for an event to be posted associated with the calling thread. // Note that an event associated with a thread is posted when a message is queued to the message receive queue of the thread uint32_t events = Event_pend(m_syncEvent, Event_Id_NONE, PAMSYS_ALL_EVENTS, ICALL_TIMEOUT_FOREVER); /******** WATCHDOG*********************************************************************************************************/ CMSIS_RTOS_clearWatchdog(); if (events > 0) { ..... } }
Thanks for your help,
Best
Val