I have a problem with the stop mode on STM32. What I need is to go to the Stop mode (or any suitable low power mode), after some time to wake-up CPU by RTC and continue code execution from the point where I went to Stop mode.
I use following code to go to the Stop mode
Code: Select all
/* going to anabiosis*/
PWR->CR |= (PWR_CR_PDDS | PWR_CR_LPDS | PWR_CR_CSBF | PWR_CR_CWUF);
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
__WFI();
Waking-up by RTC works fine but the problem is that the code execution does not continue from the last point, CPU is reseted.