Skip to main content
Associate III
Mar 16, 2025 8:48 AM UTC
Solved

Difference for stop modes

Hello ,

I have used the below to go into stop mode:

  HAL_PWR_EnterSTOPMode( PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI ); /* CPU will be halted here until a wakeup event occurs */
 
in  the above function, what is the difference

PWR_SLEEPENTRY_WFI  & PWR_STOPENTRY_WFI as parameter?

 

 

This topic has been closed for replies.
STTwo-32
STTwo-32Best answer
ST Technical Moderator
Mar 17, 2025 11:43 AM UTC

Since the two macros have the same values: 

STTwo32_0-1742211668197.png

using PWR_SLEEPENTRY_WFI with HAL_PWR_EnterSTOPMode() will not be a problem (the function will work as expected with PWR_STOPENTRY_WFI).

Best Regards. 

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

3 replies

STTwo-32
ST Technical Moderator
Mar 16, 2025 9:15 AM UTC

Hello @prudhvichitturi 

PWR_STOPENTRY_WFI is used as a parameter of the HAL_PWR_EnterSTOPMode() function to enter STOP mode with WFI instruction. But the PWR_SLEEPENTRY_WFI should be used as a parameter for the HAL_PWR_EnterSLEEPMode() function to enter SLEEP mode with WFI instruction. More details are provided on the pages 384 and 385 of the UM1749 Rev7.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Associate III
Mar 17, 2025 9:51 AM UTC

PWR_SLEEPENTRY_WFI  was used HAL_PWR_EnterSTOPMode() , what are the effects when used?

 

STTwo-32
STTwo-32Best answer
ST Technical Moderator
Mar 17, 2025 11:43 AM UTC

Since the two macros have the same values: 

STTwo32_0-1742211668197.png

using PWR_SLEEPENTRY_WFI with HAL_PWR_EnterSTOPMode() will not be a problem (the function will work as expected with PWR_STOPENTRY_WFI).

Best Regards. 

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.