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

RESETREAS issue after WD Reset

Hi, I am using nRF5_SDK_15.0.0_a53641a.

I'm using code below to start WD and I'm not feeding WD.

NRF_WDT->CONFIG = (WDT_CONFIG_HALT_Pause << WDT_CONFIG_HALT_Pos) | ( WDT_CONFIG_SLEEP_Run << WDT_CONFIG_SLEEP_Pos);
NRF_WDT->CRV = 10*32768;             // 10sec timout
NRF_WDT->RREN |= WDT_RREN_RR0_Msk;  // Enable reload register 0
NRF_WDT->TASKS_START = 1;           // Start the Watchdog timer

After WD reset, I'm looking at RESETREAS register and DOG bit is not high, only PINRESET is high. 

What am I missing?

I found that in in system_nrf52840.c there is errata136 that resets all bits but PINRESET, when I remove that code it works fine. Why does this errata exist and if I need it?

  • So NVIC System Reset which does a reset over AICR is a soft reset and does not reset the WDT.
    In this case can one reinitialise the WDT or will it just run on; possibly expire and reset the system.

    So when we do a DFU, from our application code; which transfers control to the bootrom for the DFU this must be a forced watchdog reset; otherwise we would be seeing WD timeouts ewhen doing DFU which is not the case.

    This may explain some of the unexpected restarts we have been seeing occasionally.

  • OwainIncus said:
    In this case can one reinitialise the WDT or will it just run on; possibly expire and reset the system.

     The WDT will still be running. See this post

    If the WDT is enabled by the application, then it must be feed by the bootloader during the DFU process to avoid the device to reset prematurely. Watchdog support to the bootloader code was added in SDK 15.0 (with a bug-fix for this in SDK 15.2). So for SDK 15, if the application had enabled watchdog before resetting to the bootloader, it is automatically fed in the bootloader. If you are using an older SDK version, take a look at e.g. this post.

Related