Skip to main content
Iman Hosseinzadeh
Associate III
September 3, 2018
Question

Resuming STOP Mode in STM32L152

  • September 3, 2018
  • 0 replies
  • 418 views

Hi All,

I've implemented STOP mode with the following code: (Taken from https://www.digikey.com/eewiki/display/microcontroller/Low-Power+Modes+on+the+STM32L0+Series)

void EnterSTOP(void)
{ 
PWR->CR |= PWR_CR_CWUF; // clear the WUF flag after 2 clock cycles
PWR->CR &= ~( PWR_CR_PDDS ); // Enter stop mode when the CPU enters deepsleep
//No Fast Wakeup , ULP mode, Low power Regulator
PWR->CR |= PWR_CR_FWU | PWR_CR_ULP | PWR_CR_LPSDSR;
 SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; // low-power mode = stop mode
 __WFI(); // enter low-power mode
};

Is the execution line after exiting STOP mode just after the EnterSTOP() function?

As I understood, there is no need to initialize the peripherals after exiting this mode (in contrary to Standby).

And is it possible to detect the EXT line which triggered the wakeup?

Thanks in advance

This topic has been closed for replies.