cancel
Showing results for 
Search instead for 
Did you mean: 

Sleep mode, GPIOs and RCC_AHB2LPENR - STM32H5, EXTI wakeup sources

Imre
Associate II

Hello

What will happen with the IOs when MCU is put to Sleep mode (one of power modes in PWR) and register bits in RCC_AHB2LPENR for each GPIO-block are reset? When bits are reset, the peripheral clock is disabled during Sleep mode.

Can the IOs still be used to trigger interrupts in Sleep mode with the EXTI controller?

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Imre

Sorry for the misunderstanding! 

>>will the interrupt triggering with EXTI still work when IOs are configured to trigger on rising/falling edge?

YES, the EXTI mux that provides the IO port selection will remain active even with clocking down the GPIO port.

I've tested this with a minimal code, entering sleep mode and waking up with PC13, but before entering sleep mode, I added this mask to disable the GPIOC port: 

 

RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_GPIOCLPEN);

 

The interrupt triggering with EXTI still works! 

I'm curious about how you plan to use EXTI interrupts with disabled GPIO clocks in your project, could you elaborate on your application's context and the reasons for this specific setup?

 

Thank you! 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Sarra.S
ST Employee

Hello @Imre

In Stop mode, all I/O pins keep their configuration, this means that even if the peripheral clocks are disabled during sleep mode by resetting the register bits in RCC_AHB2LPENR for each GPIO block, the I/O states are not affected  and will remain in their last configured state

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

With all respect, you did not answer the question related to sleep mode. You mentioned stop mode which is another mode. There are sleep, stop and standby modes.

Let me rephrase my question:
In sleep mode and when GPIO peripheral clocks are disabled by resetting corresponding bits in RCC_AHB2LPENR, will the interrupt triggering with EXTI still work when IOs are configured to trigger on rising/falling edge?

Hello @Imre

Sorry for the misunderstanding! 

>>will the interrupt triggering with EXTI still work when IOs are configured to trigger on rising/falling edge?

YES, the EXTI mux that provides the IO port selection will remain active even with clocking down the GPIO port.

I've tested this with a minimal code, entering sleep mode and waking up with PC13, but before entering sleep mode, I added this mask to disable the GPIOC port: 

 

RCC->AHB2LPENR &= ~(RCC_AHB2LPENR_GPIOCLPEN);

 

The interrupt triggering with EXTI still works! 

I'm curious about how you plan to use EXTI interrupts with disabled GPIO clocks in your project, could you elaborate on your application's context and the reasons for this specific setup?

 

Thank you! 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Yes, the application should disable everything that is not needed in the sake of saving power. When EXTI detects activity, the application can reconfigure itself to handle the activity.