aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-05-29 09:13:17 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-05-29 09:13:17 +0000
commit1ab61e8d8f03953e328466e58c041372164f14a4 (patch)
treec5b09d7e4a4c5a4cee89de85f56c9113e3072b95 /os/hal/ports/STM32
parent4838806bfec4edfa5f016e0c4fe6637cf3052a74 (diff)
downloadChibiOS-1ab61e8d8f03953e328466e58c041372164f14a4.tar.gz
ChibiOS-1ab61e8d8f03953e328466e58c041372164f14a4.tar.bz2
ChibiOS-1ab61e8d8f03953e328466e58c041372164f14a4.zip
Implemented LSE Drive parameter for STM32F7xx, re-generated F7 board files.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10225 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r--os/hal/ports/STM32/STM32F7xx/hal_lld.c4
-rw-r--r--os/hal/ports/STM32/STM32F7xx/hal_lld.h25
2 files changed, 27 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/STM32F7xx/hal_lld.c b/os/hal/ports/STM32/STM32F7xx/hal_lld.c
index 8dbf62a0d..09bb780a6 100644
--- a/os/hal/ports/STM32/STM32F7xx/hal_lld.c
+++ b/os/hal/ports/STM32/STM32F7xx/hal_lld.c
@@ -66,10 +66,10 @@ static void hal_lld_backup_domain_init(void) {
#if STM32_LSE_ENABLED
#if defined(STM32_LSE_BYPASS)
/* LSE Bypass.*/
- RCC->BDCR |= RCC_BDCR_LSEON | RCC_BDCR_LSEBYP;
+ RCC->BDCR |= STM32_LSEDRV | RCC_BDCR_LSEON | RCC_BDCR_LSEBYP;
#else
/* No LSE Bypass.*/
- RCC->BDCR |= RCC_BDCR_LSEON;
+ RCC->BDCR |= STM32_LSEDRV | RCC_BDCR_LSEON;
#endif
while ((RCC->BDCR & RCC_BDCR_LSERDY) == 0)
; /* Waits until LSE is stable. */
diff --git a/os/hal/ports/STM32/STM32F7xx/hal_lld.h b/os/hal/ports/STM32/STM32F7xx/hal_lld.h
index a77be0f2c..7fbf8fe9d 100644
--- a/os/hal/ports/STM32/STM32F7xx/hal_lld.h
+++ b/os/hal/ports/STM32/STM32F7xx/hal_lld.h
@@ -20,6 +20,7 @@
* @pre This module requires the following macros to be defined in the
* @p board.h file:
* - STM32_LSECLK.
+ * - STM32_LSEDRV.
* - STM32_LSE_BYPASS (optionally).
* - STM32_HSECLK.
* - STM32_HSE_BYPASS (optionally).
@@ -872,6 +873,22 @@
#error "Using a wrong mcuconf.h file, STM32F7xx_MCUCONF not defined"
#endif
+/*
+ * Board file checks.
+ */
+#if !defined(STM32_LSECLK)
+#error "STM32_LSECLK not defined in board.h"
+#endif
+#if !defined(STM32_LSEDRV)
+#error "STM32_LSEDRV not defined in board.h"
+#endif
+#if !defined(STM32_HSECLK)
+#error "STM32_HSECLK not defined in board.h"
+#endif
+#if !defined(STM32_VDD)
+#error "STM32_VDD not defined in board.h"
+#endif
+
/**
* @brief Maximum frequency thresholds and wait states for flash access.
* @note The values are valid for 2.7V to 3.6V supply range.
@@ -1066,6 +1083,14 @@
#error "STM32_LSECLK outside acceptable range (STM32_LSECLK_MIN...STM32_LSECLK_MAX)"
#endif
+#if !defined(STM32_LSEDRV)
+#error "STM32_LSEDRV not defined"
+#endif
+
+#if (STM32_LSEDRV >> 3) > 3
+#error "STM32_LSEDRV outside acceptable range ((0<<3)...(3<<3))"
+#endif
+
#else /* !STM32_LSE_ENABLED */
#if STM32_RTCSEL == STM32_RTCSEL_LSE