From 1c95ff86bfb2644b275d065f3b617e87c3f75616 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Mon, 7 Sep 2020 09:26:26 +0200 Subject: [PATCH] boards/stm32f3: fix clock configuration for HSI --- boards/common/stm32/include/f1f3/cfg_clock_default.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/boards/common/stm32/include/f1f3/cfg_clock_default.h b/boards/common/stm32/include/f1f3/cfg_clock_default.h index b15a136b36..a18cbf72fb 100644 --- a/boards/common/stm32/include/f1f3/cfg_clock_default.h +++ b/boards/common/stm32/include/f1f3/cfg_clock_default.h @@ -36,14 +36,20 @@ extern "C" { * @name Clock settings * @{ */ -/* give the target core clock (HCLK) frequency [in Hz], - * maximum: 72MHz */ -#define CLOCK_CORECLOCK MHZ(72) /* 0: no external high speed crystal available * else: actual crystal frequency [in Hz] */ #ifndef CLOCK_HSE #define CLOCK_HSE MHZ(8) #endif + +/* give the target core clock (HCLK) frequency [in Hz], + * maximum: 72MHz when input clock is HSE, 64MHz when input clock is HSI */ +#if CLOCK_HSE +#define CLOCK_CORECLOCK MHZ(72) +#else +#define CLOCK_CORECLOCK MHZ(64) +#endif + /* 0: no external low speed crystal available, * 1: external crystal available (always 32.768kHz) */ #ifndef CLOCK_LSE