Skip to main content
APrud.1
Associate
October 13, 2021
Solved

Which PWR_WAKEUP_PIN was used to wake from STANDBY?

  • October 13, 2021
  • 3 replies
  • 1162 views

Hello,

I'm working with the STM32L031K6T and I'm going to standby without RTC and waking up the MCU with the A0 or A2 without problems, but for the application I need to know which PWR_WAKEUP_PIN was used to wake it up.

 

Its possible to get a flag after standby mode? 

 

The signal used to wake up the MCU will remain a lot or time, so I can read it before the waking up, so maybe changing the configuration of the pins to normal GPIO?

 

No idea how to solve it and I'm new in this kind of applications.

This topic has been closed for replies.
Best answer by TDK

Read the status of the pins at startup using HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_x). No need to reconfigure anything.

3 replies

MM..1
Chief III
October 13, 2021

Waking signal is so short?, that you cant detect it after main start?

APrud.1
APrud.1Author
Associate
October 13, 2021

The waiking signal will be very long, around 10 seconds, but I can't find the way to read it. I know the MCU goes to standby and wakes without problem, but I can't find the command to read which pin was activated.

MM..1
Chief III
October 13, 2021

You only simple GPIO input read A0 an A2 use if startup flag is WU

APrud.1
APrud.1Author
Associate
October 13, 2021

Great, I was expecting something complex because I thought I can't use that pins as normal GPIOs, but now it works. Thank you very much

TDK
TDKBest answer
October 13, 2021

Read the status of the pins at startup using HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_x). No need to reconfigure anything.

"If you feel a post has answered your question, please click ""Accept as Solution""."
APrud.1
APrud.1Author
Associate
October 13, 2021

Works perfect, thank you vey much