diff options
-rw-r--r-- | os/hal/ports/STM32/STM32F4xx/hal_lld.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/STM32F4xx/hal_lld.c b/os/hal/ports/STM32/STM32F4xx/hal_lld.c index 91e3c1367..69767e8c4 100644 --- a/os/hal/ports/STM32/STM32F4xx/hal_lld.c +++ b/os/hal/ports/STM32/STM32F4xx/hal_lld.c @@ -150,7 +150,11 @@ void stm32_clock_init(void) { #if !STM32_NO_INIT
/* PWR clock enable.*/
+#if defined(HAL_USE_RTC) && defined(RCC_APB1ENR_RTCAPBEN)
+ RCC->APB1ENR = RCC_APB1ENR_PWREN | RCC_APB1ENR_RTCAPBEN;
+#else
RCC->APB1ENR = RCC_APB1ENR_PWREN;
+#endif
/* PWR initialization.*/
#if defined(STM32F4XX) || defined(__DOXYGEN__)
|