2025-07-28 3:46 AM - last edited on 2025-07-28 4:28 AM by Andrew Neil
Hi ST Community,
I am currently trying to evaluate if I can use EXTI GPIO IRQ handlers (function executed at USER BUTTON press) in combination with the STOP3 sleep mode.
Firstly, I would like to request, if this is supported by the u5 CPU. Based on the reference manual, only a WKUP interrupt can wake up the CPU from STOP3 mode. So is the following scenario realizable?
1) CPU configures EXTI GPIO (USER BUTTON) with IRQ handler/function
2) CPU goes into STOP3
3) User presses USER BUTTON
4) CPU leaks STOP3 (WKUP interrupt)
5) CPU executes EXIT GPIO IRQ after wake up
6) CPU goes pack to STOP3 and waits for next wake up
7) <infinite loop from 2.>
Or are the WKUP and EXTI GPIO interrupts exclusive? (only one can occur).
---
Unfortunately, it seems that this sample is not covered by the cube IDE samples.
Or have I overlooked one?
So I have looked at the sample GPIO_EXTI sample (https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/NUCLEO-U575ZI-Q/Examples/GPIO/GPIO_EXTI). But this sample does not use the stop3 mode.
So I would like to ask, if somebody can provide me a read to use sample or may help me to understand, if I can enable stop3 via Cube MX application.
Thanks in advise.
Best regards,
Andreas
2025-07-28 4:35 AM - edited 2025-07-28 4:41 AM
@akarner wrote:So I would like to ask, if somebody can provide me a read to use sample or may help me to understand, if I can enable stop3 via Cube MX application.
Try these:
https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/NUCLEO-U575ZI-Q/Examples/PWR
PS:
See also AN5701, Introduction to STM32Cube MCU Package examples for STM32U5 MCUs.
via: https://www.st.com/en/embedded-software/stm32cubeu5.html#documentation
via: https://www.st.com/en/microcontrollers-microprocessors/stm32u575zi.html#tools-software
Also take a look at the Application Notes listed under 'Documentation' on the STM32U575ZI Product Page:
https://www.st.com/en/microcontrollers-microprocessors/stm32u575zi.html#documentation
2025-07-30 4:53 AM
Hi,
thank you very much for your feedback. I looked at these samples, but unfortunately, these do not cover what I am searching for.
Samples:
So I used the PWR_SLEEP sample and changed the code to STOP3 instead of SLEEP. In addition, I added some WKUP IRQ and enabled the code from `PWR_LPMODE_RTC` and some GPIO IRQ from `GPIO_EXTI`. I have attached the final project. However, the system does not wake up from STOP3 via the USER BUTTON. Not sure what I have missed.
But I have noticed that when I use a lower priority for the WKUP IRQ, the EXTI IRQ works fine. But the EXTI IRQ does not wake up the system either.
Maybe somebody can help me get the system to wake up and have the EXTI interrupt work together.