HAL bug in GPIO deinit (STM32L0)
in software package STM32L0 1.12.1
in file stm32l0xx_hal_gpio.c
in function void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
The pin is deinited by setting it as input floating:
/* Configure IO Direction in Input Floting Mode */
GPIOx->MODER |= (GPIO_MODER_MODE0 << (position * 2U));But on STM32L0x3 all the pins are configured as ANALOG after a reset.
See also the reference manual RM0367 (Section "9.4.1 GPIO port mode register (GPIOx_MODER)").
The code above should be replaced with
/* Configure IO Direction as Analog Mode */
GPIOx->MODER |= (GPIO_MODER_MODE3 << (position * 2U));I'm assuming that all the devices in the L0 family have pins defaulting to ANALOG; otherwise, the code above should be tailored to the various subfamilies.
