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

add wdt in ble_app_uart

I want to add wdt function in ble_app_uart. Please tell me where should I feed the wdt.

in below main loop? for (;;) { power_manage(); nrf_drv_wdt_channel_feed(m_channel_id); }

  • It depends a bit on what you want to achieve, you can put it there if you want to reset the chip if it runs in interrupt context for too long (I'm not sure what you have configured the reload value to), but you make yourself dependent on power_manage()/sd_app_evt_wait to return and feed the dog often enough to not reset. If not, you will just reset every x seconds for no reason, which doesn't make much sense. That said, I think the normal approach is to feed the dog by using a timer (RTC). There are some questions on the forum about this already.

    Maybe you can explain a bit more about what you want to achieve by adding this WDT?

  • I tried doing

    for (;;) { power_manage(); nrf_drv_wdt_channel_feed(m_channel_id); }

    but it didnt work, so I use a separate timer to feed the WDT

Related