7 years, 10 months ago.

Is there a more efficient sleep for my nrf51822 BLE than ble.waitForEvent?

I'm doing some BLE dev work on the nrf51822 and I'm having trouble getting power consumption to where I want it. My code so far builds off of the health thermometer service, which sends a data packet to your device at a specified interval, and spends the rest of the time waiting for an event (ble.waitForEvent), during which it burns about 270uA.

I can get the nrf to 10uA if I put it into sleep with (double underscore) WFE(), but I can't do this while it's executing ble.waitForEvent. After some searching for how to sleep the nrf while it's waiting for an event, I found the page below, which tells me that ble.waitForEvent is the sleep mode for BLE. But I've gotten the nrf to wake up from its 10uA sleep to send something through BLE before, so I know it's possible to go to that power-consumption level while doing BLE advertisement, as long as you're willing to disconnect in between transmissions.

Is there a way to execute the WFE sleep while (or instead of) ble.waitForEvent is running? If not, what should I use to get around this? I was thinking of using an onDisconnect to trigger WFE, and then setting a timer to wake it for next transmit, as a way to get around using waitForEvent. Thanks in advance!

https://docs.mbed.com/docs/ble-intros/en/latest/mbed_Classic/Events/

Be the first to answer this question.