Hi,
I´m using a watchdog in my Application. Furthermore I need the ability to use the ota/dfu functionality. I trigger the bootloader with a simple beacon.
if((memcmp(addr.addr, &adv_data.p_data[9], 6)) == 0)
sd_power_gpregret_clr(0xff);
sd_power_gpregret_set(1);
err_code = sd_power_gpregret_get(&gprepret_value);
sd_nvic_SystemReset();
This is my init for the watchdog:
// Configure WDT.
nrf_drv_wdt_config_t config = NRF_DRV_WDT_DEAFULT_CONFIG;
nrf_drv_wdt_init(&config, 0);
nrf_drv_wdt_channel_alloc(&m_channel_id);
nrf_drv_wdt_enable();
this is the feed:
nrf_drv_wdt_channel_feed(m_channel_id);
Probably you know which issue I´m facing. I can´t feed the watchdog while my device is in the bootloader. I was able to debug, so I can say the Watchdog is running while am device is in the bootloader.
I tried to feed the wdt in wait_for_events:
static void wait_for_events(void)
{
for (;;)
{
nrf_drv_wdt_feed();
// 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();
nrf_drv_wdt_feed();
if ((m_update_status == BOOTLOADER_COMPLETE) ||
(m_update_status == BOOTLOADER_TIMEOUT) ||
(m_update_status == BOOTLOADER_RESET))
{
// When update has completed or a timeout/reset occured we will return.
return;
}
}
}
Perhaps someone has a solution for me. I read this post, but it doesn´t helped me.