ARMmbed / mbed-os-example-ble

BLE demos using mbed OS and mbed cli
Apache License 2.0
134 stars 118 forks source link

GAP example broken for nRF52_DK in branch mbed-os-5-15 #312

Closed helpfulchicken closed 3 years ago

helpfulchicken commented 4 years ago

Description of defect

The BLE_GAP example, in the branch mbed-os-5-15, runs for a little while, switching between scanning and advertising modes as expected, then it crashes with an assertion failed relating to advertising types.

Target(s) affected by this defect ?

Tested this on a unit programmed as the NRF52_DK target.

Toolchain(s) (name and version) displaying this defect ?

GCC_ARM (GNU Tools Arm Embedded, version 6.3.1)

What version of Mbed-os are you using (tag or sha) ?

mbed-os-5.15.4

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed-cli version 1.8.3

How is this defect reproduced ?

Program BLE_GAP from mbed-os 5.15 branch. Run the application while monitoring output in a terminal. Don't connect to the unit over BLE, just let it run. It will crash due to assertion failure when starting advertising, after stepping through the operation modes a few times.

Debug output:

DEVICE MAC ADDRESS: ca:da:63:c9:75:d5

Scanning started (interval: 2ms, window: 2ms, timeout: 0ms). We have scanned for 5999ms with an interval of 4 timeslots and a window of 4 timeslots We have been listening on the radio for at least 5997ms

Starting next GAP demo mode DEVICE MAC ADDRESS: ca:da:63:c9:75:d5

Scanning started (interval: 100ms, window: 62ms, timeout: 3000ms). Stopped scanning early due to timeout parameter We have scanned for 3154ms with an interval of 160 timeslots and a window of 100 timeslots We have been listening on the radio for at least 1937ms

Starting next GAP demo mode DEVICE MAC ADDRESS: ca:da:63:c9:75:d5

Scanning started (interval: 100ms, window: 25ms, timeout: 0ms). We have scanned for 5999ms with an interval of 160 timeslots and a window of 40 timeslots We have been listening on the radio for at least 1475ms

Starting next GAP demo mode DEVICE MAC ADDRESS: ca:da:63:c9:75:d5

Scanning started (interval: 312ms, window: 6ms, timeout: 0ms). We have scanned for 5999ms with an interval of 500 timeslots and a window of 10 timeslots We have been listening on the radio for at least 118ms

Starting next GAP demo mode DEVICE MAC ADDRESS: ca:da:63:c9:75:d5

Advertising started (type: 0x0, interval: [25 : 50]ms)

++ MbedOS Error Info ++ Error Status: 0x80FF0144 Code: 324 Module: 255 Error Message: Assertion failed: (_advType != advertising_type_t::CONNECTABLE_UNDIRECTED) && (_advType != advertising_type_t::CONNECTABLE_DIRECTED) Location: 0x36727 File: ./mbed-os/features/FEATURE_BLE/ble/gap/AdvertisingParameters.h+533 Error Value: 0x0 Current Thread: main Id: 0x20003438 Entry: 0x3760F StackSize: 0x1000 StackMem: 0x20006F80 SP: 0x20007914 For more info, visit: https://mbed.com/s/error?error=0x80FF0144&tgt=NRF52_DK -- MbedOS Error Info --

helpfulchicken commented 4 years ago

I found that one of the recent commits on the master branch (mbed-os-6.2.0) 31426f1 fixes this issue.

ciarmcom commented 3 years ago

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. Internal Jira reference: https://jira.arm.com/browse/IOTOSM-2054