Skip to main content
Explorer II
May 22, 2025
Solved

STM32G0 wake up by timer external trigger

  • May 22, 2025
  • 2 replies
  • 1050 views

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.

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

    Hello @VeryLatte 

    Why you don't wake up the MCU via EXTI interrupt directly. 

    Saket_Om_0-1748005167320.png

    You can start with the example below and modify it to wake up from stop mode:

    STM32CubeG0/Projects/NUCLEO-G0B1RE/Examples/PWR/PWR_SLEEP/Src/main.c at master · STMicroelectronics/STM32CubeG0 · GitHub

     

    2 replies

    Super User
    May 22, 2025

    > STM32G0 wake up by timer external trigger

    TIMx has no wake-up capability from STOP mode, ETR or otherwise.

    TDK_0-1747957980672.png

     

    VeryLatteAuthor
    Explorer II
    May 23, 2025


    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?

     

    VeryLatteAuthor
    Explorer II
    May 23, 2025

    OK, i see its just RM0444. 

    VeryLatteAuthor
    Explorer II
    May 31, 2025

    The diode solution is the last resort because it requires me to modify the hardware and I need to have +1 GPIO pin, and I don't have them anymore. Besides, I clearly write once again that I want to wake up via TIM/UART/I2C and not EXTI. The RM says that it is possible to wake up via e.g. LPTIM and I want to do it. I don't understand why we avoid this solution since according to RM it is possible. I would like an example if there are any. For a few hours I have been trying to start waking up LPTIM1 from the ETR pin and the bit in the ISR register is setting, but it does not enter the interrupt at all. Since such a function is declared in RM, I would like an example.