AnsweredAssumed Answered

STM32L1 Current consumption in Stop Mode

Question asked by Ji_yeong Yoon on Aug 8, 2017
Latest reply on Aug 8, 2017 by Vangelis Fortounas

I used CubeMX code generator,

 

Internal Clock 4.194MHz MSI / ADC / LCD / RTC / TIM2 / TIM3 / USART1

 

 

Before Stop Mode Enter,

 

void Before_Stop_ST(void)
{
//--- LCD Off
LCD_All_Display(0,1);
HAL_LCD_MspDeInit(&hlcd);
HAL_LCD_DeInit(&hlcd);

//--- Port Off
Backlight_Off(); Buzzer_Off();
CTLHY_Off(); CTL2V_Off(); //CTL3V_Off();
CTLA_Off(); CTLB_Off(); CTL1_Off();

//--- ADC Off
ADC_ConversionStop_Disable(&hadc);
HAL_ADC_Stop(&hadc);

//--- UART Off
HAL_UART_MspDeInit(&huart1);
HAL_UART_DeInit(&huart1);

//--- Timer Off
HAL_TIM_Base_Stop_IT(&htim2);
HAL_TIM_Base_Stop_IT(&htim3);
HAL_TIM_Base_DeInit(&htim2);
HAL_TIM_Base_DeInit(&htim3);

 

//--- Disable PVD
HAL_PWR_DisablePVD();

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

//--- Enable Ultra low power mode
HAL_PWREx_EnableUltraLowPower();

//--- Enable the fast wake up from Ultra low power mode
HAL_PWREx_EnableFastWakeUp();

HAL_RCC_DeInit();
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
__HAL_RCC_MSI_RANGE_CONFIG(RCC_MSIRANGE_0);
__HAL_RCC_SYSCLK_CONFIG(RCC_SYSCLKSOURCE_MSI);

__HAL_RTC_WAKEUPTIMER_DISABLE_IT(&hrtc,RTC_IT_WUT);

//__HAL_RCC_PWR_CLK_DISABLE();

//--- Configure all GPIO as analog
Configure_Analog_All_GPIO();

//--- External Interrupt Setting
External_Interrupt_Set(rRotaryPoint);   //--- Wake-up Pin (PD7)
}

 

/* Power Save ----------------------------------------------------------------*/
void Sleep_Mode_Power_Save(void)
{
Before_Stop_ST();

//-----< Power Save mode >--------------------------------------------------//
/* Disable Wakeup Counter */
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
//HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0xB4D8, RTC_WAKEUPCLOCK_RTCCLK_DIV16);
/* Enter STOP mode */
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
}

 

 

 

Prospective consumption current : 10uA under (Include all adjacent circuits)

 

(Because it was 10uA when I use the STD library.)

 

But, Now current 30uA...

 

 

 

I don't know what I'm missing.

 

Ask for help. Thank you.

Outcomes