cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-U575zi-Q EXTI GPIO IRQ with stop 3 sleep mode

akarner
Associate

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

2 REPLIES 2
Andrew Neil
Super User

@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 AN5701Introduction 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 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

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:

  • PWR_LPMODE_RTC: This sample goes into either SLEEP or STOPX mode and wakes up by the RTC. Afterward, a system reset occurs. => This is not exactly what I am looking for.
  • PWR_ModesSelection: This sample allows measuring the current of the individual power saving modes. But it does not recover from this state; a reset is needed.
  • PWR_SLEEP: This sample is what I need, but for the SLEEP mode and not for STOP3. Please find some notes below.
  • PWR_STANDBY: This sample uses the USER button to wake the board from STANDBY mode. After the wake-up, the board reboots, which I do not want.

 

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.