Skip to main content
rwils.1
Associate III
March 9, 2023
Question

Determination of the reason for wake up following shut down on STM32L471RGT6

  • March 9, 2023
  • 3 replies
  • 1732 views

Hi,

I have the following code to enter shutdown with UART interrupts for the wake up. The processor does shutdown briefly (confirmed with power measurements) and then wakes up after ~.5 seconds. I cannot see any traffic on the serial ports and I can't determine the source of the interrupt that is causing wake up.

I would like to view the PWR (or other?) register to see what source is causing the wake up. Is this possible through the ST Cube debugger with breakpoints or some other means?

Thank you in advance

Richard

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); //not sure this is the correct flag
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);

This topic has been closed for replies.

3 replies

Piranha
Principal III
March 9, 2023

So do you mean Shutdown or Stop mode? Yes, you have to read the reference manual to understand anything - clicking CubeMX is not enough! If it's the Stop mode, then most likely it is woken up by some interrupt. Just debug which one it is.

Anyway, all of ST's examples for low-power modes are broken, because the HAL/Cube team cannot understand and implement anything non-trivial. Here are the real explanations and examples:

https://community.st.com/s/question/0D53W00001nYvGgSAK/mc-sdk-not-work-with-mcu-stop-mode

https://community.st.com/s/question/0D53W00001bnh8dSAA/how-to-enter-standby-or-shutdown-mode-on-stm32

rwils.1
rwils.1Author
Associate III
March 10, 2023

Thank you for your reply,

I was using the IDE to interrogate the registers, and I was hoping that someone would know which register shows the interrupt source following a wake up from STOP. It seems like a straightforward task but it has defeated me thus far.

Piranha
Principal III
March 10, 2023

Put a breakpoint on __enable_irq() and look at NVIC_ISPRx registers.