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

Implementing 'Wake on BLE' on nrf52832

I have an nrf52832 based device and a mobile app that I'm working on. I'd like to be able to turn the device on via the app, so wake on BLE seems the way to go.

I'm a neophyte so I've been digging into how to implement this (from the firmware side). From my reading it seems the way to go is to put the device into sleep mode, then wake occasionally to advertise and then stay awake if the app happens to be there and connects.

My question is, would this be the 'proper' way to go from a power consumption point of view? My understanding is that the BLE stack is implemented in software via softdevice so the device can't be in OFF mode and still have BLE events/commands being processed, so the the 'sleep/wake/advertise/sleep' cycle seems the only way to go.  But I've also seen things like 'wake from system OFF' when triggered by GPIO, LPCOMP, NFC. Is it possible to have the radio somehow trigger a wake from System OFF? I've also seen "Wake on any event" in the specification - I haven't been able to figure out exactly what this is. Is this an option?

Thanks for any advice or any links to other examples or useful information.

Parents
  • Hi Terry,

    Very interesting question.

      But I've also seen things like 'wake from system OFF' when triggered by GPIO, LPCOMP, NFC. Is it possible to have the radio somehow trigger a wake from System OFF?

    You are on the right track in terms of understanding. As you can see the System OFF mode, only four wakeup sources are available to wake the system from OFF mode. This is the deepest sleep mode that saves most of the power switching of most of the regulators and keeping the power only to the wakeup sense mechanism. 

    Unfortunately, RADIO is not one of the wakeup sources for System OFF, so we cannot use this type of sleep in your case.

    I think your concerns are what is Nordic is all about. And like what you said below

    From my reading it seems the way to go is to put the device into sleep mode, then wake occasionally to advertise and then stay awake if the app happens to be there and connects.

     This is where Nordic's solution and BLE are so special. When you make the chip to go to system idle (__WFE sleep) then you can architect your software to disable all of the peripherals and the BLE stack (softdevice) will wake the application automatically if there are any advertising (or any other radio events) that needs application processing. So in short what you need is already in place and all you need to do is handle those specific advertising events in such a way to keep the application alive until you need and make it go to sleep.

    How often you want the system to wake up to advertising/scan events depends on the intervals you choose to configure the radio. I would recommend you to try out a simple nRF5_SDK_17.0.0_9d13099\examples\ble_peripheral\ble_app_blinky example and measure the power it consumes. Play with different advertising intervals and measure again to see if the power consumption matches your usecase.

Reply
  • Hi Terry,

    Very interesting question.

      But I've also seen things like 'wake from system OFF' when triggered by GPIO, LPCOMP, NFC. Is it possible to have the radio somehow trigger a wake from System OFF?

    You are on the right track in terms of understanding. As you can see the System OFF mode, only four wakeup sources are available to wake the system from OFF mode. This is the deepest sleep mode that saves most of the power switching of most of the regulators and keeping the power only to the wakeup sense mechanism. 

    Unfortunately, RADIO is not one of the wakeup sources for System OFF, so we cannot use this type of sleep in your case.

    I think your concerns are what is Nordic is all about. And like what you said below

    From my reading it seems the way to go is to put the device into sleep mode, then wake occasionally to advertise and then stay awake if the app happens to be there and connects.

     This is where Nordic's solution and BLE are so special. When you make the chip to go to system idle (__WFE sleep) then you can architect your software to disable all of the peripherals and the BLE stack (softdevice) will wake the application automatically if there are any advertising (or any other radio events) that needs application processing. So in short what you need is already in place and all you need to do is handle those specific advertising events in such a way to keep the application alive until you need and make it go to sleep.

    How often you want the system to wake up to advertising/scan events depends on the intervals you choose to configure the radio. I would recommend you to try out a simple nRF5_SDK_17.0.0_9d13099\examples\ble_peripheral\ble_app_blinky example and measure the power it consumes. Play with different advertising intervals and measure again to see if the power consumption matches your usecase.

Children
Related