Skip to main content
Explorer
March 16, 2025
Solved

Difference for stop modes

  • March 16, 2025
  • 1 reply
  • 816 views

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.
    Best answer by STTwo-32

    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

    1 reply

    Technical Moderator
    March 16, 2025

    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

    Explorer
    March 17, 2025

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

     

    STTwo-32Answer
    Technical Moderator
    March 17, 2025

    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