Intermittent Unhandled event
and panic in HCIClass::Poll
#307
Labels
type: imperfection
Perceived defect in any part of project
I'm working with the ArduinoBLE library on the Portenta H7, and encountering a hard fault occasionally while listening for data. This happens between 5-30min after the device starts, and as such it's a bit of a nightmare to debug.
This is the situation: I am receiving data as a central connected to 1 peripheral device at about 1kB/s, and I am currently not using interrupts to receive data by registering the characteristic with a BLEUpdated event. I had some other issues with threading and memory access, so to make sure I converted my firmware to not use any user mbed threads and managing time slicing myself.
This results in the BLE thread being called extremely quickly (1000Hz) for most of the time, and then every 2 seconds I have a function which computes an FFT and does some math on the data received over BLE (what the BLT_PARSE::rxBuffer ringbuffer handles in the code below). The longest I believe BLE.poll goes without being called is approximately 38ms, which I think should be plenty to not overrun the library's internal RX buffer of 256 bytes (and I am not seeing any buffer overrun errors when I have logging enabled).
The hard fault happens when an
[Info] Unhandled event
is logged, and then two calls toHCIClass::handleAclDataPkt
are made, the second of which creates a hard fault.I'm a bit stuck here with how to proceed, so any ideas or pointers on what could be happening would be appreciated.
Receive function:
BLE library logging:
Mbed crash log:
The text was updated successfully, but these errors were encountered: