Skip to main content
Visitor II
February 28, 2024
Question

STM32L031G6x stop mode power consumption issue

  • February 28, 2024
  • 1 reply
  • 1202 views

Hello.

The MCU currently in use is STM32L031G6X.

In order to minimize current during sleep, the external circuit currently uses 100K pull-down to PB3 to set it to "Rising Interrupt" and UART 1 for testing.

When measuring the current, remove the external console jig connected to UART1.

I set it to standby mode, it's 3.3uA, but wake it up with RTC interrupt and PA0WAKE pin, the system will reset

It doesn't fit the mode I'm trying to use, so I'm trying to minimize the current in stop mode.

The code in stop mode is as follows.

If i disabled SystemPower_Config(); will wake up well in RTC and PB3 button interrupts, but the current will be measured at 22uA.

If I enabled SystemPower_Config();, it can't get out of the sleep without resetting it after going into the sleep.

I want to get out of stop mode well and reduce the current to 3uA.

void StopMode(void)

{

//nSecond is set to 10 seconds.

if(HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, nSeconds*2396, RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK) {

Error_Handler();

}

SystemPower_Config();

HAL_SuspendTick();

HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);

SystemClock_Config();

HAL_ResumeTick();

}



//If  set it to analog pin as below, the current will decrease for sure, but in sleep mode

//It can't get out.

void SystemPower_Config(void)

{

GPIO_InitTypeDef GPIO_InitStructure = {0};

GPIO_InitStructure.Pin = GPIO_PIN_All;

GPIO_InitStructure.Mode = GPIO_MODE_ANALOG;

GPIO_InitStructure.Pull = GPIO_NOPULL;



HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);

HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);

HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);



__HAL_RCC_GPIOA_CLK_DISABLE();

__HAL_RCC_GPIOB_CLK_DISABLE();

__HAL_RCC_GPIOC_CLK_DISABLE();

}

    This topic has been closed for replies.

    1 reply

    ST Employee
    February 28, 2024

    Hello @Palmer, welcome to ST Community, 

    Your question is not totally clear and I would like you to reformulate the issue briefly, 

    1. are you using RTC or EXTI with PB13 to wakeup from stop mode 

    2. do you want to achieve the consumption of standby mode (3.3) using stop mode? I'm afraid that's not possible even with configuring all GPIOs as analog! Could you explain why the reset is an issue? 

    3. also, I do not understand this: If I enabled SystemPower_Config();, it can't get out of the sleep without resetting it after going into the sleep.