Hi,
I'm running into issues with the watchdog never firing. I'm using SDK v15.3.0, with S132 v6.1.1, and a custom bootloader (based off secure_bootloader example).
The watchdog initialization is successful.. When using a debugger, the WDT registers display the correct WDT configuration and WDTSTATUS is 1 (watchdog is running). However, the watchdog never times out, even if I'm not feeding the watchdog.
Additionally:
1. Watchdog doesn't reset in debug or non-debug mode.
2. LFCLOCK is initialized and running.
3. WDT setting is set to pause in SLEEP and HALT.
4. There is a bug in the bootloader - if it's loaded by itself with no app, the bootloader will just hang (won't advertise, won't run app_timer).
Here is the wdt initialization code:
ret_code_t error_code; // Configure watchdog timer. // Note, SDK has a typo for the default config define. nrfx_wdt_config_t config = NRFX_WDT_DEAFULT_CONFIG; error_code = nrfx_wdt_init(&config, wdt_event_handler); APP_ERROR_CHECK(error_code); // Allocate watchdog timer channel. error_code = nrfx_wdt_channel_alloc(&s_channel_id); APP_ERROR_CHECK(error_code); // Enable watchdog timer. nrfx_wdt_enable(); NRF_LOG_INFO("Watchdog enabled");
Here is the wdt configuration setting (for both bootloader and application):
// <e> NRFX_WDT_ENABLED - nrfx_wdt - WDT peripheral driver //========================================================== #ifndef NRFX_WDT_ENABLED #define NRFX_WDT_ENABLED 1 #endif // <o> NRFX_WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode // <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 #ifndef NRFX_WDT_CONFIG_BEHAVIOUR #define NRFX_WDT_CONFIG_BEHAVIOUR 0 #endif // <o> NRFX_WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> #ifndef NRFX_WDT_CONFIG_RELOAD_VALUE #define NRFX_WDT_CONFIG_RELOAD_VALUE 2000 #endif // <o> NRFX_WDT_CONFIG_NO_IRQ - Remove WDT IRQ handling from WDT driver // <0=> Include WDT IRQ handling // <1=> Remove WDT IRQ handling #ifndef NRFX_WDT_CONFIG_NO_IRQ #define NRFX_WDT_CONFIG_NO_IRQ 0 #endif // <o> NRFX_WDT_CONFIG_IRQ_PRIORITY - Interrupt priority // <0=> 0 (highest) // <1=> 1 // <2=> 2 // <3=> 3 // <4=> 4 // <5=> 5 // <6=> 6 // <7=> 7 #ifndef NRFX_WDT_CONFIG_IRQ_PRIORITY #define NRFX_WDT_CONFIG_IRQ_PRIORITY 6 #endif // <e> WDT_ENABLED - nrf_drv_wdt - WDT peripheral driver - legacy layer //========================================================== #ifndef WDT_ENABLED #define WDT_ENABLED 1 #endif // <o> WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode // <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 #ifndef WDT_CONFIG_BEHAVIOUR #define WDT_CONFIG_BEHAVIOUR 0 #endif // <o> WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> #ifndef WDT_CONFIG_RELOAD_VALUE #define WDT_CONFIG_RELOAD_VALUE 2000 #endif // <o> WDT_CONFIG_IRQ_PRIORITY - Interrupt priority // <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice // <0=> 0 (highest) // <1=> 1 // <2=> 2 // <3=> 3 // <4=> 4 // <5=> 5 // <6=> 6 // <7=> 7 #ifndef WDT_CONFIG_IRQ_PRIORITY #define WDT_CONFIG_IRQ_PRIORITY 6 #endif
Is there somewhere else that's potentially feeding the watchdog (ie in the SD)? Any help would be useful, thanks!