Closed FRASTM closed 1 month ago
One unresolved question is easy to answer: Identifying the wakeup source from shutdown mode.
It doesn't seem possible -- the WKUP flag registers are reset when exiting shutdown mode. So they're essentially useless...
Let me know if this isn't correct. This is the behavior I see on STM32L4P5 anyways.
One unresolved question is easy to answer: Identifying the wakeup source from shutdown mode.
It doesn't seem possible -- the WKUP flag registers are reset when exiting shutdown mode. So they're essentially useless...
Let me know if this isn't correct. This is the behavior I see on STM32L4P5 anyways.
Yes, does seem so. The best I was able to do was this: https://github.com/zephyrproject-rtos/zephyr/blob/56720088cd57d18e828f98fb22a59f458a0375da/samples/boards/stm32/power_mgmt/wkup_pins_gpio/src/main.c#L39-L43
I will add that if we instead go into standby mode, for an extra 100nA or so we get functional wake-up source registers.
That's what I'm opting to do in my project anyways. I can sacrifice 100nA standby current to know what woke up the processor.
Perhaps we can add a KConfig to choose the system shutdown behavior/mode
Edit: this is my personal account
Introduction
The stm32 mcu has several external wakeup pins (GPIO) that are able to trigger a wakeup from Standby or Shutdown low power modes. The WakeUp pins are fixed GPIO pins. Each WakeUp pin is programmed previous to entering a low power standby/shutdown and will exit the system on edge-detection. The stm32 can identify the source of WakeUp.
Problem description
Depending on the stm32 serie, configuration of the WakeUp pins differs:
Proposed change
Detailed RFC
Proposed change (Detailed)