2025-05-22 3:03 PM - last edited on 2025-05-23 2:41 AM by Saket_Om
Hi.
I have a board with STM32G0 that I want to wake up from STOP mode via external signals. And so I used 16 interrupts from GPIO and they work correctly. However, I need one more external input for waking up. Specifically, I have a PA15 pin that has an external pull-up, and the signal that is supposed to wake up pulls this pin to GND. PA15 has AF: TIM2_CH1 and TIM2_ETR. I tried to use ETR, but I don't have the option to select the edge and I don't know why CubeIDE sets this pin as push-pull. Generally, I tried several modes/configs and none of them wakes up the processor, or even jumps to the interrupt from TIM2. Can you suggest something? Example? Tutorial? Because when I search for similar threads, I still come across cyclic timer wake-up every x seconds, and I need to wake up the timer the same way as with EXTI. If its impossible, i eventually can change pin and use UART to wake up (if it will work :)), but i think it should be possible using timer. Thanks in advance.
Solved! Go to Solution.
2025-05-23 6:01 AM
Hello @VeryLatte
Why you don't wake up the MCU via EXTI interrupt directly.
You can start with the example below and modify it to wake up from stop mode:
2025-05-22 4:53 PM
> STM32G0 wake up by timer external trigger
TIMx has no wake-up capability from STOP mode, ETR or otherwise.
2025-05-23 12:56 AM
Thanks for the quick response TDK. What is the name of the documentation file you took this table from? So what are the other possibilities of waking this processor from STOP mode by an external signal?
2025-05-23 12:58 AM
OK, i see its just RM0444.
2025-05-23 2:47 AM
Hello @VeryLatte
You can use RTC to wakeup you MCU from STOP mode.
2025-05-23 4:40 AM
Can I wake up via RTC using an external signal on GPIO? How? Remember, I don't want to wake up STM cyclically, but via an external signal, like EXTI. I'm currently thinking about using LPTIM or COMPx.
2025-05-23 6:01 AM
Hello @VeryLatte
Why you don't wake up the MCU via EXTI interrupt directly.
You can start with the example below and modify it to wake up from stop mode:
2025-05-26 12:48 AM
Thanks, it works :) I thought I could only use 16 GPIO EXTI to wake up from STOP mode, that's why I asked about other sources of wake-up, but it turns out that I can use all GPIOs only by enabling the interrupt. Previously, when I tried to wake up using e.g. pins PA2 and PB2, one of them always didn't wake up, that's why I was looking for other sources of wake-up because I used all Px0-Px15.
2025-05-31 4:59 AM
Eh, this solution doesn't work though. I checked it again better and it doesn't work. The actual limit is 16, and no configuration on EVENT/SEVONPEND0/1 will give more than 16. To be clear: I have used 16 GPIOs to wake up the processor, and I need another 1-2 GPIOs to wake it up, so I need 17-18 GPIOs that can wake up the processor from STOP mode. I have applied what has been proposed in practice, but I didn't notice that for the corresponding Pxx pin, wake-up has stopped working (either PA15 or PB15 works, and I need both). That's why I asked about the possibility of waking up via GPIO using Timer/Uart. So I'm going back to square one and asking: how to configure the timer so that it can also wake up the processor via GPIO, e.g. via GATED mode.
2025-05-31 7:45 AM
Diode-or two or more pins into one for wakeup purposes.