cancel
Showing results for 
Search instead for 
Did you mean: 

Resuming STOP Mode in STM32L152

Iman Hosseinzadeh
Associate III

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

0 REPLIES 0