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
  • I ran into this exact problem in my design. I ended up adding a WD service to the bootloader so that it wouldn't cause a bootloader failure when the WDT expired.

    According to section 12.1.8 of the nRF51_Series_Reference_manual v3.0, the WDT is a retained register so it will retain its settings through system off and certain resets.

  • I added a service of the WDT in the wait_for_events function. I also added one just prior to the soft reset that triggered the entry into the bootloader. As Hung states in his answer allowing the WDT reset to trigger your entry into the bootloader may be a simpler solution. The reason I went with servicing the WDT in the bootloader is that I could not tell exactly what the behavior of the status of the WDT was through a actual WDT event. So I was more comfortable just servicing it and also retaining WDT "protection" during bootloading.

Reply
  • I added a service of the WDT in the wait_for_events function. I also added one just prior to the soft reset that triggered the entry into the bootloader. As Hung states in his answer allowing the WDT reset to trigger your entry into the bootloader may be a simpler solution. The reason I went with servicing the WDT in the bootloader is that I could not tell exactly what the behavior of the status of the WDT was through a actual WDT event. So I was more comfortable just servicing it and also retaining WDT "protection" during bootloading.

Children
No Data
Related