From d5cdab0e5108e73a8ad2e8847822c136c5434424 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 12 Jan 2017 16:27:04 -0600 Subject: [PATCH] Revert "HSI should not be turned off" This reverts commit 4e051c05fb8ec61e87b5747f17b667e65ecc2e23. This change broke the STM32 seril driver. --- arch/arm/src/stm32/stm32f40xxx_rcc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32/stm32f40xxx_rcc.c b/arch/arm/src/stm32/stm32f40xxx_rcc.c index adda863cca..5e2ba73b1f 100644 --- a/arch/arm/src/stm32/stm32f40xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f40xxx_rcc.c @@ -95,10 +95,10 @@ static inline void rcc_reset(void) putreg32(0x00000000, STM32_RCC_CFGR); - /* Reset HSEON, CSSON and PLLON bits */ + /* Reset HSION, HSEON, CSSON and PLLON bits */ regval = getreg32(STM32_RCC_CR); - regval &= ~(RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); + regval &= ~(RCC_CR_HSION | RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON); putreg32(regval, STM32_RCC_CR); /* Reset PLLCFGR register to reset default */ @@ -619,6 +619,11 @@ static void stm32_stdclockconfig(void) volatile int32_t timeout; #ifdef STM32_BOARD_USEHSI + /* Enable Internal High-Speed Clock (HSI) */ + + regval = getreg32(STM32_RCC_CR); + regval |= RCC_CR_HSION; /* Enable HSI */ + putreg32(regval, STM32_RCC_CR); /* Wait until the HSI is ready (or until a timeout elapsed) */