Nucleo L152RE power consumption in deepsleep and sleep

07 May 2015

Hi, I am using the simple program below to test power consumption on the Nucleo L152RE in sleep and deepsleep modes.

int main()
{
    while(1) 
   {
    deepsleep();
  //sleep();
    }
}

I measure the current over JP6(IDD) and get the folloing currents:

In deepsleep I get about 0.7 mA, and in sleep about 2.9 mA.

Is this as low as it goes for these sleepmodes, or am I doing something wrong? The image below is from STs webpage on the MCU on the nucleo board. How are these values this low compared to the results I get?

/media/uploads/hebryn/nucleo_current_consumption.png

25 May 2015

Hi Håkon Bryn,

the same problem I have with my L152RE NUCLEO board. Maybe there is something on the demo board which eats the power. Also the connected USB could be a source of the problem. Hopefully somebody has the answer for us.

Regards

Helmut

29 May 2015

I have a custom PCB with an L152RE on it. I'm fairly confident that the rest of my board is not consuming more than 50uA. When I put it into deepsleep my current consumption is 500-600uA. And it doesn't seem to be very consistent, the sleep current seems to drift back and forth.

I'm looking at the HAL code in the mbed library but nothing seems to jump out as obvious. Has anyone else fixed this problem yet?

30 May 2015

For the Nucleo L152RE board I have some ideas, the USB drive is still available, maybe the USB IO eats the power. Can you disconnect the USB VDD on your custom PCB, maybe this helps.

09 Jun 2015

It looks like the majority of power is from the GPIOs being initialized. If you put this code in before you go into deep sleep I can get my board down to 40-50uA. Now I have to figure out how to save the GPIO state before going to sleep and reinit them after waking up.

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_GPIO_Init(GPIOD, &GPIO_InitStructure);
HAL_GPIO_Init(GPIOH, &GPIO_InitStructure); 
01 Dec 2015

Good thing, did you find a way to re-enable them after waking up?

11 Jan 2016

Ended up just writing separate functions to power down the GPIO and power them back up. The power down saved the HAL registers for the GPIO banks that were important to me, so when the GPIO power up function executed after waking up from sleep it restored those GPIO registers.

I could not do a blaket save and restore of all the GPIOs since some of my pins needed to remain interruptible wakeup sources.

23 Aug 2016

Kevin, how do you power down the GPIO? could you provide an example?

regards

24 Jun 2017

Hi, is there a method to power down the GPIO ?