Skip to main content
Jim Seymour
Senior
May 31, 2018
Solved

Need help getting EXTI0 Wakeup interrupt (on STM32F042)

  • May 31, 2018
  • 2 replies
  • 691 views
Posted on May 31, 2018 at 19:43

I'm using CubeMX and don't see a way to enable the EXTI0 IRQ.  I'm assuming I need to have that interrupt enabled in order to use the PA0 pin as a wakeup pin.

I've set that pin to SYS_WKUP1 in the pin configuration.  What else do I need to do?

Thanks.

    This topic has been closed for replies.
    Best answer by Jim Seymour
    Posted on June 01, 2018 at 00:30

    OK.  Nevermind.  I got it working - thanks to this page: 

    https://www.waveshare.com/wiki/STM32CubeMX_Tutorial_Series:_EXTI

     

    It turns out I needed to set the pin in CubeMX to 'GPIO_EXTI0' - not 'SYS_WKUP1'.  Once I did that, the IRQ magically appeared and now my code successfully sleeps and wakes up.

    2 replies

    Jim Seymour
    Senior
    May 31, 2018
    Posted on June 01, 2018 at 00:04

    I guess my real question is: How do I enable PA0 to be SYS_WKUP1?  And what code do I have to include in my app?  I could find no examples.

    Thanks.

    Jim Seymour
    Jim SeymourAuthorBest answer
    Senior
    May 31, 2018
    Posted on June 01, 2018 at 00:30

    OK.  Nevermind.  I got it working - thanks to this page: 

    https://www.waveshare.com/wiki/STM32CubeMX_Tutorial_Series:_EXTI

     

    It turns out I needed to set the pin in CubeMX to 'GPIO_EXTI0' - not 'SYS_WKUP1'.  Once I did that, the IRQ magically appeared and now my code successfully sleeps and wakes up.