2025-07-10 1:19 AM - last edited on 2025-07-10 2:49 AM by Andrew Neil
Follow-on from STM32L433RCT6 - Which external interrupt GPIO pin can I used for wakeup ?
I am using the STM32L433RCT6 with a WKUP pin (GPIO PC13) to wake the MCU from shutdown mode.
Does it matter which edge I used (rising or falling) ?
I am currently using a switch to ground (i.e. falling edge)...
Also, once the MCU is awake and running, am I still able to read this pin as a digital input ?
Because the switch will also be used to put the MCU back into standby, so I need to be able to monitor the state of the WJUP pin.
Solved! Go to Solution.
2025-07-16 12:23 PM
Fixed by TDKs suggestion in this post...
"Probably should put the delay before you clear the flag. If not debounced, the flag is certainly getting set immediately after you clear it and/or when button is released."
2025-07-10 2:47 AM
@freeflyer wrote:Does it matter which edge I used (rising or falling) ?
See the Datasheet; eg,
@freeflyer wrote:once the MCU is awake and running, am I still able to read this pin as a digital input ?
Yes.
2025-07-10 2:53 AM
Thanks Andrew, I did see that the edge is configurable.
I was just wondering if there is an advantage to using one edge compared to another, such as power consumption etc
2025-07-15 8:00 AM
How do I read the WKUP pin (GPIO PC13) when the MCU is running ?
It does not work If I read the pin using HAL_GPIO_ReadPin....
status = HAL_GPIO_ReadPin(GPIOC, PWR_SWITCH_Pin);
Do I have to change the pin to a GPIO_input to read the pin and then change it back to SYS_WKUP2 before shutting down ?
2025-07-15 4:50 PM - edited 2025-07-15 4:52 PM
Just configure PC13 as EXTI instead of SYS_WKUP. It should still wake up from Standby mode.
I'm not 100% sure it'll work as I don't have an L433 on hand to test. However, I've tested with an STM32G071RB and it does wake up using EXTI.
Also, setting for EXTI only works for pins that do have SYS_WKUP pins and not just any pin with EXTI.
2025-07-16 1:38 AM
@Karl Yamashita wrote:Just configure PC13 as EXTI instead of SYS_WKUP. It should still wake up from Standby mode.
Yes - that's the way I do it on STM32F0:
The pin is configured as EXTI in the .ioc for "normal" operation.
The WKUP function is enabled immediately before going into STANDBY
/* 3: Enable WKUP pin */
HAL_PWR_EnableWakeUpPin( Sw_WKUP );
/* 4: Request to enter STANDBY mode */
HAL_PWR_EnterSTANDBYMode();
2025-07-16 5:13 AM
I need wake-up from shutdown, not standby.
I was told that only WKUP pins are able to wake the MCU from shutdown
See here…
2025-07-16 9:11 AM
Well I've tested Standby because I saw the datasheet posted and it showed Standby.
But yes, it'll still wake up from Shutdown. I have an NUCLEO-L432KC at home and tested it just now.
void Shutdown(void)
{
HAL_SuspendTick();
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF4);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN4_LOW);
HAL_PWREx_EnterSHUTDOWNMode();
SystemClock_Config();
HAL_ResumeTick();
}
2025-07-16 12:23 PM
Fixed by TDKs suggestion in this post...
"Probably should put the delay before you clear the flag. If not debounced, the flag is certainly getting set immediately after you clear it and/or when button is released."