diff --git a/os/hal/ports/STM32/STM32G0xx/hal_lld.c b/os/hal/ports/STM32/STM32G0xx/hal_lld.c index 5435e08b9..ead1fac07 100644 --- a/os/hal/ports/STM32/STM32G0xx/hal_lld.c +++ b/os/hal/ports/STM32/STM32G0xx/hal_lld.c @@ -642,6 +642,10 @@ void stm32_clock_init(void) { among multiple drivers.*/ rccEnableAPBR2(RCC_APBENR2_SYSCFGEN, false); +#if defined(HAL_USE_RTC) && defined(RCC_APBENR1_RTCAPBEN) + rccEnableAPBR1(RCC_APBENR1_RTCAPBEN, false); +#endif + /* Static PWR configurations.*/ hal_lld_set_static_pwr(); @@ -681,6 +685,10 @@ void stm32_clock_init(void) { among multiple drivers.*/ rccEnableAPBR2(RCC_APBENR2_SYSCFGEN, false); +#if defined(HAL_USE_RTC) && defined(RCC_APBENR1_RTCAPBEN) + rccEnableAPBR1(RCC_APBENR1_RTCAPBEN, false); +#endif + /* Static PWR configurations.*/ hal_lld_set_static_pwr();