aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32F4xx/hal_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/platforms/STM32F4xx/hal_lld.c')
-rw-r--r--os/hal/platforms/STM32F4xx/hal_lld.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32F4xx/hal_lld.c b/os/hal/platforms/STM32F4xx/hal_lld.c
index a1d3d3d79..e3cf144e1 100644
--- a/os/hal/platforms/STM32F4xx/hal_lld.c
+++ b/os/hal/platforms/STM32F4xx/hal_lld.c
@@ -26,6 +26,8 @@
* @{
*/
+/* TODO: LSEBYP like in F3.*/
+
#include "ch.h"
#include "hal.h"
@@ -155,12 +157,14 @@ void stm32_clock_init(void) {
; /* Waits until HSI is stable. */
#if STM32_HSE_ENABLED
+ /* HSE activation.*/
#if defined(STM32_HSE_BYPASS)
/* HSE Bypass.*/
- RCC->CR |= RCC_CR_HSEBYP;
-#endif
- /* HSE activation.*/
+ RCC->CR |= RCC_CR_HSEON | RCC_CR_HSEBYP;
+#else
+ /* No HSE Bypass.*/
RCC->CR |= RCC_CR_HSEON;
+#endif
while ((RCC->CR & RCC_CR_HSERDY) == 0)
; /* Waits until HSE is stable. */
#endif
@@ -185,7 +189,8 @@ void stm32_clock_init(void) {
#if STM32_ACTIVATE_PLL
/* PLL activation.*/
- RCC->PLLCFGR = STM32_PLLQ | STM32_PLLSRC | STM32_PLLP | STM32_PLLN | STM32_PLLM;
+ RCC->PLLCFGR = STM32_PLLQ | STM32_PLLSRC | STM32_PLLP | STM32_PLLN |
+ STM32_PLLM;
RCC->CR |= RCC_CR_PLLON;
while (!(RCC->CR & RCC_CR_PLLRDY))
; /* Waits until PLL is stable. */