Hi all,
I’ve been working working with the BLE stack on mbed os and the Arduino Nano 33 BLE for a bit now. Previously, on version 6.2 (or 6.3?) I had a working scan implemented.
Since upgrading to 6.8 (though now I’m on 6.9) – I’ve had an issue where I get the following error:
++ MbedOS Error Info ++
Error Status: 0x80FF0144 Code: 324 Module: 255
Error Message: Assertion failed: _scan_state == ScanState::pending_scan
Location: 0x4DAA1
File: ./mbed-os/connectivity/FEATURE_BLE/source/generic/GapImpl.cpp+1296
Error Value: 0x0
Current Thread: ble event processing Id: 0x20001A28 Entry: 0x4EBDD StackSize: 0x1000 StackMem: 0x20018F78 SP: 0x20019DA4
You can see it’s a failed assertion related to the current _scan_state
. I did some digging and got mbed trace enabled on my build/board and noticed that I don’t get any trace info on set scan state, which I believe should be logging via trace:
void Gap::set_scan_state(ScanState state)
{
_scan_state = state;
if (state == ScanState::idle) {
tr_info("Scan state: idle");
} else if (state == ScanState::pending_scan) {
tr_info("Scan state: pending_scan");
} else if (state == ScanState::pending_stop_scan) {
tr_info("Scan state: pending_stop_scan");
} else if (state == ScanState::scan) {
tr_info("Scan state: scan");
}
}
What is interesting in my tracing output is I never see any state info traced:
e[2Ke[39m[INFO][BLGP]: Set scan parameters - own_address_type=RANDOM, scanning_filter_policy=NO_FILTER, phys=1, phy_1m_configuration:[interval=50ms,window=37ms,active_scanning=true]e[0m
e[2Ke[39m[INFO][BLGP]: Start scan - duration=0ms, filtering=DISABLE, period=0mse[0m
e[2Ke[39m[INFO][BLGP]: Initiate scane[0m
e[2Ke[39m[INFO][BLDM]: Set random address - address=4f:db:01:3c:7e:dfe[0m
e[2Ke[39m[INFO][BLDM]: Extended scan enable - enable=true, filter_duplicates=DISABLE, duration=0, period=0e[0m
e[2Ke[39m[INFO][BLGP]: Scan successfully startede[0m
Does anyone have any insight into why my _scan_state
has an unexpected value? Any insights would be very helpful.