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

NRF52 Watchdog not resetting

Hi,

Currently I am trying to implement Watchdog functionality into my Project.

I have the followowing problem:

I use the Nordic WatchdogTimer.h and instance the class with 1s in the constructor.

now, if I just do a 'while(1);' the code succesfuly resets after about 1 Second.

But If I dont use a while loop, it does not reset, even if I dont use the WDT::Kick() function..?!

I think I altered some of the nrf52_bitfields.h parameters, but I dont remember which ones, so maybe thats the cause, but what could it be?

Its really strange that it resets on a while loop, but not without it and without WDT::Kick()

Thanks,

jonas

Parents
  • have you attempted to run a diff between your modified bitfield.h and the standard one? Not sure if this has anything to do with you issue but it is a start. Or may try using the watch dog driver assuming you are using sdk15.2 or above.

  • I didnt find an unmodified version of the bitfield.h, the only one I found had completly different defines in it..

    I am using SDK14 I think, so I guess thats not an option.. however, what does it do differently from the old WDT library?

  • well.. I discovered something strange... when I set CONFIG to 0x00000009 it will work. If I try to set it to 0x00 it wont work?! also, I noticed that for the CONFIG=... it will take a power cycle for the change to get applied, is that intentionally?

  • Hi,

    What do you mean by saying that it won't work when CONFIG is set to 0? In that case the WDT will pause when in sleep or haltet by a debugger, so if your current test code does that, then you should not expect to see a reset.

    Regarding changes to the CONFIG register, that must always be done before the WDT is started by writing to TASKS_START. Once it is started it cannot be reconfigured, and the only way to stop it (so that it can be reconfigured again) is with a reset. This is intentional behavior, as it prevents a malfunction system to accidentally reconfigure the SoftDevice, potentially preventing a WDT reset.

    The WDT chapter in the PS specifies it like this:

    The watchdog must be configured before it is started. After it is started, the watchdog’s configuration registers, which comprise registers CRV, RREN, and CONFIG, will be blocked for further configuration.

  • the chip does not sleep, nor am i debugging it(or does connecting over Segger RTT count as debugging?), but it simply wont reset if I set the config register to 0x00. I do start the chip after configuring it.

    regarding the power cycle, does that mean I can reconfigure the WDT every program start or every power cycle?

  • jonas.woerner said:
    the chip does not sleep, nor am i debugging it(or does connecting over Segger RTT count as debugging?), but it simply wont reset if I set the config register to 0x00. I do start the chip after configuring it.

     That's odd. So you let CONFGIG be 0x00 (which is equivalent with not writing to it), and starts the watchdog, but do not feed it, and then it does not reset? Did you also remember to set the CRV register to something sensible (the default value is all 1's, so it will take a long time to timeout)?

    jonas.woerner said:
    regarding the power cycle, does that mean I can reconfigure the WDT every program start or every power cycle?

     A power on reset will reset the watchdog, but soft reset would not. You can see mor details under Reset behavior.

  • yep, its very odd. Also If I set the CONFIG to 0x00000009 I am not able to prevent the reset, even though I set the reload value to the RR0 register.

    I will try a different chip soon, maybe its defective.

Reply Children
No Data
Related