2015-07-14 12:27 AM
Hello,
I am working on an application in which we rely heavily on the standby mode for maintaining battery life, but we're having trouble properly entering the standby mode. The CPU gets reset as it should be, but the core regulator (1.2 V domain) remains active through the standby period. What we're using to enter standby mode is the following:/* Enable standby mode */
PWR->CR |= PWR_CR_PDDS;
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
__WFI();
As far as we've managed to comprehend, nothing more should be needed. Before doing this we clear the wakeup interrupt flags.
Thankful for any pointers on where to proceed.
#standby #low-power
2015-07-14 03:34 AM
Hello,
I would suggest you to use this code to enter in standby mode/* Enable PWR Clock */
RCC->APB1ENR |= RCC_APB1ENR_PWREN;
/* Disable WKUP pin 1 */
PWR_WakeUpPinCmd(DISABLE);
/* Clear standby flag */
PWR_ClearFlag(PWR_FLAG_SB);
/* Clear Wakeup flag*/
PWR_ClearFlag(PWR_FLAG_WU);
/* Enable WKUP pin 1 */
PWR_WakeUpPinCmd(ENABLE);
/* Select STANDBY mode */
PWR->CR |= PWR_CR_PDDS;
/* Set SLEEPDEEP bit of Cortex System Control Register */
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
/* Request Wait For Interrupt */
__WFI();
I hope this helps,
Syrine.
2015-07-14 03:57 AM
I'd also make sure the write to PWR_CR has propagated through the AHB/APB before WFI, by reading it back.
JW2015-07-21 06:20 AM
Thank you both for your replies. I've made sure that I follow both of your suggestions. However, the situation remains the same. The CPU seems to be going into standby, but the core voltage remains at 1.2V.
Can you think of anything that prevents the core regulator from being turned off?2015-07-21 07:58 AM
Are you doing this with a debugger, or a free standing system?
2015-07-22 02:00 AM
I've tried it both with and without debugger connection. With the debugger present it adds roughly 0.5 mA.