Watchdog in BLE NUS example sdk 2.4.0

Hello everyone,

I am developing a ble project that builds on the peripheral Uart example using the sdk 2.4.0 for nrf5340.

I want to implement a watchdog since I sometimes run into corners where the code does not otherwise recover itself. I found the watchdog driver example and have successfully set up the watchdog in the peripheral Uart example, however, I do not understand where in the code I should feed the watchdog using wdt_feed(wdt, wdt_channel_id); since the main seems to run only once to set up the ble advertising. 
So, where should I feed the watchdog in case there is a) a connection and b) no connection?

Thanks in advance!

Paul

Parents Reply Children
  • Hello Kenneth,

    We had the problem, which is however very hard to replicate, that when we get a disconnect event it does not return to advertising. I dont know if we return into the main loop and just lack the advertising, or the code in genereall gets blocked. So I wanted to make sure that advertising will always resume. I did not find however where I could put the wtd feed function to ensure that. My idea was to do that in the same code part where the advertisement is handled, I could not find where that happens however, or if that is eaven recommended to do.

    So basically what I am afraid of is that the main thread keeps working without problem, which would keep feeding the wtd, but the bluetooth thread might have a problem.

    Thanks for your help!

Related