cancel
Showing results for 
Search instead for 
Did you mean: 

How does the device wake up from stop mode using GPIO EXTI- STM32L053

Jagadish
Associate II

I am using an STM32L053. I am trying to enter STOP mode by calling the HAL function- HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);.

I was also able to implement the stop mode specified in the Example code provided by ST. My aim is to wake up on a GPIO interrupt. As per my understanding the core clock is disabled when the device enters stop mode. 

So how does it detect the GPIO interrupt and wake up the device? 

What drives the GPIO clock? 

Can I disable all the other GPIOs and only keep the GPIO port that I have set up to trigger an interrupt to wake up the device?

2 REPLIES 2
S.Ma
Principal

If there is a clock stop mode, external signals triggering an unclocked logic would restart the oscillator (general idea here). The ref man about clock stop mode should tell all the peripherals which can "wakeup" the MCU. The other GPIOs will be clock frozen (probably no need to tune them).

Jagadish
Associate II

Thank you for the response. I have a couple of more questions if you can throw some light.

I know that the states of GPIOs are retained as is in the run mode. In case a regular push pull GPIO was set high before entering sleep, will that effect the current consumption?

Also, should I be disabling/deinitialize the peripherals in use (such as UART, ADC, timers. etc) before entering stop mode? Would that save me more current?

I am trying to understand if there is any extra settings that has to be performed before entering stop mode other than just calling the HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI)