Showing results for 
Search instead for 
Did you mean: 

STM32L072 Standby Mode problems



I'm using the DISCO-L072CZ-LRWAN1 board and have some trouble using the low power modes.

It seems whenever i enter the low power mode, it immediately wakes up again, I've tried following a few of the guides and can't see what I'm doing wrong. The board steadily draws 45-55 mA from my power supply, and i would expect it to be a lot lower.

I generated a project for the board from MxCube and using CubeIDE, the project is empty except for the init functions and the code below.

Am i missing something here??

This is my code:


    // Configure MCU low-power mode for CPU deep sleep mode

    PWR->CR |= PWR_CR_CWUF; // Clear wakeup flags
    PWR->CR |= PWR_CR_PDDS; // 0 = Stop mode, 1 = Standby mode
    PWR->CR |= PWR_CR_ULP;   // V_{REFINT} is off in low-power mode

    (void)PWR->CR; // Ensure that the previous PWR register operations have been completed

// // Configure CPU core
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; // Enable CPU deep sleep mode

// Enter low-power mode
for (;;) {


Low power issues like these are discussed here frequently, try searching. @Piranha has posted lists of things to check in the past.


ST Employee

Hello @Fiskk

Most probably, the values 45-55 mA are in run mode. 

One thing you can try is to disable the debug interface (DBGMCU) 


To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Chief II

The code seems to be adapted from my article, but it skips the part about DBGMCU_CR register.

Also, after enabling a peripheral clock, there is a delay required before the peripheral is used: