STM32 STOP mode with LCD
In an aplication using STM32L0 I need to enter the STOP mode when I realize the AC mains disappears and the uC must be powered by a battery.
So before entering the STOP I obvioulsy deinit all the peripherals used till then and put the pins in analog mode as suggested. Doing so I have about 4.8uA.
Too much for my applications. So I investigated further and discovered with my great surprise that if I skip:
__HAL_RCC_LCD_CLK_DISABLE();
in HAL_LCD_MspDeInit() things go better I can falls to 2.6uA.
I don't understand why disabling the clock of LCD should take much current!!!
This is what I do;
....
HAL_LCD_Clear(&hlcd);
HAL_LCD_UpdateDisplayRequest(&hlcd);
HAL_TIM_Base_Stop_IT(&htim6);
HAL_I2C_MspDeInit(&hi2c1);
HAL_ADC_DeInit(&hadc);
HAL_TIM_Base_DeInit(&htim6);
HAL_TIM_Base_DeInit(&htim7);
HAL_LCD_DeInit(&hlcd);
GPIO_DeInit (); // Set all the GPIO pins as Analog
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
HAL_SuspendTick();
__disable_irq();
HAL_PWREx_EnableUltraLowPower();
HAL_PWREx_EnableFastWakeUp(); // don't change much
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI);
....
Maybe someone can explain this weird behavoiur?
Thanks
