Hello,
My team and I are using MIMXRT1176, using v2.13.1 of the SDK and the VSCode extension.
We have stumbled upon an error where repeatedly connecting then disconnecting stalls the BLE module, which seems to actually be a deadlock within the Ethermind Bluetooth stack's internal threads, though we are not entirely sure.
We know that Ethermind is built on top of the Zephyr Bluetooth stack and tried looking around for solutions there, but no luck.
Ideally, we'd want to programmatically reset the BLE, and we found a bt_disable function (which is wrapped around a #if 0 directive), but there are a bit of issues with our solution that we hoped could get answered.
1. bt_disable calls controller_init, which downloads the soft device again. Is this necessary?
2. Attempting to enable the Bluetooth via bt_enable after disabling it results in an error due to failure to push to a queue. The queue in question is free_tx, and seems to be related to the deadlock - it is never emptied.
Have there been any changes that might address these issues in later versions of the SDK?
How do we programmatically reset the BLE?
For clarity:
* bt_enable and bt_disable can be found in bt_pal_hci_core.c
* The failure point of re-enabling Bluetooth is in bt_conn_init, there you can find the free_tx queue. The file is bt_pal_conn.c