From db9aebf3f2ce11f46349f45ad2060b1efea9904a Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Fri, 11 Oct 2019 01:31:11 +0200 Subject: [PATCH] Enable VSCALE0 for revision V devices. --- src/cmsis/src/st/system_stm32fxxx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cmsis/src/st/system_stm32fxxx.c b/src/cmsis/src/st/system_stm32fxxx.c index c50cc1a5f..aa57634f1 100644 --- a/src/cmsis/src/st/system_stm32fxxx.c +++ b/src/cmsis/src/st/system_stm32fxxx.c @@ -189,7 +189,16 @@ void SystemClock_Config(void) /* The voltage scaling allows optimizing the power consumption when the device is clocked below the maximum system frequency, to update the voltage scaling value regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + #if defined(MCU_SERIES_H7) + // Enable VSCALE0 for revision V devices. + if (HAL_GetREVID() >= 0x2003) { + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0); + } else { + #else + if (1) { + #endif + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + } // Wait for PWR_FLAG_VOSRDY #if defined(MCU_SERIES_F4) || defined(MCU_SERIES_F7)