How to reduce the power consumption of STM32WB55 stop2 mode?
Hello,
We have a project that uses STM32WB55 as the main controller.
This project has certain requirements for power consumption and wants to enter sleep mode through stop2 mode.
But I tested the power consumption current of stop2 mode on the STM32WB55 DK board (Nucleo-WB55) and it was 107uA. We have configured RTC and external interrupts to wake up stop2 mode, and we want its power consumption current in stop2 mode to be less than 5uA.
May I ask if the power consumption current can reach 5uA when enabling RTC Alarm A and external interrupt to enter stop2 mode?
I used the routine on the stm32wb55 official website to test the stop2 mode: STM32Cube_FW_WB_V1.22.0\Projects\P-NUCLEO-WB55.Nucleo\Examples_LL\PWR\PWR_EnterStopMode
I added serial port printing and configuration before entering stop2 mode to this routine.
Now I have configured the MSI clock to 100Khz.
void EnterStop2Mode(void)
{
LL_GPIO_InitTypeDef gpio_initstruct = {LL_GPIO_PIN_ALL, LL_GPIO_MODE_ANALOG,
LL_GPIO_SPEED_FREQ_HIGH, LL_GPIO_OUTPUT_PUSHPULL,
LL_GPIO_PULL_NO, LL_GPIO_AF_0};
/* Set all GPIO in analog state to reduce power consumption, */
/* Note: Debug using ST-Link is not possible during the execution of this */
/* example because communication between ST-link and the device */
/* under test is done through UART. All GPIO pins are disabled (set */
/* to analog input mode) including UART I/O pins. */
LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOA |
LL_AHB2_GRP1_PERIPH_GPIOB |
LL_AHB2_GRP1_PERIPH_GPIOC |
LL_AHB2_GRP1_PERIPH_GPIOD |
LL_AHB2_GRP1_PERIPH_GPIOE |
LL_AHB2_GRP1_PERIPH_GPIOH);
LL_GPIO_Init(GPIOA, &gpio_initstruct);
LL_GPIO_Init(GPIOB, &gpio_initstruct);
LL_GPIO_Init(GPIOC, &gpio_initstruct);
LL_GPIO_Init(GPIOD, &gpio_initstruct);
LL_GPIO_Init(GPIOE, &gpio_initstruct);
LL_GPIO_Init(GPIOH, &gpio_initstruct);
LL_AHB2_GRP1_DisableClock(LL_AHB2_GRP1_PERIPH_GPIOA |
LL_AHB2_GRP1_PERIPH_GPIOB |
LL_AHB2_GRP1_PERIPH_GPIOC |
LL_AHB2_GRP1_PERIPH_GPIOD |
LL_AHB2_GRP1_PERIPH_GPIOE |
LL_AHB2_GRP1_PERIPH_GPIOH);
HAL_SuspendTick();
HAL_UART_DeInit(&huart1);
HAL_UART_MspDeInit(&huart1);
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE2);
LL_RCC_MSI_Enable();
while( !LL_RCC_MSI_IsReady() )
{
}
LL_RCC_SetSysClkSource( LL_RCC_SYS_CLKSOURCE_MSI );
LL_RCC_SetSMPSClockSource( LL_RCC_SMPS_CLKSOURCE_MSI );
while( LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_MSI )
{
}
/* 1 - Set Frequency to 100KHz to activate Low Power Run Mode: 100KHz */
/* Range Selection already enabled. Need to change Range only */
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_0);
// /* Update CMSIS variable */
LL_SetSystemCoreClock(100 * 1000);
LL_RCC_SetClkAfterWakeFromStop( LL_RCC_STOP_WAKEUPCLOCK_MSI );
/** Request to enter Stop 2 mode */
/* Set Stop 2 mode when CPU enters deepsleep */
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
LL_LPM_EnableDeepSleep();
/* Request Wait For Interrupt */
__WFI();
}
How to configure it to reduce power consumption?
Thanks!
