Question
There is a significant difference in current consumption between STOP mode and STANDBY mode on the STM32L031.
I built a low-power board using an STM32L031. The code I use to enter STOP mode and STANDBY mode is shown below.
In STANDBY mode, the board consumes about 2 µA. However, in STOP mode, it consumes about 90 µA, and I am not sure why there is such a large difference.
The circuit only consists of the STM32L031 and the power supply section. Could there be a problem with my code? Why is the current consumption so much higher in STOP mode than in STANDBY mode?
void EnterStopMode(void)
{
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_PIN_2);
HAL_NVIC_ClearPendingIRQ(EXTI2_3_IRQn);
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
SystemClock_Config();
HAL_ResumeTick();
}
void EnterStandbyMode(void)
{
__HAL_RCC_PWR_CLK_ENABLE();
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
HAL_PWR_EnterSTANDBYMode();
}