Skip to main content
Nemonas
Associate
Jul 1, 2022 6:41 AM UTC
Solved

[STM32WB55] BLE On/Off function ?

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

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

This topic has been closed for replies.
Remy ISSALYS
Remy ISSALYSBest answer
ST Technical Moderator
Jul 6, 2022 9:17 AM UTC

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

4 replies

Remy ISSALYS
Remy ISSALYSBest answer
ST Technical Moderator
Jul 6, 2022 9:17 AM UTC

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

Visitor II
Aug 30, 2024 5:11 AM UTC

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.

ttnickb
Associate II
Jul 7, 2022 6:45 PM UTC

Hi Remy,

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

Remy ISSALYS
ST Technical Moderator
Jul 11, 2022 1:16 PM UTC

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