cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 low-power run mode

diego ambroggi
Associate III

Hi,

I'm tring to set low power mode in an STM32L031 MCU, using a NUCLEO 32 for evaluation first.

Now my aim is to set MCU in a low power mode, only checking some digital pins during this state.

Anyway, I switched off analogs and LPUART beforw invoking  HAL_PWREx_EnableLowPowerRunMode();

My consumption is about 1,5mA, but it should be some uA instead.

I tried to set in stop mode and it goes in very low power mode correctly (<1uA), but Is not possible for me to stop the CPU.

This is the code I used.

           //Disable uart

           if (HAL_UART_DeInit(&hlpuart1) != HAL_OK)

           {

           Error_Handler();

           }

           //Disable adc

           HAL_ADC_Stop_DMA(&hadc);

           __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);

           HAL_PWREx_EnableLowPowerRunMode();

Thanks in advance

Diego

1 REPLY 1
Jack Peacock_2
Senior III

It's not obvious what low power frequency you are using for the core. Low power RUN mode is not STOP, the core continues to execute instructions at a very low frequency, 100KHz range instead of MHz. Look in the datasheet for the current consumption at your new clock frequency.

Also, are all other peripherals off, including the RTC? Do you switch GPIO pins to analog mode to reduce leakage from external connections? Are there external pull up/down resistors consuming current? Is there an HSE or LSE oscillator running? Are you using a regulator in the power supply, and what happens when it runs in low current mode? You need to look at the entire board for power reduction.

I don't use the HAL so not sure happens when you enter LP RUN mode with it.

Jack Peacock