Showing results for 
Search instead for 
Did you mean: 

STM32F070 Standby Mode (Not waking up...)

andreas kellermann
Associate II

I wanted to test the wakup pin on the stm32f070f6.

I have set pin PA0 to SYS_WAKUP1 and gave it the user name "WAKE".

Before the user while loop I call:



To enable wakeup (I thought) and put the device into standby.

The device goes into standby, but does not wake when I apply 3.3V to PA0 (?)

Are there more settings/setup? Is there more documentation then just the HAL manual?

Thank you in advance!

Senior III

Nice. I wrote some stuff, and suddenly the page got refreshed or something, and all I wrote was gone...

So again. See

Chapter 6.3

Also clear the wakeup-related flags in the PWR .

I also recall that if WKUP-pin is high during setup, no rising edge is detected, and the device won't wake up.

andreas kellermann
Associate II

Interesting. I found the:  __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU) function to clear the Wakup flag.

I also added a pull down resistor on PA0. Now it should start up low.

Relevant code now looks like this:

 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); //clear wakup flag

 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); //clear standby flag





However, no change...

I also had a look at the HAL function to enter standby mode:

void HAL_PWR_EnterSTANDBYMode(void)


 /* Select STANDBY mode */

 PWR->CR |= (uint32_t)PWR_CR_PDDS;

 /* Set SLEEPDEEP bit of Cortex System Control Register */


 /* This option is used to ensure that store operations are completed */

#if defined ( __CC_ARM)



 /* Request Wait For Interrupt */



Looks pretty much as described in chapter 6.3 table 19.

Senior III

You know that it doesn't wake up? I mean, maybe it hangs somewhere during boot?

I once had waleup problems with L4 device when there was an oscillator shared with another chip. - the oscillator was reluctant to start,

but I don't think this case is similar. Even then it woke up, but getting from RC to xtal hung up.

Usually waking up is easy, but getting the darn thing to sleep may get complicated. 😉

If you try to debug, you need to set DBG_STANDBY-bit in DBGMCU_CR-register.

andreas kellermann
Associate II

Well if I disable the standby function by commenting out


The program runs normally. So it looks to me as if it enters standby and never wakes up.

Senior III

That commenting doesn't really prove anything. Remember that stand-by "almost-resets" l the HW - including HSE - and RAM.

Maybe the HW is left in some state that wake-up doesn't handle well.

My problem back then was, that HSE-ready-flag got never set.

Chief II

The particular issue of the original topic is most likely the issue 1 in my article.