2023-04-25 09:45 PM
i am trying to measure the power consumption of the MCU in my custom board with different sleep modes, while measuring the stop2 mode i am getting consumption of 110 uA in the datasheet its showing of 2 uA ,even for shutdown and standby mode also its consuming that current.in sleep and active mode am getting proper value as mention in the data sheet.
to get into stop2 mode am using,
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_Delay(1000);
HAL_SuspendTick();
HAL_PWREx_EnterSTOP2Mode(PWR_SLEEPENTRY_WFI);
HAL_ResumeTick();
}
/* USER CODE END 3 *
apart from this step do i need to do anything extra for enabling the stop2 mode.
(am using lpm01a ST power measurement module.)
Solved! Go to Solution.
2023-04-26 01:42 AM
Hello,
You can look into STM32CubeWB package, there is several examples around low power mode:
Another example is available on STM32 Hotspot Github, this example show how to enter in standby mode on STM32WB55.
You can also refer to AN5289, see part 4.6 Low power manager.
Best Regards
2023-04-26 12:25 AM
Example from F746:
Change to analog mode all GPIO:
/* Configure all GPIO as analog to reduce current consumption on non used IOs */
/* Enable GPIOs clock */
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();
__HAL_RCC_GPIOH_CLK_ENABLE();
__HAL_RCC_GPIOI_CLK_ENABLE();
__HAL_RCC_GPIOJ_CLK_ENABLE();
__HAL_RCC_GPIOK_CLK_ENABLE();
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Pin = GPIO_PIN_All;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOJ, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOK, &GPIO_InitStruct);
/* Disable GPIOs clock */
__HAL_RCC_GPIOA_CLK_DISABLE();
__HAL_RCC_GPIOB_CLK_DISABLE();
__HAL_RCC_GPIOC_CLK_DISABLE();
__HAL_RCC_GPIOD_CLK_DISABLE();
__HAL_RCC_GPIOE_CLK_DISABLE();
__HAL_RCC_GPIOF_CLK_DISABLE();
__HAL_RCC_GPIOG_CLK_DISABLE();
__HAL_RCC_GPIOH_CLK_DISABLE();
__HAL_RCC_GPIOI_CLK_DISABLE();
__HAL_RCC_GPIOJ_CLK_DISABLE();
__HAL_RCC_GPIOK_CLK_DISABLE();
them add this:
HAL_PWREx_EnableFlashPowerDown(PWR_FLASHPD_LPSLEEP);
2023-04-26 12:26 AM
Hello @sabari and welcome to the Community :) ;
Could you please provide more details on the issue such as which STM32WB devices product you are using?
To minimize the power consumption in low power mode, please make sure that, if all free pins are set as analog.
For that, I advise you to take a look at How to minimize the power consumption in low power mode: An example using NUCLEO-F401RE board article.
Also, please check the parameters mentioned in the datasheet.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-04-26 01:42 AM
Hello,
You can look into STM32CubeWB package, there is several examples around low power mode:
Another example is available on STM32 Hotspot Github, this example show how to enter in standby mode on STM32WB55.
You can also refer to AN5289, see part 4.6 Low power manager.
Best Regards
2023-04-26 06:10 AM
thanks for your replay anyways I already make the unused GPIO as analog input using the cubeMX configuration , i got the solution from the example codes provided by ST, I forgot to shutdown the core 1 since it is consuming the extra current after i use the API
LL_C2_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
I am getting the proper current as i mentioned in the datasheet (2 uA).