Programmatically Restarting BLE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Programmatically Restarting BLE

1,631 Views
ofirmsh
Contributor I

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

 

Labels (1)
0 Kudos
Reply
3 Replies

1,607 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hi,

Please help me with the following information:

- What SDK example are you using?

- Are you using an EVK?

- What wireless module are you using?

 

SDK 2.13.1 is an old version. I strongly recommend you use SDK 2.16.000. It includes several bug fixes since the delta between versions is big.

 

Regards,

Daniel.

0 Kudos
Reply

1,586 Views
ofirmsh
Contributor I
Hi Daniel,

1. Our codebase has significantly changed since we started the project, but was originally based off of the Bluetooth shell.
2. No, we are using a custom board; though its schematic is heavily based on the MIMXRT1170-EVK.
3. We are using the 88w8987 wireless module.

We've been with v2.13.1 from a very early stage, fearing an upgrade due to integration issues. We'll try updating to the latest and see how it goes.

In the meantime do you happen to know what version of the Zephyr Bluetooth stack does SDK v2.13.1 use, so we can have a look at the changelog since?
Or any other ways that we can programmatically restart the Bluetooth stack?
0 Kudos
Reply

1,546 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hi,


You can take a look to the Release Notes of the SDK in the following directory SDK_2_16_000_MIMXRT1170-EVKB\docs\wireless\Release Notes to see the changes and known bug fixes. I checked RT1170-EVK 2.13.1 RNs and I didn't find any known issues in BT.

By the way, if you upgrade and you would like to get BT examples, you will need to use the EVKB SDK and not the EVK.

Regards,

Daniel.

0 Kudos
Reply