diff --git a/os/hal/ports/STM32/STM32L4xx+/hal_lld.c b/os/hal/ports/STM32/STM32L4xx+/hal_lld.c index ac32d95c5..190597627 100644 --- a/os/hal/ports/STM32/STM32L4xx+/hal_lld.c +++ b/os/hal/ports/STM32/STM32L4xx+/hal_lld.c @@ -121,6 +121,7 @@ void hal_lld_init(void) { */ void stm32_clock_init(void) { +#if !STM32_NO_INIT /* Reset of all peripherals. Note, GPIOs are not reset because initialized before this point in board files.*/ @@ -140,7 +141,7 @@ void stm32_clock_init(void) { /* SYSCFG clock enabled here because it is a multi-functional unit shared among multiple drivers.*/ - rccEnableAPB2(RCC_APB2ENR_SYSCFGEN, true); + rccEnableAPB2(RCC_APB2ENR_SYSCFGEN, false); /* Core voltage setup, backup domain access enabled and left open.*/ PWR->CR1 = STM32_VOS | PWR_CR1_DBP; @@ -239,6 +240,7 @@ void stm32_clock_init(void) { (STM32_FLASHBITS & FLASH_ACR_LATENCY_Msk)) { } } +#endif /* STM32_NO_INIT */ } /** @} */ diff --git a/os/hal/ports/STM32/STM32L4xx/hal_lld.c b/os/hal/ports/STM32/STM32L4xx/hal_lld.c index 8f5705c64..c6f16a5f1 100644 --- a/os/hal/ports/STM32/STM32L4xx/hal_lld.c +++ b/os/hal/ports/STM32/STM32L4xx/hal_lld.c @@ -121,6 +121,7 @@ void hal_lld_init(void) { */ void stm32_clock_init(void) { +#if !STM32_NO_INIT /* Reset of all peripherals. Note, GPIOs are not reset because initialized before this point in board files.*/ @@ -140,7 +141,7 @@ void stm32_clock_init(void) { /* SYSCFG clock enabled here because it is a multi-functional unit shared among multiple drivers.*/ - rccEnableAPB2(RCC_APB2ENR_SYSCFGEN, true); + rccEnableAPB2(RCC_APB2ENR_SYSCFGEN, false); /* Core voltage setup, backup domain access enabled and left open.*/ PWR->CR1 = STM32_VOS | PWR_CR1_DBP; @@ -238,6 +239,7 @@ void stm32_clock_init(void) { (STM32_FLASHBITS & FLASH_ACR_LATENCY_Msk)) { } } +#endif /* STM32_NO_INIT */ } /** @} */