cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-L053R8 wake up from standby

Nathapol Tanomsup
Associate II
Posted on February 08, 2017 at 05:10

Hello, I have a question about Standby mode when it wakes up from standby with interrupt or anything which command will

executed

for the example

/**** Start ****/
/* Check and handle if the system was resumed from Standby mode */
 if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET) { /* Clear Standby flag */ __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
}
HAL_GPIO_Write(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
HAL_Delay(500);
HAL_GPIO_Write(GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);
 /*Disable all used wakeup sources: Pin1(PA.0)*/
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
/*Clear all related wakeup flags*/
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
/*Re-enable all used wakeup sources: Pin1(PA.0)*/
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
/*Enter the Standby mode*/
HAL_PWR_EnterSTANDBYMode();

HAL_GPIO_Write(GPIOA, GPIO_PIN_6, GPIO_PIN_SET);
HAL_Delay(500);
HAL_GPIO_Write(GPIOA, GPIO_PIN_6, GPIO_PIN_RESET);�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

while(1) {
}
/**** End ****/�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

Which PA5 or PA6 will be executed first after wake up.

7 REPLIES 7
Max
ST Employee
Posted on February 08, 2017 at 10:40

Hello,

After standby, the processor will start executing your program from the beginning, like after a reset.

So in your case PA5 will toggle first.

I recommend reading page 162 of

http://www.st.com/content/ccc/resource/technical/document/reference_manual/2f/b9/c6/34/28/29/42/d2/DM00095744.pdf/files/DM00095744.pdf/jcr:content/translations/en.DM00095744.pdf

.

Best regards,

Max

raphael declercq
Associate II
Posted on May 04, 2017 at 13:05

Hi,

Is there a way to make the processor continue the program after a wakeup from standby, just like after a wakeup from STOP mode? 

Best,

Raphael 
Posted on May 04, 2017 at 13:42

No, it just resets, as all power to the core is removed.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on May 04, 2017 at 13:50

Thanks so if I want my RTC tu run continuously after wakeup, i have to use stop instead of standby?

Posted on May 04, 2017 at 13:55

RTC is not part of core, so it's not reset unless power is removed.

JW

Posted on May 04, 2017 at 14:24

the problem is that when my board restarts, it executes the auto-generated MX_RTC_Init() function, which restart the RTC

:(

Posted on May 04, 2017 at 14:28

At some point you need to stop being reliant on robot tools to do the work, and understand how the part works, and code your own solution.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..