Solved
CubeMX Bug Report: HAL for STM32L0 series
Posted on July 20, 2016 at 09:43
Hi,
in the last time I played with the power modes of the STM32L0 and discovered an issue with the GPIO-HAL driver. The used version of the HAL is 1.7.0 with a STM32L053 nucleo board. I discovered that the initialization of USART-TX and -RX pins will increase the power consumption in STOP mode considerably. So I tried to deinitialize the pins to their reset state with the function HAL_GPIO_DeInit() before going into STOP mode. But the consumption remains the same so I looked into the DeInit-function and recognized the line where the I/O mode is changed (line 327 in stm32l0xx_hal_gpio.c):GPIOx->MODER &= ~(GPIO_MODER_MODE0 << (position * 2U));
The I/O mode is changed to ''input'' but the reference manual for the controller (RM0367) says in chapter 9.4.1 that the reset state for the I/O mode is ''Analog'' . According to this I changed the line 327 toGPIOx->MODER |= (GPIO_MODER_MODE0 << (position * 2U));
and the power consumption get decreased as expected. Best regards, Markus #stm32l0 #hal #bug #cubemx