AnsweredAssumed Answered

Nucleo-L053R8 wake up from standby

Question asked by Tanomsup.Nathapol on Feb 8, 2017
Latest reply on May 4, 2017 by raphael declercq

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.

Outcomes