From bff0553eb4b7a00b6aafbb090c9aafd96fef54cf Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 27 Jun 2021 09:07:53 +0000 Subject: [PATCH] Tentative fix for RTC access. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14576 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/ports/STM32/STM32G0xx/hal_lld.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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();