Question
STM32C031C6: Determine the wakeup source from shutdown mode
Hello,
I'm trying to determine the source of the wakeup flag, whether it's the power being turned on or the trigger of wakeup pin 2.
So this is my shutdown function:
After i changed my shutdown function :

when I try to determine the reason for the wakeup, the register `PWR->SR1` is always 0 when I turn the power on and when I trigger wakeup pin 2.
Is the `PWR->SR1` register reset after waking up from shutdown mode ?
I tried something just for testing :
I enabled the wakeup pin in low polarity before checking the register. So, when I trigger the wakeup pin, the `PWR->SR1` is 0, and when I power on the device, it is 2. With this, I can determine the wakeup source, but I don't think it's a good solution :

Can you please give us some feedback about this issue ?
Thank you in advance.
Regards
