cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32WB55] BLE On/Off function ?

Nemonas
Associate II

[STM32WB55] Is there a BLE On/Off function?

I want to enable/disable the BLE function with a button

1 ACCEPTED SOLUTION

Accepted Solutions
Remy ISSALYS
ST Employee

Hello,

If there isn't any radio activity, the CPU2 is in low power mode. If you want to turn Off the BLE, you can create a task which call hci_reset function and set this task when you press your button. Then, to re enable the BLE, you have to perform the initialization (SHCI, GAP, GATT) again.

Best Regards

View solution in original post

4 REPLIES 4
Remy ISSALYS
ST Employee

Hello,

If there isn't any radio activity, the CPU2 is in low power mode. If you want to turn Off the BLE, you can create a task which call hci_reset function and set this task when you press your button. Then, to re enable the BLE, you have to perform the initialization (SHCI, GAP, GATT) again.

Best Regards

ttnickb
Associate III

Hi Remy,

Is there any benefit to calling `LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN)` in addition to `hci_reset()`?

Remy ISSALYS
ST Employee

Hello,

In order to enter in shutdown mode, you must turn off the CPU2 before. When CPU2 is running, you shall not use LL_C2 command like the following: LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);

When you called hci_reset function, the CPU2 is running so you can't call the shutdown command.

Best Regards

What if I don't want to turn off hci controller and just wanted to stop or kind of off the BLE stack when need to disable and again re-enable the BLE means re initialize the stack and all and BLE got diacovered.