cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L010 current consumption higher than expected

ARai
Associate II

Hi,

I have a custom board with STM32L010. I used STM32 cubeMX to initialize the GPIO,I2C,SPI,ADC,USART,LPTIM2,CRC,DMA and RTC. Then I de-initialize everything except GPIO and put the controller in sleep mode. The current consumption still is 250 uA after it enters sleep mode even though the datasheet says that it should be around 2uA. I use the following code to enter sleep mode,

SCB->SCR &= ~( SCB_SCR_SLEEPDEEP_Msk );  // low-power mode = sleep mode
SCB->SCR |= SCB_SCR_SLEEPONEXIT_Msk;     // reenter low-power mode after ISR
 
/* Ensure Flash memory stays on */
FLASH->ACR &= ~FLASH_ACR_SLEEP_PD;
__WFI();  // enter low-power mode

Is there something needs to be added or done to get 2uA current draw?

Thank you in advance for help.

8 REPLIES 8
ricehornet
Associate II

Hi,

I am experiencing a similar problem. I am using a STM32L071CB on a custom board and cannot get the Stop mode current below 130 uA.

I'm not sure about your code. According to all the examples and the documentation you shouldn't need to change anything about the Flash.

Have you tried using the HAL? I can use

HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);

To enter low-power mode and get the 130 uA result. An inlined version that gets the same 130 uA result is:

    /* Store the new value */
    PWR->CR &= ~(PWR_CR_PDDS);
    PWR->CR |= PWR_CR_ULP | PWR_CR_LPSDSR;
 
    /* Set SLEEPDEEP bit of Cortex-M0+ System Control Register */
    SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
 
    /* Request Wait For Interrupt */
    __WFI();

Looking forward if you are able to get the 2 uA current draw.

Peter BENSCH
ST Employee

Some hints:

  • Disable SYSTICK before entering STOPmode, otherwise the interrupt fires typically in 1ms steps.
  • Disable VREFint and BOR.
  • Define all unused GPIOs as Analog Input, which is best for lowest power consumption.
  • If possible use LSE, i.e. a real crystal, as it draws less current than LSI.

Good luck!

/Peter

In order 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.
ricehornet
Associate II

Thanks Peter for the quick reply.

Just to confirm, I should be able to set up SYSCLK/HCLK as 32 MHz, Vcore range 1 (1.8 V)? I understand that this setting should have no effect on Stop mode current consumption because the CPU clock is disabled -- it's just a matter of hunting down the peripheral that is still turned on.

Peter BENSCH
ST Employee

@ricehornet​ Yes, essentially correct.

In order 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.

Thanks Peter and ricehornet , will try your suggestions and let you know how it goes.

Hi Peter,

Thank you for the help. I was able to get it down below 100 uA and I think its mostly due to other components on the custom board.

I am trying to start LPTIM before entering STOP mode , but as soon as I start the STOP mode the LPTIM stops working and the code does not enter the LPTIM ISR. I use HAL_LPTIM_TimeOut_Start_IT to start the timer and LSE is connected as input to the low power timer. Is there something that needs to be done to get the ISR for LPTIM working in STOP mode. I checked the datasheet and it says it shouldnt be an issue but I am still unable to make it work.

Thank you,

Ashish

Ashish,

If you haven't already, I would suggest trying the examples in the STM32Cube github repo: https://github.com/STMicroelectronics/STM32CubeL0/tree/master/Projects/NUCLEO-L073RZ/Examples/LPTIM

I used these and a Nucleo board to get a working Stop mode configuration and then ported that to my custom board/firmware. Good luck!

Eric

Piranha
Chief II
DBG->CR = 0; // Disable debug in low-power modes

Do this before entering low-power mode and physically disconnect the debugger.