2025-02-05 09:11 PM
I am working with STM32WB55RG microcontroller. The application that I am working on needs to enter BLE mode when requested by user. I am able to start the BLE application and it starts advertising.
After a set time of 1 minute the application has to come back to normal operating conditions and enter stop2 mode. For this I am trying to de-initialize Bluetooth and stop CPU2 completely. I am calling hci_reset followed by HAL_IPCC_DeInit and disabling HSEM clock. After this I am calling LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN). Then i am setting CPU1 to stop2 mode.
The STOP2 mode current is around 3 mA compared to the 4 uA i am getting before the initialization of Bluetooth.
When I call the Bluetooth function for the 2nd time the sequencer is always idle. Every time I am doing the same initialization process, but only the first time Bluetooth is initializing properly.
Is there a better way to de-initialize and reinitialize BLE properly?