Our product is experiencing an issue where a watchdog reset occurs after DFU, even though we are feeding the watchdog in the application.
However, this issue does not occur during a normal boot or normal reset, so it is not a major operational problem, but we would like to understand the cause, which is why we are reaching out.
Below are the relevant parts of our product's watchdog configuration. We confirmed that commenting out section 2 prevents the watchdog reset after DFU.
1.Watchdog settings in the bootloader on every boot
#define BOOTLOADER_WATCHDOG_TIMEOUT (20 * 32768) // 20-second static void init_watchdog() { NRF_WDT->CONFIG = (WDT_CONFIG_SLEEP_Run << WDT_CONFIG_SLEEP_Pos); NRF_WDT->CRV = BOOTLOADER_WATCHDOG_TIMEOUT; NRF_WDT-> RR [0] = 0x6E524635UL; NRF_WDT->RREN = WDT_RREN_RR0_Enabled << WDT_RREN_RR0_Pos; NRF_WDT->TASKS_START = 1; }
2.Watchdog feed settings during DFU operation in the bootloader
void nrf_bootloader_wdt_init(void) { static bool initialized = false; if (initialized) { return; } if (nrf_wdt_started()) { uint32_t wdt_ticks = nrf_wdt_reload_value_get(); NRF_LOG_INFO("WDT enabled CRV:%d ticks", wdt_ticks); //wdt_ticks must be reduced to feed the watchdog before the timeout. uint32_t reduced_timeout_ticks = MAX((int32_t)wdt_ticks - MAX_FLASH_OP_TIME_TICKS, NRF_BOOTLOADER_MIN_TIMEOUT_TICKS); /* initial watchdog feed */ wdt_feed(); NRF_LOG_INFO("Starting a timer (%d ticks) for feeding watchdog.", reduced_timeout_ticks); nrf_bootloader_wdt_feed_timer_start(reduced_timeout_ticks, wdt_feed_timer_handler); NVIC_EnableIRQ(WDT_IRQn); } else { NRF_LOG_INFO("WDT is not enabled"); } initialized = true; }
3.Watchdog settings during application operation on every boot
//Configure WDT. nrf_drv_wdt_config_t config = NRF_DRV_WDT_DEAFULT_CONFIG; NRF_LOG_INFO("WatchdogInit reload_value: %d",config.reload_value); err_code = nrf_drv_wdt_init(&config, Cradle_wdt_event_handler); APP_ERROR_CHECK(err_code); err_code = nrf_drv_wdt_channel_alloc(&m_cradle_channel_id); APP_ERROR_CHECK(err_code);
every 1sec Kick
nrf_drv_wdt_feed();
The ideal solution for us is to modify only the application to prevent the watchdog reset after DFU.
Any assistance you can provide would be greatly appreciated.