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

WDT & Bootloader

My application uses the WDT. In my application, I use a soft reset to enter the bootloader. Because the soft reset does not reset the WDT the program will reset while in the bootloader because of a watchdog timeout.

What is the best way to handle this issue? I see too options. Instead of performing a soft reset to enter the bootloader I could let the WDT in my application expire in order to perform a reset using a WATCHDOG reset. Alternatively I could add the watchdog service into the bootloader. I don't like that the watchdog is running during the initialization routines at the beginning of my application.Why does the softreset not reset the watchdog? Seems a bit odd.

Parents
  • Hi Lucas,

    I think the philosophy behind is that WDT should work in the way that when it started it can not be turned off. So the WDT can only be reset by itself or by a complete system reset (brown out, pin reset, systemOFF). When entering system OFF, the WDT register is retained but WDT is stopped.

    In this case, softreset is lower level that a Watchdog reset and it shouldn't reset the WDT.

    You are correct about the 2 solutions. I would personally choose to trigger system reset using WDT to start bootloader. In case you don't plan to do a reset when switching between application and Bootloader then you would need to handle the WDT in the bootloader.

  • @Shiva: As shown in the table at section 12.1.19 nRF51 Reference Manual, Watchdog reset will reset the retained register GPREGRET. That's why the bootloader didn't enter bootloader mode after WDT reset.

Reply Children
No Data
Related