cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 Standby Consumption

jesper2
Associate II
Posted on July 14, 2015 at 09:27

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
5 REPLIES 5
nesrine
Senior
Posted on July 14, 2015 at 12:34

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.
Posted on July 14, 2015 at 12:57

I'd also make sure the write to PWR_CR has propagated through the AHB/APB before WFI, by reading it back.

JW

jesper2
Associate II
Posted on July 21, 2015 at 15:20

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?
Posted on July 21, 2015 at 16:58

Are you doing this with a debugger, or a free standing system?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jesper2
Associate II
Posted on July 22, 2015 at 11:00

I've tried it both with and without debugger connection. With the debugger present it adds roughly 0.5 mA.