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

About WDT behaviour during sleep.

Hello.

When going to sleep with the BLE connection established, the WDT counter will be added. (WDT behaviour: NRF_WDT_BEHAVIOUR_PAUSE_SLEEP_HALT)
At this time, my app cannot detect wakeup.

Who adds the WDT counter?
How do I refresh the WDT counter?

Thank you.

Parents
  • Hi, 

    Who adds the WDT counter?

    The WDT counter counts 32.768 kHz clock cycles. If you have configured the WDT to pause while sleeping and halted the WDT will only count clock cycles while the CPU is active. Note that the CPU will be active from time to time even if the application code doe snot run, for instance for SoftDevice interrupts that may not require application involvement. Perhaps that is what confuses you?

    How do I refresh the WDT counter?

    What do you mean exactly? Once started, there is no way to change the WDT configuration at all. The only way to re-configure then is after a reset (except soft reset, which does not reset the WDT).

    Note that it is typically not a good idea to pause the WDT while CPU is sleeping. In case there is an issue that prevents the CPU from waking up the WDT would not be able to do it's work and reset the device to recover in this case.

Reply
  • Hi, 

    Who adds the WDT counter?

    The WDT counter counts 32.768 kHz clock cycles. If you have configured the WDT to pause while sleeping and halted the WDT will only count clock cycles while the CPU is active. Note that the CPU will be active from time to time even if the application code doe snot run, for instance for SoftDevice interrupts that may not require application involvement. Perhaps that is what confuses you?

    How do I refresh the WDT counter?

    What do you mean exactly? Once started, there is no way to change the WDT configuration at all. The only way to re-configure then is after a reset (except soft reset, which does not reset the WDT).

    Note that it is typically not a good idea to pause the WDT while CPU is sleeping. In case there is an issue that prevents the CPU from waking up the WDT would not be able to do it's work and reset the device to recover in this case.

Children
Related