Hi, We have an application created with SDK17 and softdevice s140. We are using the watchdog timer with a timeout of 10 minutes:
void init_watchdog(void) { #if defined(WATCHDOG) && (WATCHDOG) // Initialize the watchdog nrfx_wdt_config_t config = NRFX_WDT_DEAFULT_CONFIG; /* default, set in app.config: NRFX_WDT_ENABLED 1 NRFX_WDT_CONFIG_BEHAVIOUR 1 // 1 = Run in SLEEP, Pause in HALT, 8 = Pause in SLEEP, Run in HALT, 9 = Run in SLEEP and HALT, 0 = Pause in SLEEP and HALT NRFX_WDT_CONFIG_RELOAD_VALUE 2000 // in msec NRFX_WDT_CONFIG_NO_IRQ 0 // 0 = Include WDT IRQ handling, 1 = Remove WDT IRQ handling NRFX_WDT_CONFIG_IRQ_PRIORITY 6 */ config.reload_value = 10UL * 60000UL; // 10 minutes before it fires to enable DFU handling (MS2US(10) APP_ERROR_CHECK( nrfx_wdt_init(&config, wdt_event_handler) ); APP_ERROR_CHECK( nrfx_wdt_channel_alloc(&_watchdog_channel_id) ); nrfx_wdt_enable(); watchdog_mask = WDOG_IS_RUNNING; #endif }
This works fine, but as soon as we enter DFU mode, the system is reset after about 2 seconds, while the DFU mode is still running.
Disabling the watchdog in the main application will 'solve' this issue, so as far as I can see, the reset while in DFU mode is caused by the watchdog timer.
In the bootloader I see code like nrf_bootloader_wdt_feed():
void nrf_bootloader_wdt_feed(void) { if (nrf_wdt_started()) { wdt_feed(); } }
Is there any reason why the timeout of 10 minutes is ignored and switched to a lower value (default 2 seconds?)
Do I need to set anything in the bootloader to keep the watchdog timer triggered?