From 0629b65e38228cbcbbf9115850529a23ba759445 Mon Sep 17 00:00:00 2001
From: ziggurat29 <dev@ziggurat29.com>
Date: Sun, 27 Mar 2016 12:13:19 -0500
Subject: [PATCH] minor; changes to clocking config to specify the activation
 of LSE

---
 .../stm32l476vg-disco/include/stm32l476vg-disco-clocking.h    | 4 ++++
 configs/stm32l476vg-disco/src/stm32_clockconfig.c             | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/configs/stm32l476vg-disco/include/stm32l476vg-disco-clocking.h b/configs/stm32l476vg-disco/include/stm32l476vg-disco-clocking.h
index c4eee60967..12474351ee 100644
--- a/configs/stm32l476vg-disco/include/stm32l476vg-disco-clocking.h
+++ b/configs/stm32l476vg-disco/include/stm32l476vg-disco-clocking.h
@@ -134,6 +134,10 @@
 #define STM32L4_USE_CLK48
 #define STM32L4_CLK48_SEL         RCC_CCIPR_CLK48SEL_PLLSAI1
 
+/* enable the LSE oscillator, used automatically trim the MSI, and for RTC */
+
+#define STM32L4_USE_LSE
+
 /* AHB clock (HCLK) is SYSCLK (80MHz) */
 
 #define STM32L4_RCC_CFGR_HPRE     RCC_CFGR_HPRE_SYSCLK      /* HCLK  = SYSCLK / 1 */
diff --git a/configs/stm32l476vg-disco/src/stm32_clockconfig.c b/configs/stm32l476vg-disco/src/stm32_clockconfig.c
index e6eff7bc01..ac1706c974 100644
--- a/configs/stm32l476vg-disco/src/stm32_clockconfig.c
+++ b/configs/stm32l476vg-disco/src/stm32_clockconfig.c
@@ -210,14 +210,14 @@ void stm32l4_board_clockconfig(void)
    stm32l4_rcc_enablelsi();
 #endif
 
-#if defined(CONFIG_RTC_LSECLOCK)
+#if defined(STM32L4_USE_LSE)
 
   /* Low speed external clock source LSE
    *
    * TODO: There is another case where the LSE needs to
    * be enabled: if the MCO1 pin selects LSE as source.
    */
-
+  stm32l4_pwr_enableclk(true);
   stm32l4_rcc_enablelse();
 #endif