Skip to content

nRF52 timer problem #3857

Closed
Closed
@tbondar

Description

@tbondar

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.


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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions