NRF52 deep sleep, timer trigger

I want to create a ble application which shall work as a beacon, it will advertise its presence for some time, and then it must enter deep sleep. The device shall remain in the deep sleep for some time and after 5 seconds awake from sleep and perfom ble operations.

We are unable to find any reference for deep sleep with timer awake. We were able to find gpio awake and nfc awake but not timer awake.

Please let us know about any reference for the same.

Parents
  • Hi,

    As you want to wake up based on elapsed time, the nRF will stay in system ON low power mode with the RTC running, so it will be in the same "normal" sleep mode between advertising events and when you stop advertising for some time. So the only thing you need to do here is essentially to use some form of timer to stop and start advertising at the right intervals.

    Which SDK are you using? If you are using the nRF5 SDK, I would use the app timer for that. If you are using the nRF Connect SDK, you want to use the kernel timers in some way. Either with a thread using k_sleep, or for instance with delayable work in the system work queue. 

    And for stopping advertising, use bt_le_adv_stop() and then re-start it again using bt_le_adv_start() if using nRF Connect SDK. If the nRF5 SDK you stop advertising using sd_ble_gap_adv_stop() and start is using either sd_ble_gap_adv_start() or ble_advertising_start() (depending on if you use the SDK advertising module or not).

Reply
  • Hi,

    As you want to wake up based on elapsed time, the nRF will stay in system ON low power mode with the RTC running, so it will be in the same "normal" sleep mode between advertising events and when you stop advertising for some time. So the only thing you need to do here is essentially to use some form of timer to stop and start advertising at the right intervals.

    Which SDK are you using? If you are using the nRF5 SDK, I would use the app timer for that. If you are using the nRF Connect SDK, you want to use the kernel timers in some way. Either with a thread using k_sleep, or for instance with delayable work in the system work queue. 

    And for stopping advertising, use bt_le_adv_stop() and then re-start it again using bt_le_adv_start() if using nRF Connect SDK. If the nRF5 SDK you stop advertising using sd_ble_gap_adv_stop() and start is using either sd_ble_gap_adv_start() or ble_advertising_start() (depending on if you use the SDK advertising module or not).

Children
Related