Skip to main content
Visitor II
February 4, 2022
Question

What is the difference in the implementation of Low power Sleep vs Sleep in STM32L053 using cubeIDE and HAL.

  • February 4, 2022
  • 0 replies
  • 636 views

0693W00000JOdvUQAT.pngI went through the examples on the ST site which have the direct implementations (not using CubeIDE generated code HAL for GPIO, SystemClock, ... config implementation)

  1. https://github.com/STMicroelectronics/STM32CubeL0/blob/master/Projects/NUCLEO-L053R8/Examples/PWR/PWR_SLEEP/Src/main.c
  2. https://github.com/STMicroelectronics/STM32CubeL0/blob/master/Projects/NUCLEO-L053R8/Examples/PWR/PWR_LPSLEEP/Src/main.c

The only difference is that low power sleep requires to disable the prefetch buffer initially

__HAL_FLASH_PREFETCH_BUFFER_DISABLE(); /* Disable Prefetch Buffer */

and then before going into sleep mode, enable the powerdown during sleep

__HAL_FLASH_SLEEP_POWERDOWN_ENABLE();/* Enable the power down mode during Sleep mode */

are these the only differences? Do I need to disable the __HAL_FLASH_SLEEP_POWERDOWN after i wake the mcu up (there is no function for it and the definition of __HAL_FLASH_SLEEP_POWERDOWN_ENABLE seems sleep mode specific so it seems unlikely that I need to manually disable it)

Are the power consumption differences significant enough if I'm using a UART that's always listening?

    This topic has been closed for replies.