cancel
Showing results for 
Search instead for 
Did you mean: 

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

Abdou
Associate II

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();

}*

3 REPLIES 3
TDK
Guru

> 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?

If you feel a post has answered your question, please click "Accept as Solution".
Abdou
Associate II

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.

Piranha
Chief II

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