cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G491 low power mode

abhijith_raj
Associate II

 

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);

}
8 REPLIES 8
Saket_Om
ST Employee

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.

STM32CubeG4/Projects/NUCLEO-G431KB/Examples/PWR/PWR_STOP0_RTC/Src/main.c at master · STMicroelectronics/STM32CubeG4 · GitHub 

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.
Saket_Om
Sarra.S
ST Employee

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.

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?

Hi @Sarra.S 
By referring this article I implemented the low power mode.

@abhijith_raj 

The current consumption in STOP1 mode is described in the table below: 

Saket_Om_0-1747048602501.png

 

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.
Saket_Om

@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...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
TDK
Guru

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

If you feel a post has answered your question, please click "Accept as Solution".

Hello @abhijith_raj 

Please did you disable IRQ before entering in stop mode?

__disable_irq();

 

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.
Saket_Om