cancel
Showing results for 
Search instead for 
Did you mean: 

How to put the STM32WB55 in STOP2 mode

Lvan .4
Associate II

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 mode

I 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?

1 REPLY 1
Remy ISSALYS
ST Employee

Hello,

You shall never try to force the LOW power mode of CPU2 using any LL_C2_*** API and there is nothing you need to do on CPU1 side to force any CPU2 low power mode.

The CPU2 manage on its own the best low power mode to be applied and the application shall only take care of the CPU1 low power mode n the same way that you would do on any STM32 single core platform.

There are only two exceptions compare to what you would have done on a single core STM32 platform

1/ LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN); is called one time at startup in SystemPower_Config() to overwrite the reset value in case you plan to enter low power mode on CPU1 without starting yet CPU2.

2/ The entry/exit of low power mode ( expecially Stop Mode) need to use/check semaphores to handle synchronization with the CPU2.

These algorithm are described in AN5289 rev4 - chapter 4.3 Shared peripherals.

These algorithm are implemented in stm32_lpm_if.c.

You can look BLE_HeartRateFreeRTOS example available in STM32CubeWB package. This example allows to enter in stop2 low power mode.

Best Regards