7 years, 10 months ago.

STM32L073RZ Low Power Sleep Mode

Hello. I have a NUCLEO-L073RZ development board which I am trying to run in low power (sleep mode) for a set period when it has finished its tasks. I will also have a manual switch connected to one of the GPIO pins to interrupt the sleep mode and run as normal. I know the stm32lo73 has 7 low power modes and I want to use the low power sleep mode and the data sheet page 17 shows the functionalities depending on the working mode but does not describe or show examples of how to activate or deactivate any of those. The problem I am having is that most of the examples I am finding are all different and inconsistent which is very confusing. Some examples use sleep() or deepsleep() and some use _WFI and some use the sleep manager sleep_manager_lock_deep_sleep() etc. some use something like HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI). Some examples also include clocks and initialising.

As a beginner, the problem I am having is not knowing which approach is the correct one and I would really appreciate if someone could please show me maybe with an example code/function to achieve this low power sleep mode and how I can wake up from sleep mode. I know that most people might not be willing to do this, but if not an example code then maybe to point me in the right direction or show me where I can find the correct example because I have looked everywhere and each time I get even more confused. Another thing is that, if in the future I require the other lower power modes like the stop mode, It would also help to know how I can enter the other low power modes like the ones that require disabling clocks (PLL, MSI RC, HSI and LSI RC, HSE and LSE crystal oscillators) I do not know how to do this.

Be the first to answer this question.