Skip to main content
Graduate II
July 10, 2025
Solved

WKUP pin - which edge (rising/falling) and can it still be monitored when MCU is running ?

  • July 10, 2025
  • 4 replies
  • 495 views

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

freeflyer_0-1752134951858.png

freeflyer_1-1752135031976.png

 

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.

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

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

    https://community.st.com/t5/stm32-mcus-boards-and-hardware/nucleo-l433rc-p-wake-up-from-shutdown-wakes-even-though-the/m-p/822722

    4 replies

    Super User
    July 10, 2025

    @freeflyer wrote:

    Does it matter which edge I used (rising or falling) ?


    See the Datasheet; eg,

    AndrewNeil_1-1752140790148.png

     


    @freeflyer wrote:

    once the MCU is awake and running, am I still able to read this pin as a digital input ?


    Yes.

    freeflyerAuthor
    Graduate II
    July 10, 2025

    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

    freeflyerAuthor
    Graduate II
    July 15, 2025

    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 ?

    Graduate II
    July 15, 2025

    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.

    Super User
    July 16, 2025

    @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();

     

    freeflyerAuthorAnswer
    Graduate II
    July 16, 2025

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

    https://community.st.com/t5/stm32-mcus-boards-and-hardware/nucleo-l433rc-p-wake-up-from-shutdown-wakes-even-though-the/m-p/822722