From 0db56fc105f39b7652254199e754fba58bb3b1f6 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Thu, 12 Jan 2017 10:27:42 +0000 Subject: Fixed RTC clock enable on some F4 devices. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10036 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/STM32F4xx/hal_lld.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'os/hal') 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__) -- cgit v1.2.3