diff --git a/ports/stm32/system_stm32.c b/ports/stm32/system_stm32.c index 2cff36c3a6..dccfca0849 100644 --- a/ports/stm32/system_stm32.c +++ b/ports/stm32/system_stm32.c @@ -223,8 +223,12 @@ MP_WEAK void SystemClock_Config(void) { HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST); #elif defined(STM32L4) // Configure LSE Drive Capability + #ifdef MICROPY_HW_RTC_LSEDRIVE + __HAL_RCC_LSEDRIVE_CONFIG(MICROPY_HW_RTC_LSEDRIVE); + #else __HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW); #endif + #endif #if defined(STM32H7) // Wait until core supply reaches the required voltage level.