Description
Description
I'm trying to get the BLE_Button example working with low power enabled. Based on the answer to this question I compiled the example code with RTOS disabled (by adding .mbedignore
as suggested). Power consumption went down as expected but the LED stopped blinking after a couple of hours of running. This makes the BLE unusable on nRF52 for any practical purpose because either it has too high power consumption or stops working after a few hours.
- Type: Bug
- Related issues: Multiple tickers stop working #1533, multiple tickers stop working #1378 ?
- Priority: Blocker
Bug
Target
NRF52_DK
Toolchain:
GCC_ARM
Toolchain version:
gcc-arm-none-eabi-4_9-2015q3
mbed-cli version:
0.9.10
mbed-os sha:
5faf4b2 Merge pull request #3837 from ARMmbed/release-candidate
Expected behavior
BLE_Button example should keep working with low power enabled.
Actual behavior
After some time the LED stops blinking. The BLE interface still works, i.e. I can connect to the device and read characteristics correctly. When there is some BLE activity the LED blinks once or twice. It seems that the EventQueue
stops calling the blinkCallback()
function.
This happens after a couple of hours of running. It seems that the exact time required depends on the on the event dispatch frequency:
eventQueue.call_every(n, blinkCallback);
If n
is 50, LED stops blinking after 8200 seconds, if n
is 20, it stops after about 6670 seconds.
Steps to reproduce
Download the official BLE_Button example, disable RTOS by adding the following .mbedignore
to the project and compile the code.
mbed-os/rtos/*
mbed-os/features/FEATURE_CLIENT/*
mbed-os/features/FEATURE_COMMON_PAL/*
mbed-os/features/FEATURE_UVISOR/*
mbed-os/features/frameworks/*
mbed-os/features/net/*
mbed-os/features/netsocket/*
mbed-os/features/storage/*
Additional Comments
I have been trying to make BLE examples work with low power for a few days now using various methods. I tried using waitForEvent()
and Tickers with a very similar result. It seems that some low level code interfacing the nRF52 timer might be buggy in some way.