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

Dfu not sucess when app init and enable wdt,although I feeddog and disable the wdt

Dear Nordic

my SOFT DFU fail when I init the WDT, but I have feeddog and disable the WDT, like below:

static bool app_shutdown_handler(nrf_pwr_mgmt_evt_t event)
{
switch (event)
{
case NRF_PWR_MGMT_EVT_PREPARE_DFU:
NRF_LOG_INFO("Power management wants to reset to DFU mode.");
// YOUR_JOB: Get ready to reset into DFU mode
//
// If you aren't finished with any ongoing tasks, return "false" to
// signal to the system that reset is impossible at this stage.
//
// Here is an example using a variable to delay resetting the device.
//
// if (!m_ready_for_reset)
// {
// return false;
// }
// else
//{
//
// // Device ready to enter
// uint32_t err_code;
// err_code = sd_softdevice_disable();
// APP_ERROR_CHECK(err_code);
// err_code = app_timer_stop_all();
// APP_ERROR_CHECK(err_code);
//}
break;

default:
// YOUR_JOB: Implement any of the other events available from the power management module:
// -NRF_PWR_MGMT_EVT_PREPARE_SYSOFF
// -NRF_PWR_MGMT_EVT_PREPARE_WAKEUP
// -NRF_PWR_MGMT_EVT_PREPARE_RESET
return true;
}

NRF_LOG_INFO("Power management allowed to reset to DFU mode.");
nrf_drv_wdt_feed();
nrf_wdt_int_disable(NRF_WDT_INT_TIMEOUT_MASK);
//nrf_wdt_int_enable(NRF_WDT_INT_TIMEOUT_MASK);
return true;
}

I don't know why nrf_wdt_int_disable is un-useful.

but if I don't init wdt in main, dfu is ok.

thanks for support.

Roger Huang

Parents
  • Hi,

    It's not possible to stop the WDT in SW after it has been started. nrf_wdt_int_disable() may be used to disable the TIMEOUT interrupt, but it will not stop the WDT. 

    Which SDK version are you currently using?  Bootloader from SDK 15.0.0 and later should reload the WD automatically. 

    Best regards,

    Vidar

  • Dear Vidar

    when I set WD reload value to 120000,about 2 minutes, I find app connecting all the time, till wdt time come, nrf52 reset.

    so I guess when start the ota, my apptimer stop, and PC do not work in main while, so WDT not feed.

    and ble connecting fail all the time. 

    so it just like 1, when open wdt, ble dfu service connect fail, but nus sucess

                          2, when open wdt, and start ota, app timer stoped

    thanks for your suggestion very much!

Reply
  • Dear Vidar

    when I set WD reload value to 120000,about 2 minutes, I find app connecting all the time, till wdt time come, nrf52 reset.

    so I guess when start the ota, my apptimer stop, and PC do not work in main while, so WDT not feed.

    and ble connecting fail all the time. 

    so it just like 1, when open wdt, ble dfu service connect fail, but nus sucess

                          2, when open wdt, and start ota, app timer stoped

    thanks for your suggestion very much!

Children
No Data
Related