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

Nrf52810 Watchdog timer resets every 2 seconds

Hello,

      I have enabled WDT for nrf52810,S112 with following configuration.

static void System_task_initWatchdog(void)
{

  NRF_WDT->CONFIG = (WDT_CONFIG_HALT_Pause << WDT_CONFIG_HALT_Pos) | ( WDT_CONFIG_SLEEP_Run << WDT_CONFIG_SLEEP_Pos);
  NRF_WDT->CRV = 2*32768; // 150 sec. timout
  NRF_WDT->RREN |= WDT_RREN_RR1_Msk; //Enable reload register 1
  NRF_WDT->TASKS_START = 1;

}

I am reloading the RR[1] using   

NRF_WDT->RR[1] = WDT_RR_RR_Reload; //Reload watchdog register 1.

But the watchdog timer register does not reload and finally triggers WDT reset after 2 seconds (On verifying in  debugger I found that after the RR[1] is not updated even after the following code "NRF_WDT->RR[1] = WDT_RR_RR_Reload;"  is executed).

0x6E524635UL is the value of WDT_RR_RR_Reload.

Parents
  • Hi,

    The reason for the reset is that RR0 is enabled by default, as you can see from the reset value of RREN register. So if you only want one channel, you can configure the WDT like this instead:

    static void System_task_initWatchdog(void)
    {
        NRF_WDT->CONFIG = (WDT_CONFIG_HALT_Pause << WDT_CONFIG_HALT_Pos) | ( WDT_CONFIG_SLEEP_Run << WDT_CONFIG_SLEEP_Pos);
        NRF_WDT->CRV = 2*32768; // 2 sec. timout
        NRF_WDT->TASKS_START = 1;
    }

    And then feed the watchdog like this:

    NRF_WDT->RR[0] = WDT_RR_RR_Reload; //Reload watchdog register 0.

Reply
  • Hi,

    The reason for the reset is that RR0 is enabled by default, as you can see from the reset value of RREN register. So if you only want one channel, you can configure the WDT like this instead:

    static void System_task_initWatchdog(void)
    {
        NRF_WDT->CONFIG = (WDT_CONFIG_HALT_Pause << WDT_CONFIG_HALT_Pos) | ( WDT_CONFIG_SLEEP_Run << WDT_CONFIG_SLEEP_Pos);
        NRF_WDT->CRV = 2*32768; // 2 sec. timout
        NRF_WDT->TASKS_START = 1;
    }

    And then feed the watchdog like this:

    NRF_WDT->RR[0] = WDT_RR_RR_Reload; //Reload watchdog register 0.

Children
Related