2017-01-26 07:47 PM
Hello, I got stuck in a power mode on Nucleo-L053R8 for a week. My desire is going to make this board consume an energy lowest as possible when it is on standby mode. I used this code
/*Disable clock to unused peripheral*/
__GPIOC_CLK_DISABLE();
__GPIOH_CLK_DISABLE();
__GPIOA_CLK_DISABLE();
__GPIOB_CLK_DISABLE();
__GPIOD_CLK_DISABLE();
__SYSCFG_CLK_DISABLE();
__PWR_CLK_DISABLE();
SysTick->CTRL=0x00;
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2); __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnterSTANDBYMode();
I got 18 uA on my ammeter but reference manual claims only 0.27 uA so what else do I need to turn off to get lowest power consumption as possible.
#stm32l0-nucleoSolved! Go to Solution.
2017-01-27 06:01 AM
Hello everyone,
Please refer to the ''PWR_STANDBY'' example provided when downloading the
package:STM32Cube_FW_L0_V1.8.0\Projects\STM32L053R8-Nucleo\Examples\PWR\PWR_STANDBYThe Idd=0.29µA; which is with the same as the value on the datasheet.
Khouloud
2017-01-26 11:50 PM
Hello
Tanomsup.Nathapol
,Try to configure the unused I/O pins in analog mode before entering the low power mode.
I'm giving GPIOA as an example, but try this with all unused pins:GPIO_InitTypeDef gpio_init_structure;
__HAL_RCC_GPIOA_CLK_ENABLE(); gpio_init_structure.Mode = GPIO_MODE_ANALOG; gpio_init_structure.Pull = GPIO_NOPULL; gpio_init_structure.Speed = GPIO_SPEED_LOW; gpio_init_structure.Pin = GPIO_PIN_All; HAL_GPIO_Init(GPIOA, &gpio_init_structure); __HAL_RCC_GPIOA_CLK_DISABLE(); Hope this help.Khouloud.
2017-01-27 12:38 AM
Hello,
Check also that you don't enable debug in StandByMode. bit 2 of DBG_CR should be 0.
Olivier
2017-01-27 01:36 AM
Thanks for helping. If I need to wake STM32L0 with PC13. I should not disable that PC13 pins right? What about '
__HAL_RCC_GPIOC_CLK_DISABLE();
' can I turn off it? (in case of use PC13 to wakeup)2017-01-27 01:41 AM
Hi ,
For sure. The clock of the GPIO port should be enabled.Otherwise, you can not use the pin.
Khouloud.
2017-01-27 01:55 AM
Thanks ,
Khouloud. I am very appreciated. This save my day.
2017-01-27 02:03 AM
Thanks, Olivier.
Could you explain why DBGMCU_CR_DBG_STANDBY should be 0 ?
2017-01-27 02:04 AM
You are always welcome
Khouloud
2017-01-27 02:15 AM
Hi,
I think you should decrease the clock frequency (use
mailto:MSI@65KHz)
in order to decrease power consumption from your wakeup port. The power consumption is in uA/MHz...BTW: I am also working on STM32L0 to acheive very low power. At the moment I have 20uA, and LSI/Watchdog on/all ports power on. The current is meassured during 'WFI'...
BR Martin
2017-01-27 02:20 AM
In case you enable it this will let some system clocks active in order to allow debugger connection remain alive.
Thus the consumption will be higher. Hope it clarify
Thanks to let me know if it was the case, or if it was just the GPIO state which explain over consumption.
BR,
Olivier