cancel
Showing results for 
Search instead for 
Did you mean: 

STOP2 mode, voltage regulator, stm32cube

mh_stm
Associate II
Posted on June 28, 2018 at 13:29

Hi all,

I'm trying low power modes of the STM32. I've noticed that HAL_PWREx_EnterSTOP2Mode synopsis mention that:

  *        The voltage regulator is set in low-power mode but LPR bit must be cleared to enter stop 2 mode.

  *        Otherwise, Stop 1 mode is entered.  

however

/STM32Cube_FW_L4_V1.11.0/Projects/NUCLEO-L476RG/Examples/PWR/PWR_STOP2_RTC/Src/

does not include such thing. and AN4621 indicates that LowPowerRun mode doesn't get involved when switching between Run mode and Stop2 modes.

Therefore I see contradiction.  Could any one clarify please ?

Thanks,

2 REPLIES 2
Szymon PANECKI
Senior III
Posted on June 28, 2018 at 14:47

Hello Mohamed,

LPR is a name of a bit in PWR_CR1 register. You can find its description in MCU's reference manual. I attach extracted content below:

0690X0000060LVHQA2.png

As you can see this bit allows MCU to enter Low-power RUN mode. There is also confirmation that this bit needs to be cleared before entering STOP mode in order to achieve STOP2 instead of STOP1.

The outcome of this description is a message, that STM32L4 MCU can't make a switch from Low-power RUN to STOP2 directly. If application uses Low-power RUN, then it is mandatory to make a switch from Low-power RUN to RUN and then from RUN to STOP2. Please find below a simple diagram, which shows possible transistions in terms of operating modes.

0690X0000060LVRQA2.png

Now regarding the code: this is correct that HAL_PWREx_EnterSTOP2Mode function doesn't clear LPR bit. So this action has to be done by other function, which is HAL_PWREx_DisableLowPowerRunMode. But please note: this function needs to be called before HAL_PWREx_EnterSTOP2Mode

only

when MCU is using low-power RUN mode. Otherwise, if normal RUN mode is used, LPR bit is set to 0 and there is no need to take care about this bit.

I hope this information properly answers your question.

Regards

Szymon
mh_stm
Associate II

Hello Szymon,

Thank you for you support. This is a useful information.

Regards,