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

Another NRF51822 Watchdog question.

Hello,

I have been attempting to get the watchdog timer working in my project without any success. I have read through all of the watch dog related threads that I could find in the forums. I made sure to pin reset and power cycle the board after quitting the debugger. I made sure that I am not configuring the WDT to run while halted etc.

I have a fairly simple function to configure and start the WDT, and I have commented out the line of code in my main loop that reloads the WDT but it never resets.

I am running the 5.2.0 version of the SDS on silicon revision QFAACA. I'll put my WDT configuration function below. Any thoughts on what I am doing wrong will be appreciated.

Regards, John DeWitt

void watchDogInit(void) { NRF_WDT->CONFIG = (WDT_CONFIG_SLEEP_Run << WDT_CONFIG_SLEEP_Pos) | (WDT_CONFIG_HALT_Pause << WDT_CONFIG_HALT_Pos);

NRF_WDT->CRV = 32768; 	 
NRF_WDT->RREN |= WDT_RREN_RR0_Msk;									

NRF_WDT->TASKS_START = 1; // Watchdog start

}

Parents Reply Children
  • The sample code is ported for the nRF51822 development kit. Are you using the nRF51822 development kit or the nRF51822 evalutaion kit. The evaluation kit has different mapping of leds and buttons so if you try to run it directly on the evaluation kit you will not see anything work. You will have to modify the pin mapping for the leds and buttons to work with the nRF51822 evalutation kit. I have tested this with S110 softdevice 5.2.1 and the nRF51822 SDK v4.4.1. Remember to read and follow the comments in the main file in the examples.

  • I am running on our custom PCB with the nRF51822. There are no LEDs or buttons connected to the radio. The code below works for me to have a 4 second watch dog timer:

    /**@brief Initialize the watch dog timer */ void watchDogInit(void) { NRF_WDT->CONFIG = (WDT_CONFIG_SLEEP_Run << WDT_CONFIG_SLEEP_Pos) | (WDT_CONFIG_HALT_Pause << WDT_CONFIG_HALT_Pos);

    NRF_WDT-&gt;CRV = 32768 * 4; 	 
    NRF_WDT-&gt;RREN |= WDT_RREN_RR0_Msk;									
    
    NRF_WDT-&gt;TASKS_START = 1; // Watchdog start
    

    }

  • @jldewitt: Thanks this works for me - I also had the issue with the WDT never generating a timeout event. I think I have the first chip revision, which might be the reason it didn't work with the standard examples.

Related