From b66ecc57653ae3f293c90a372f063eefbfee772e Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Wed, 23 May 2018 21:36:07 +0200 Subject: [PATCH] ext: hal: stm32cube: fix stm32l4xx VDDUSB supply control The STM32L4x2 SoCs need to control the isolation of the USB features from VDDUSB. This is done through the PWR_CR2 bit USV. The STM32L4 HAL in stm32l4xx_ll_pwr.h wrongly checks for the PWR_CR2_PVME1 bit, which is only available on Cat. 3 devices. Replace the check by PWR_CR2_USV like it is already done in stm32l4xx_hal_pwr_ex.c. Signed-off-by: Aurelien Jarno --- ext/hal/st/stm32cube/stm32l4xx/README | 8 ++++++++ .../stm32l4xx/drivers/include/stm32l4xx_ll_pwr.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/hal/st/stm32cube/stm32l4xx/README b/ext/hal/st/stm32cube/stm32l4xx/README index 9709e27a04c..aacbeca0b26 100644 --- a/ext/hal/st/stm32cube/stm32l4xx/README +++ b/ext/hal/st/stm32cube/stm32l4xx/README @@ -47,3 +47,11 @@ Patch List: Impacted files: drivers/include/stm32l4xx_ll_spi.h ST Bug tracker ID: 13359 + + * The STM32L4x2 SoCs need to control the isolation of the USB features + from VDDUSB. This is done through the PWR_CR2 bit USV. The STM32L4 HAL + in stm32l4xx_ll_pwr.h wrongly checks for the PWR_CR2_PVME1 bit, which + is only available on Cat. 3 devices. Replace the check by PWR_CR2_USV. + Impacted files: + ext/hal/st/stm32cube/stm32l4xx/drivers/include/stm32l4xx_ll_pwr.h + ST Bug tracker ID: 47844 diff --git a/ext/hal/st/stm32cube/stm32l4xx/drivers/include/stm32l4xx_ll_pwr.h b/ext/hal/st/stm32cube/stm32l4xx/drivers/include/stm32l4xx_ll_pwr.h index 1d1f4624c3b..88f00ea3e2a 100644 --- a/ext/hal/st/stm32cube/stm32l4xx/drivers/include/stm32l4xx_ll_pwr.h +++ b/ext/hal/st/stm32cube/stm32l4xx/drivers/include/stm32l4xx_ll_pwr.h @@ -514,7 +514,7 @@ __STATIC_INLINE uint32_t LL_PWR_IsEnabledDSIPinsPDActivation(void) } #endif /* PWR_CR3_DSIPDEN */ -#if defined(PWR_CR2_PVME1) +#if defined(PWR_CR2_USV) /** * @brief Enable VDDUSB supply * @rmtoll CR2 USV LL_PWR_EnableVddUSB