This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Watchdog while in sd_app_evt_wait

Hi

I've discovered last week some unexpected resets by the watchdog. I guess I've the explanation and the workaround for the behavior, but it would be great to have this assumption confirmed. Maybe some other peoples have similar behaviors.

The firmware is built on SDK11 and is based on a simple peripheral project. We have a watchdog configured with a time of five seconds and not running in sleep mode. We establish a connection from a smart device and than do no real data transfer. The call of sd_app_evt_wait by the application never returns, because the application has nothing to do (no interrupt causing the wakeup). After around 80 seconds the system resets caused by the watchdog.

My assumption is, that the softdevice internally wakes up for handling the BLE connection intervals. These ISR's are quite short, but the Watchdog counts up a bit at any wakeup. The application won't reset the watchdog because the call of sd_app_evt_wait never returns.

The solution I have is to configure at least a timer that forces the function sd_app_evt_wait to leave from time to time.

Can someone confirm this behavior? What is the best way to work around it?

Regards Adrian

Parents
  • Actually I'm using: __WFE(); __SEV(); __WFE(); in my code. And the WD is fed every 50ms using a timer when my system is on.

    In sleep mode, I turn off all the modules including the timer. Because I thought the WD will be paused in sleep mode when I config:

    NRF_WDT->CONFIG = (WDT_CONFIG_HALT_Pause << WDT_CONFIG_HALT_Pos) | (WDT_CONFIG_SLEEP_Pause << WDT_CONFIG_SLEEP_Pos);

    Is it true that the WD will pause until the system is woken up from Sleep mode? In my application, sometimes the system needs to sleep for a very long time (some days or even some weeks).

Reply
  • Actually I'm using: __WFE(); __SEV(); __WFE(); in my code. And the WD is fed every 50ms using a timer when my system is on.

    In sleep mode, I turn off all the modules including the timer. Because I thought the WD will be paused in sleep mode when I config:

    NRF_WDT->CONFIG = (WDT_CONFIG_HALT_Pause << WDT_CONFIG_HALT_Pos) | (WDT_CONFIG_SLEEP_Pause << WDT_CONFIG_SLEEP_Pos);

    Is it true that the WD will pause until the system is woken up from Sleep mode? In my application, sometimes the system needs to sleep for a very long time (some days or even some weeks).

Children
No Data
Related