arch/arm/src/stm32l4/stm32l4_hsi48.c: Enable CRS_CR_CEN with CRS_CR_AUTOTRIMEN

This commit is contained in:
Jussi Kivilinna 2019-05-29 06:59:27 -06:00 committed by Gregory Nutt
parent 30620dfeb6
commit 4bcd1806f0

View File

@ -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);
}