2025-05-12 3:14 AM - last edited on 2025-05-12 6:12 AM by Andrew Neil
Hi,
I'm currently working with the STM32G491 MCU to implement low power functionality. I plan to enter Stop mode when a specific condition is met. I've written a function to handle entering low power mode.
However, I'm noticing that the current consumption only drops slightly—from 53 mA to 51 mA—after entering Stop mode.
Here is the code I wrote for low power mode.
void enter_low_power_mode(void)
{
HAL_UART_DeInit(&huart1);
HAL_SPI_DeInit(&hspi1);
HAL_I2C_DeInit(&hi2c3);
__HAL_RCC_TIM1_CLK_DISABLE();
__HAL_RCC_USART1_CLK_DISABLE();
__HAL_RCC_SPI1_CLK_DISABLE();
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_MSI);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
__HAL_RCC_PWR_CLK_ENABLE();
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
SystemClock_Config();
__HAL_RCC_I2C3_CLK_ENABLE();
__HAL_RCC_LPTIM1_CLK_ENABLE();
__HAL_RCC_LPUART1_CLK_ENABLE();
__HAL_RCC_SPI1_CLK_ENABLE();
HAL_ResumeTick();
MX_USART1_UART_Init();
MX_SPI1_Init();
__HAL_UART_CLEAR_FLAG(&huart1, UART_FLAG_TC);
}
2025-05-12 3:36 AM
Hello @abhijith_raj
Have you configured all GPIO ports to operate in analog mode to minimize power consumption?
Please see the example below for reference.
2025-05-12 3:39 AM
Hello @abhijith_raj,
You can also check this article: Tips for using STM32 low-power modes - STMicroelectronics Community
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.
2025-05-12 3:59 AM
Hi @Saket_Om
I tried configuring the GPIOs to analog mode, but the power consumption remains the same.
As an experiment, I erased the MCU and powered it up to measure the current — it shows 25 mA. The hardware team suspects there might be a current leak.
Given that, shouldn't my current low-power mode also show around 25 mA at most?
2025-05-12 4:01 AM
Hi @Sarra.S
By referring this article I implemented the low power mode.
2025-05-12 4:17 AM
The current consumption in STOP1 mode is described in the table below:
2025-05-12 4:27 AM
@abhijith_raj wrote:current consumption only drops slightly—from 53 mA to 51 mA—after entering Stop mode.
Are you sure that is due to the MCU itself?
Have you disconnected any debugger, and performed a power-cycle ?
Are there other things on your board?
Please post your schematics - see: How to write your question to maximize your chances to find a solution.
Achieving low power is very much about the entire system - including hardware - not just the software...
2025-05-12 5:42 AM
> from 53 mA to 51 mA
This is a very high current consumption for the CPU. Probably there are other components on the board drawing power. Are you able to share a schematic? If not, what other components are present?
2025-05-12 5:45 AM
Hello @abhijith_raj
Please did you disable IRQ before entering in stop mode?
__disable_irq();