2022-02-04 12:13 PM
I went through the examples on the ST site which have the direct implementations (not using CubeIDE generated code HAL for GPIO, SystemClock, ... config implementation)
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?