From 4bcd1806f06b26c56485797d89ce201fa2deeecf Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Wed, 29 May 2019 06:59:27 -0600 Subject: [PATCH] arch/arm/src/stm32l4/stm32l4_hsi48.c: Enable CRS_CR_CEN with CRS_CR_AUTOTRIMEN --- arch/arm/src/stm32l4/stm32l4_hsi48.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/stm32l4/stm32l4_hsi48.c b/arch/arm/src/stm32l4/stm32l4_hsi48.c index 28fa3aa7c03..11234c1fd47 100644 --- a/arch/arm/src/stm32l4/stm32l4_hsi48.c +++ b/arch/arm/src/stm32l4/stm32l4_hsi48.c @@ -136,11 +136,12 @@ void stm32l4_enable_hsi48(enum syncsrc_e syncsrc) /* Set the AUTOTRIMEN bit the CRS_CR register to enables the automatic * hardware adjustment of TRIM bits according to the measured frequency - * error between the selected SYNC event. + * error between the selected SYNC event. Also enable CEN bit to enable + * frequency error counter and SYNC events. */ regval = getreg32(STM32L4_CRS_CR); - regval |= CRS_CR_AUTOTRIMEN; + regval |= CRS_CR_AUTOTRIMEN | CRS_CR_CEN; putreg32(regval, STM32L4_CRS_CR); }