cancel
Showing results for 
Search instead for 
Did you mean: 

WKUP/PA0 as GPIO until suspend

TheChipGuy
Associate

Hey everyone, I've been playing around with my NUCLEO-F429ZI and love it. I have a quick question though which isn't really clear in the datasheet. Is it possible to configure the WKUP as a normal GPIO input when the device is awake, and then only configure it to be WKUP mode right before putting the device to suspend? Then it could be configured back as a normal GPIO on resume. It seems that the APIs support this but want to confirm before proceeding.

Thanks!

1 REPLY 1
Rob.Riggs
Senior

This is certainly possible, and even necessary I think. You want to configure the wakeup pins immediately before entering standby/shutdown. And on wakeup, the system does a power on reset, requiring everything, including GPIOs, to be reconfigured as during any other reset event.

I use one button for power control (power on/power off) on one of my projects. While powered on, it is configured as EXTI. The interrupt fires when the button is pressed and the device is configured for shutdown, the same pin is configured for WKUP via a call to HAL_PWR_EnableWakeUpPin() and then HAL_PWREx_EnterSHUTDOWNMode() is called.

I'm pretty sure there is example code that shows how to do this for at least one of the discovery boards.