Skip to main content
Visitor II
March 5, 2025
Question

Low power STOP1 mode current consumption high

  • March 5, 2025
  • 2 replies
  • 587 views

Hello,

I am using STM32G4 to develop a project where I am running FreeRTOS.

Recently I was working on debugging the issues for low power mode.

I can confirm all the peripherals clocks are disabled before entering the STOP1 mode, but the power consumption is still very high (~35mA). 

My function to prepare for STOP1 mode is here:

void EnterStop1Mode(void)
{
    /* Ensure all tasks are idle before entering Stop mode */
    taskENTER_CRITICAL();  

    //HAL_PWREx_EnableLowPowerRunMode();

    /* Disable SysTick Completely */
    SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;  
    HAL_SuspendTick();

    /* Disable Peripheral Clocks to Reduce Power */
    HighPowerSwitch(SWITCH_OFF);
    HAL_ADC_MspDeInit(&hadc1);
    HAL_SPI_MspDeInit(&hspi1);
    HAL_SPI_MspDeInit(&hspi2);
    HAL_TIM_PWM_MspDeInit(&htim1);
    HAL_TIM_PWM_MspDeInit(&htim2);
    HAL_TIM_PWM_MspDeInit(&htim15);
    HAL_TIM_Encoder_MspDeInit(&htim3);
    HAL_TIM_Encoder_MspDeInit(&htim4);
    HAL_UART_MspDeInit(&huart1);
    HAL_I2C_MspDeInit(&hi2c2);
    HAL_DAC_MspDeInit(&hdac1);

    /* Disable Debug Mode to Allow Full Power Down */
    //HAL_DBGMCU_DisableDBGStopMode();
    PreStop_SystemClock_Config();

    HAL_PWREx_EnableLowPowerRunMode(); // Enable low-power regulator

    /* Enter Stop 1 Mode */
    HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI);

    /* --- Wake-Up Occurred --- */

    /* Restore System Clock */
    SystemClock_Config();

    /* Re-enable SysTick */
    SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
    HAL_ResumeTick();

    /* Restore GPIOs */
    MX_GPIO_Init();

    /* Resume FreeRTOS Task Scheduling */
    taskEXIT_CRITICAL();
}

I tried with the code like below:

int main(void)
{
    HAL_Init();
    SystemClock_Config();
    MX_GPIO_Init();
   
    HAL_Delay(1000);

    /* Enter Stop 1 Mode */
    HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI);

    while (1);
}
just to test if it might be because of any peripherals not properly disabled. However running this code gives the me same result. 
 
Do you see anything I made is fundamentally incorrect? I tried to find a standard procedure for entering the low power mode, but couldn't find any. Would you suggest some different approaches I could maybe check it out? 

One thing worth to mention is, when I had a fresh PCB without any program, the power consumption is close to zero. Thus, I can be sure, I don't have anywhere in hardware it is leaking the current.
 
Thanks for your support!
 
 
    This topic has been closed for replies.

    2 replies

    ST Employee
    March 11, 2025

    Hello @weji_taku, welcome to ST Community, 

    First, set all unused GPIOs to analog mode to minimize power consumption : check Tips for using STM32 low-power modes - STMicroelectronics Community

     

    Super User
    March 22, 2025

    Please see How to insert source code.

     


    @weji_taku wrote:

    I can confirm all the peripherals clocks are disabled before entering the STOP1 mode, but the power consumption is still very high (~35mA). 


    Is the debugger physically disconnected?

    Have you power-cycled the target since disconnecting the debugger?

    See:

    https://community.st.com/t5/stm32-mcus-wireless/how-to-reduce-the-power-consumption-of-stm32wb55-stop2-mode/m-p/785696/highlight/true#M23997

    weji_takuAuthor
    Visitor II
    March 24, 2025

    Hi Andrew,

    Thank you for your reply!

    I finally identified the issues were because of some encoder circuits, which are consuming quite some current.

    However, I have problem to wake it up now. I configured the wake up source to be EXTI. I could confirm that EXTI pin works before the sleep (HW is 100% working), but it cannot wake up. I wonder if there are some standard procedures about this topic? Just so I could walk it through to see what I might be missing?

    Thanks :)

     

    Super User
    March 24, 2025

    @weji_taku wrote:

    I finally identified the issues were because of some encoder circuits, which are consuming quite some current.


    Excellent so please mark that as the solution:

    https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256

     


    @weji_taku wrote:

    However, I have problem to wake it up now. I configured the wake up source to be EXTI. I could confirm that EXTI pin works before the sleep (HW is 100% working), but it cannot wake up. I wonder if there are some standard procedures about this topic? Just so I could walk it through to see what I might be missing?


    That's a separate question - please start a new thread for that.

    Please post a link here for people to find it.