How to put the STM32WB55 in STOP2 mode
Hello,
The STM32WB55 on our custom board doesn't ever go into stop2 mode.
Our application needs to activate BLE and advertise for a fixed time at startup, so that the system can be configured and started. After this period BLE is no longer needed, so I want to completely stop the radio and C2. C1 has to wake up now and then to continue to run the application.
The application is made up of FreeRTOS tasks and uses the hardware timer service, tickless idle mode and the low power manager to handle the powermodes. Before advertisement is started, current draw is about 3mA. During advertising the current draw bumps up quite a bit to about 7.5mA. After advertising is stopped the current drops down a bit, but only down to about 6mA. I expect the current draw to go down to the original 3mA.
During initialization I set the power mode for the C2 core.
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_STOP2);When the advertisement timeout is reached, I perform these steps to stop BLE activity and trigger the system to enter stop mode.
aci_gap_set_non_discoverable();
SHCI_C2_Reinit();
UTIL_LPM_SetStopMode(1 << CFG_LPM_APP_BLE, UTIL_LPM_ENABLE); // Allow the LPM to set the system in STOP2 modeI can see that the LPM does run the code for setting the system to STOP2 mode. However if I look at the PWR_EXTSCR register, the C2STOPF and C1STOPF flags are never set. The C2 core does go into deepsleep mode according to the C2DS bit, but the radio does not seem to exit critical phase as the CRPF bit is always set.
Attempting to allow the BLE radio to enter low power mode fails with error code 17.
SHCI_C2_RADIO_AllowLowPower(BLE_IP, true);How can I stop all RF activities, stop the C2 core and keep both the core and the radio powered off to minimise current draw?
