From caa131f41059a80b9b0b433ceff3b78c9efc2729 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Tue, 8 Dec 2020 12:04:10 +0100 Subject: [PATCH] Set the Vddio2 Independent I/Os supply for the stm32L5xx soc. This bit is mandatory to use PG[15:2]. Especiually for LPUART1 TxRx pins. This bit of the PWR CR2 is used to validate the V DDIO2 supply for electrical and logical isolation purpose. Signed-off-by: Francois Ramu --- libraries/SrcWrapper/src/stm32/pinmap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/SrcWrapper/src/stm32/pinmap.c b/libraries/SrcWrapper/src/stm32/pinmap.c index d97b234bfc..fe1ee83d18 100644 --- a/libraries/SrcWrapper/src/stm32/pinmap.c +++ b/libraries/SrcWrapper/src/stm32/pinmap.c @@ -98,6 +98,12 @@ void pin_function(PinName pin, int function) /* Enable GPIO clock */ GPIO_TypeDef *gpio = set_GPIO_Port_Clock(port); +#if defined (STM32L5xx) + /* validate the V DDIO2 supply for electrical and logical isolation purpose.*/ + __HAL_RCC_PWR_CLK_ENABLE(); + HAL_PWREx_EnableVddIO2(); +#endif /* STM32L5xx */ + #if defined(STM32MP1xx) PERIPH_LOCK(gpio); #endif