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

WDT triggers DFU exit

Hi,

I have an application that requires watchdog to run continuously. And from application I have code that jumps to the bootloader without device resetting using bootloader_util_app_start() API(example ble_app_hrs). This causes watchdog to trigger even though I have disabled all interrupts hence making dfu exit. Is there a way to disable watchdog. If not could you please suggest the best way to achieve a smooth jump to bootloader?

Thanks in Advance

Parents
  • Hi,

    You should check out section 38 of the reference manual for more details. The watchdog timer will remain running through a soft reset, so even if you used a soft reset to get to your bootloader you would have the same issue. I ended up adding a watchdog service to the bootloader to prevent it from interfering with bootloading operations.

    JD

  • Hi. Sure, I just changed the wait_for_events forever loop to look like:

        static void wait_for_events(void)
    {
        for (;;)
        {
    		NRF_WDT->RR[0] = WDT_RR_RR_Reload;					// Pat the watchdog
    		
            // Wait in low power state for any events.
            uint32_t err_code = sd_app_evt_wait();
            APP_ERROR_CHECK(err_code);
    
            // Event received. Process it from the scheduler.
            app_sched_execute();
    
            if ((m_update_status == BOOTLOADER_COMPLETE) || 
                (m_update_status == BOOTLOADER_TIMEOUT)  ||
                (m_update_status == BOOTLOADER_RESET))
            {
    			NRF_WDT->RR[0] = WDT_RR_RR_Reload;
                // When update has completed or a timeout/reset occured we will return.
                return;
            }
        }
    }
    
Reply
  • Hi. Sure, I just changed the wait_for_events forever loop to look like:

        static void wait_for_events(void)
    {
        for (;;)
        {
    		NRF_WDT->RR[0] = WDT_RR_RR_Reload;					// Pat the watchdog
    		
            // Wait in low power state for any events.
            uint32_t err_code = sd_app_evt_wait();
            APP_ERROR_CHECK(err_code);
    
            // Event received. Process it from the scheduler.
            app_sched_execute();
    
            if ((m_update_status == BOOTLOADER_COMPLETE) || 
                (m_update_status == BOOTLOADER_TIMEOUT)  ||
                (m_update_status == BOOTLOADER_RESET))
            {
    			NRF_WDT->RR[0] = WDT_RR_RR_Reload;
                // When update has completed or a timeout/reset occured we will return.
                return;
            }
        }
    }
    
Children
No Data
Related