2022-02-07 05:52 AM
Hello STM32-Community,
I'm getting mixed results checking up this question. In the power consumption calculator (PCC) there is the following diagram displayed:As you can see it should not be possible to enter STOP2 from LOWPOWER_RUN. However the sequence generator allows me to use it, even though its red underlined in the sequences:
Therefore I wanted to ask, is it possible to enter the STOP2 mode from low power run? And if not, why? I couldn't find an answer to the low-power manual from STM32, as well as the reference manual.
Kind regards
crackl1ng
Solved! Go to Solution.
2022-02-07 07:19 AM
Hello @crackl1ng ,
Yes you are right. It's not possible to make the transition from LOWPOWER_RUN to STOP2. It's mandatory to pass through the RUN MODE.
Regards,
Simon TALAS
2022-02-07 07:19 AM
Hello @crackl1ng ,
Yes you are right. It's not possible to make the transition from LOWPOWER_RUN to STOP2. It's mandatory to pass through the RUN MODE.
Regards,
Simon TALAS
2022-02-07 08:10 AM
Thank you for your reply.
As it seems it is also not possible to return to LOWPOWER_RUN from STOP1. I've tested it out, but the SystemClock jumps back to 48 MHz. Are there different STOP1-Modes?
2022-02-08 12:20 AM
Hello @crackl1ng
It could be possible to return in LOWPOWER RUN from stop1. Make sure to have STOPWUCK=0 (register RCC_CFGR) and LPR=1 (RCC_CFGR).
Let me know if it's working.
Regards,
Simon
2022-02-08 02:47 AM
Hello Simon,
thanks again for your fast reply. Regarding to LPR a little typo might have slipped in. I think you wanted to refer to the PWR_CR1 Register must be set to LPR = 1.
I've tried out your advice. I've entered LPR by slowing down the main clock to 2 MHz and set LPR to 1. Afterwards I checked the RCC_CFGR Bit STOPWUCK. It always stays 0, but I manually also set it to 0 just to be sure.
slow_downClock();
HAL_PWREx_EnableLowPowerRunMode();
RCC->CFGR &= ~(0<<15);
HAL_PWREx_EnterSTOP1Mode(PWR_SLEEPENTRY_WFI);
I still leave with 48 MHz and have to manually slow down the clock and enter LPR mode. Any faster way to do it?
Kind regards
crackl1ng
Edit: Made it work, had a slight error in the IRQ Handler of the RTC. Thank you very much Simon for your help!
2022-02-08 05:10 AM
Yes, before to enter in Low power run you need to select MSI clock and slow down the clock bellow or equal to 2MHz
You're welcome ;)