ARMmbed / ARMmbed/ble

Possible Ticker BLE_API conflict causing problems with Nordic devices?

Open
#186 7 comments 0 reactions 0 assignees View on GitHub
mirrored
Dominant language
C++
Stars
81
Forks
71
PR merge metrics
No merged PRs in 30d

Description

Apologies if you've seen this before as this, or related issues, have appeared on other parts of the mbed forum/github. I now believe it's potentially a bug with the BLE_API so I'm posting an updated issue here.

When using Tickers in combination with the BLE_API & Softdevice on Nordic targets the application can unexpectedly hang. The Ticker interrupts stop firing and (from debug in Keil) it seems the code never returns to main().

I'm struggling to find out exactly what is causing this but I suspect that multiple things have control over the Nordic RTC1 timer device and at the wrong moment they can both collide or reset things and stop the application Tickers from firing.

There are seemingly related versions of this issue here:
https://github.com/mbedmicro/mbed/issues/1533
https://developer.mbed.org/questions/3729/Question-about-the-communication-between/
https://developer.mbed.org/questions/69710/Tickers-crashhang-on-the-nRF51822-especi/

But few concrete answers so far.

Related to this, I recently read this older BLE_API issue: https://github.com/ARMmbed/ble/issues/89
That describes problems with the mbed-classic implementation of the BLE_API. It says (and code confirms) that a Ticker/Timeout object is used within callbacks in the BLE_API (if using mbed-classic).

Can anyone confirm/deny if this older issue is what is causing these current problems? Otherwise any ideas on a fix for this Ticker issue?

Contributor guide

Open the contributing guide

Research direction

Start by examining the BLE_API use of Ticker/Timeout objects in callbacks and how that interacts with the Nordic RTC1 timer and Softdevice. Compare the behavior and proposed causes in issues 1533 and ARMmbed/ble#89, then reproduce the hang on a Nordic target; done means the RTC1 conflict is confirmed or ruled out and a concrete fix or narrowed failing case is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.