cancel
Showing results for 
Search instead for 
Did you mean: 

Need help getting EXTI0 Wakeup interrupt (on STM32F042)

Jim Seymour
Senior
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.

1 ACCEPTED SOLUTION

Accepted Solutions
Jim Seymour
Senior
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.

View solution in original post

2 REPLIES 2
Jim Seymour
Senior
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
Senior
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.