Skip to main content
Visitor II
September 8, 2021
Question

Standby mode doesn't reduce the power consumption in stm32l4, using RTOS uCOS-III

  • September 8, 2021
  • 3 replies
  • 1060 views

I'm using the stm32l4 MCU with uCOS-III RTOS. The system frequency = 2MH using the MSI internal clk. I'm using ADC, 2 UART, I2C, SPI. My power consumption is about 700uA. The standby mode works well, enter to standby and wake up from standby. But the power consumption doesn't reduce, it's still about 400uA. Do I have to do somthings to kill the rtos processing or what ???

My code to enter to standby mode:

/**

* @brief Enter to Standby mode

* @param None

* @retval None

*/

void enterToStandByMode(void)

{

/* Disable all used wakeup sources: WKUP pins PC5, PC13 (Right and Left pins)*/

HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN2);

HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN5);

// disable r`enter code here`tc wake up

HAL_RTCEx_DeactivateWakeUpTimer(&RtcHandle);

/* Clear wake up Flag */

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF2);

__HAL_PWR_CLEAR_FLAG(PWR_WAKEUP_PIN5);

/* Enable wakeup pins WKUP2, WKUP5 PC5, PC13 (Right and Left pins)*/

HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_LOW);

HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN5_LOW);

/* Request to enter STANDBY mode */

HAL_PWR_EnterSTANDBYMode();

}*

    This topic has been closed for replies.

    3 replies

    Super User
    September 8, 2021

    > Standby mode doesn't reduce the power consumption

    > My power consumption is about 700uA.

    > But the power consumption doesn't reduce, it's still about 400uA.

    So standby reduces it from 700uA to 400uA?

    Is this a custom board?

    AbdouAuthor
    Visitor II
    September 9, 2021

    Yes, I have a custom board, but I have run the code in the dev kit board (contain just the stm32l4 MCU), and I find the same problem.

    The code I have is too big, but when I run just a little program contain the standby mode, it works well, power consumption is reduced to a few nA.

    Graduate II
    September 29, 2021

    Set DBGMCU->CR = 0; before entering standby mode and disconnect the debugger physically.