Photon 2 BLE Central Freezes and PANIC-HARD FAULT After Peripheral Reset on DeviceOS 5.9.0

Hello,

This is happening in the same project I previously reported here.

I am working on a project where two Photon 2's connect via BLE.
I have removed the calls to the BLE APIs from BLE handlers per Particle's recommendation.
I have also created threads that keep up the BLE conectivity alive.
I am using message queues (os_queue) to send messages from BLE handlers to the loop() thread safely.
Using DeviceOS 5.9.0 on both devices.

I am observing this interesting event:

  1. The BLE connection between central and peripheral is established
  2. the BLE peripheral resets (examples: I power cycle it, I flash a new firmware in it)
  3. the BLE central freezes for around 9 minutes
  4. during those 9 minutes: I can ping the device and signal the device (it shoots rainbows)
  5. also during those 9 minutes: I cannot call a function on the device, I cannot request a variable on the device
  6. after 9 minutes, the BLE central device resets on a PANIC-HARD FAULT error

Why could this be happening?
Thanks again,

PS: might be related:

I believe the issue where a central BLE halts execution happens when:

  • the BLE central code runs on a thread
  • loop() calls something like: BLE.peerCentral().connected(); to check the connection status
  • the peripheral resets or power cycles for some reason
  • the central halts execution of user code

Still unsure what causes this, but at least there are things I can do about it, like avoid calling BLE.peerCentral().connected(); from loop().