STM32WB ble disconnect with 0x08 reason after FLASH write operation
Hello!
We are developing device on STM32WB55 MCU along with mobile app companion. We use stm32wb5x_BLE_Stack_light_fw. The MCU works as Peripheral, mobile app - as Central.
In our firmware we use internal FLASH to store some configurations. Our application accesses FLASH according to AN5289 4.7 Flash memory management. However, we noticed that even if there is no active BLE communication, sometimes after FLASH writing operation the BLE connection between the device and mobile companion breaks with reason 0x08. It seems like we lock FLASH and BLE stack stops executing for long enough to not send packet during connection interval.
My next step was to update connection parameters to tolerate BLE stack stalling. I use aci_l2cap_connection_parameter_update_req API with parameters:
Conn_Interval_Min = 0x18 (30 ms)
Conn_Interval_Max = 0x24 (45 ms)
Slave_latency = 30
Timeout_Multiplier = 600 (6 s)
Now I am testing on iPhone 11. This parameters look fine and complies with https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf 40.6 Connection Parameters (page 179). I can see that Central accepts these parameters, but still, sometimes, the connection breaks with the same 0x08 reason. I tested lot's of different parameters so far, but I can't get stable BLE connection and that's why I am here.
My questions are:
1) Am I right about the reason behind BLE connection loss?
2) How should I play with connection parameters in order to get stable connection and don't loose too much data throughput speed?
If you need more information, please let me know.