STM32L476 wake up source detection
- February 6, 2023
- 4 replies
- 2959 views
Set Blue button(wake up 2) as wake up source and shut down. Press blue button will wake up system and print wake up source.
With cube debugging environment, everything is fine. It shows wake up source is 2
But after stop cube debugging, disconnect JP6 on board, and connect JP6 again. Repeat this test, the wake up source is always 0. This is a problem.
Can somebody repeat my test and help me to figure it out please?
Thank you. Attached is main.c and ioc file
STM32CubeIDE1.11.2
nucleo-l476rg board
Demo code in main.c
printf("--L476 blue button wake up test. wake up source: %ld\r\n", __HAL_PWR_GET_FLAG(PWR_FLAG_WUF2));
HAL_Delay(3000);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_LOW);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF2);
printf(" shut down.\r\n");
HAL_PWREx_EnterSHUTDOWNMode();
