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

How to feed/refresh Watchdog during BLE activities

Hello,

 

I am using nRF52832 DK PCA10040 v1.2.4, SDK_15.3.0, S132 SoftDevice and Segger for flashing the image. I am using ‘ble_app_blinky’.

 

I have gone through below link.

https://devzone.nordicsemi.com/f/nordic-q-a/33134/watchdog-and-sd_app_evt_wait

 

1) It says to use timer. But my worry is assume because of some while loop, flow got hanged. But still timer interrupts will occur and refresh the Watchdog. So in this case never Watchdog reset happen even though chip got struck. I tested this scenario by keeping while(1) and nrf_drv_wdt_channel_feed() in timer handler. In this case there is no Watchdog reset.

 

2) There is one more suggestion of using “radio events”. But in ble_evt_handler() I will be getting only when Advertisement timeout, Connected or Disconnected. What are these “radio events”.

 

3) In BLE connection mode, SoftDevice will be executing. In that case will not sd_app_evt_wait() return anything. Even I kept breakpoint after sd_app_evt_wait() and never it hit. Please let e know more details on this scenario. In that case whether control will not come to idle_state_handle() and never application will get control during BLE Advertisement and Connection mode (If there are no RTC handlers).

 

4) If I set WDT_CONFIG_BEHAVIOUR to 0, then watchdog will be paused during sleep. In this mode I tested by keeping my device in Connection mode. It go reset after 3 hours. Do does mean, whenever BLE is active (Even in milli sec) only during that time Watchdog is running (Because of above point as control will not come to Application).

 

Thanks & Regards

Vishnu Beema

Parents
    1. Use RTC to trigger an interrupt, and in that interrupt, you set a global flag. Then check for that flag in your main loop, if it's set then feed the watchdog. This way you will be feeding the watchdog from mains context at regular intervals, even if you're in at sleep in SystemON. 

    2. These are events that are triggered at a set time before the RADIO will be used. They are used to notify the application that there will be RADIO activity in x amount of time. See sd_radio_notification_cfg_set

    3. When you call sd_app_evt_wait() the system will enter SystemON mode, but, it will only return if the wake-up source is anything other than a wake-up source that is needed for the BLE stack. 

    4. That is the expected behavior, the WTD will count down when the CPU is active. See Temporarily pausing the watchdog.
Reply
    1. Use RTC to trigger an interrupt, and in that interrupt, you set a global flag. Then check for that flag in your main loop, if it's set then feed the watchdog. This way you will be feeding the watchdog from mains context at regular intervals, even if you're in at sleep in SystemON. 

    2. These are events that are triggered at a set time before the RADIO will be used. They are used to notify the application that there will be RADIO activity in x amount of time. See sd_radio_notification_cfg_set

    3. When you call sd_app_evt_wait() the system will enter SystemON mode, but, it will only return if the wake-up source is anything other than a wake-up source that is needed for the BLE stack. 

    4. That is the expected behavior, the WTD will count down when the CPU is active. See Temporarily pausing the watchdog.
Children
Related