cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I'm working with the STM32L031K6T and I'm going to stanby 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.

APrud.1
Associate II

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 configurtaion of the pins to normal GPIO?

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

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

6 REPLIES 6
MM..1
Chief II

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

APrud.1
Associate II

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.

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

TDK
Guru

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".

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

Works perfect, thank you vey much