2021-09-08 12:31 PM
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();
}*
2021-09-08 01:04 PM
> 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?
2021-09-09 12:17 AM
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.
2021-09-29 04:19 PM
Set DBGMCU->CR = 0; before entering standby mode and disconnect the debugger physically.