Skip to main content
Hank Lee
Associate
February 12, 2018
Question

STM32F469I-DISCO standby mode RTC wake up immediately issue.

  • February 12, 2018
  • 8 replies
  • 2367 views
Posted on February 12, 2018 at 07:12

I used STM32F469I-DISCO and STM32F429I-DISCO to testing Standby mode function by PWR example(Attach). Standby mode function is no problem on

STM32F429I-DISCO.  But in STM32F469I-DISCO , used RTC wake up form standby mode , first time is normal , but second time to into standby mode will wake up immediately. How can I fix it , thanks.

ps,  I already clear flag as below.

/*## Clear all related wakeup flags ########################################*/

/* Clear PWR wake up Flag */

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

/* Clear RTC Wake Up timer Flag */

__HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&RTCHandle, RTC_FLAG_WUTF);
    This topic has been closed for replies.

    8 replies

    Nesrine M_O
    Associate
    February 12, 2018
    Posted on February 12, 2018 at 09:37

    Hi

    hanklee107@yahoo.com.tw

    ‌,

    Have you try to start from standby example under the STM32CUBEF4 firmware package?

    STM32Cube_FW_F4_V1.0\Projects\STM32469I-Discovery\Examples\PWR\PWR_STANDBY

    -Nesrine-

    Hank Lee
    Hank LeeAuthor
    Associate
    February 13, 2018
    Posted on February 13, 2018 at 03:23

    Hi Nesrine M,

    I had try to test standby example and result is normal.  But this standby example wake up from user button. I already try user button wake up is normal , but RTC wake up have problem.

    Thanks.

    Hank Lee,

    Hank Lee
    Hank LeeAuthor
    Associate
    February 21, 2018
    Posted on February 21, 2018 at 09:34

    I found if RTC wake up timer flag (WUTF) set 1 once time , then next time run into standby mode will wake up immediately even clear WUTF first. But system reset (HAL_NVIC_SystemReset()) can fix it. 

    Anybody have suggestion?  

    Thanks,

    Hank Lee

    pawel.poplawski
    Associate II
    January 15, 2019

    Hi Hank I have the same problem with STM32L476. After power on the first wake up is fine, but each subsequent fails. After programming the uC, even the first will fail. Maybe you have solved the problem? Probably one more flag has not been reset. Someone has an idea how to solve it?

    pawel.poplawski
    Associate II
    January 15, 2019

    Even after RTC deinit which clears the registers and init RTC one more time the problem is the same.

    duongtomho
    Associate
    May 8, 2019

    I have the same problem.

    I tried to deint RTC and init RTC one more time and the problem is the same.

    Does anyone have slove this problem??? Please help

    Ludwig Horsthemke
    Associate
    March 28, 2020

    For reference if someone has the same problem:

    Using an STM32L071 I had to reset 3 flags after wakeup from standby (as pawel.poplawski already suspected).

    These are RTC Internal Wake up flag, PWR Standby flag and additionaly PWR wakeup flag.

    So the code using LL looks like this:

     if (LL_PWR_IsActiveFlag_SB() != 1)
     {
     /* ##### Run after normal reset ##### */
     } 
     else
     {
     /* ##### Run after standby mode ##### */
     
     /* Clear Standby flag */
     LL_PWR_ClearFlag_SB();
     /* Clear wakeup flag */
     LL_PWR_ClearFlag_WU(); 
     /* Reset RTC Internal Wake up flag */
     LL_RTC_ClearFlag_WUT(RTC); 
     }

    Best regards

    Tom MacDonald
    Associate III
    August 19, 2021

    For me working on STM32G030F6 I had similar problem, and simply calling

    LL_PWR_ClearFlag_WU(); //Need to clear the wakeup flags or else MCU immediately wakes up from standby!
    HAL_PWR_EnterSTANDBYMode();	//Enter standby mode (see you next runtime!

    made things work for me. Seems the only thing causing standby to fail in my case was the wakeup flags in the PWR_SCR register