From 350ce83f2042c9882518345464bad2b6c204e992 Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Fri, 5 Jul 2024 09:58:32 +0200 Subject: [PATCH] hw/bsp/stm32: Allow to specify HSE value in syscfg This modifies stm32xxx_hal_conf.h to use STM32_CLOCK_HSE_VALUE from syscfg if specified. This is done because evaluation boards often allow to modify how HSE is connected with solder bridges. Signed-off-by: Jerzy Kasenberg --- hw/bsp/ada_feather_stm32f405/include/bsp/stm32f4xx_hal_conf.h | 4 +++- hw/bsp/b-l072z-lrwan1/include/bsp/stm32l0xx_hal_conf.h | 4 +++- hw/bsp/b-l475e-iot01a/include/bsp/stm32l4xx_hal_conf.h | 4 +++- hw/bsp/black_vet6/include/bsp/stm32f4xx_hal_conf.h | 4 +++- hw/bsp/bluepill/include/bsp/stm32f1xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f030r8/include/bsp/stm32f0xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f072rb/include/bsp/stm32f0xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f103rb/include/bsp/stm32f1xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f401re/include/bsp/stm32f4xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f411re/include/bsp/stm32f4xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f413zh/include/bsp/stm32f4xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f439zi/include/bsp/stm32f4xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f746zg/include/bsp/stm32f7xx_hal_conf.h | 4 +++- hw/bsp/nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h | 4 +++- hw/bsp/nucleo-g0b1re/include/bsp/stm32g0xx_hal_conf.h | 4 +++- hw/bsp/nucleo-g491re/include/bsp/stm32g4xx_hal_conf.h | 4 +++- hw/bsp/nucleo-h723zg/include/bsp/stm32h7xx_hal_conf.h | 4 +++- hw/bsp/nucleo-l073rz/include/bsp/stm32l0xx_hal_conf.h | 4 +++- hw/bsp/nucleo-l476rg/include/bsp/stm32l4xx_hal_conf.h | 4 +++- hw/bsp/nucleo-u575zi-q/include/bsp/stm32u5xx_hal_conf.h | 4 +++- hw/bsp/olimex-p103/include/bsp/stm32f1xx_hal_conf.h | 4 +++- .../include/bsp/stm32f4xx_hal_conf.h | 4 +++- .../p-nucleo-wb55-usbdongle/include/bsp/stm32wbxx_hal_conf.h | 4 +++- hw/bsp/p-nucleo-wb55/include/bsp/stm32wbxx_hal_conf.h | 4 +++- hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h | 4 +++- hw/bsp/stm32f411discovery/include/bsp/stm32f4xx_hal_conf.h | 4 +++- hw/bsp/stm32f429discovery/include/bsp/stm32f4xx_hal_conf.h | 4 +++- hw/bsp/stm32f4discovery/include/bsp/stm32f4xx_hal_conf.h | 4 +++- hw/bsp/stm32f7discovery/include/bsp/stm32f7xx_hal_conf.h | 4 +++- hw/bsp/stm32l152discovery/include/bsp/stm32l1xx_hal_conf.h | 4 +++- hw/bsp/weact_g431cb/include/bsp/stm32g4xx_hal_conf.h | 4 +++- 33 files changed, 99 insertions(+), 33 deletions(-) diff --git a/hw/bsp/ada_feather_stm32f405/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/ada_feather_stm32f405/include/bsp/stm32f4xx_hal_conf.h index 546918ff67..2e4cc4964f 100644 --- a/hw/bsp/ada_feather_stm32f405/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/ada_feather_stm32f405/include/bsp/stm32f4xx_hal_conf.h @@ -114,7 +114,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/b-l072z-lrwan1/include/bsp/stm32l0xx_hal_conf.h b/hw/bsp/b-l072z-lrwan1/include/bsp/stm32l0xx_hal_conf.h index 00140ca121..38b7272f78 100644 --- a/hw/bsp/b-l072z-lrwan1/include/bsp/stm32l0xx_hal_conf.h +++ b/hw/bsp/b-l072z-lrwan1/include/bsp/stm32l0xx_hal_conf.h @@ -91,7 +91,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/b-l475e-iot01a/include/bsp/stm32l4xx_hal_conf.h b/hw/bsp/b-l475e-iot01a/include/bsp/stm32l4xx_hal_conf.h index f1396846d9..9831de8583 100644 --- a/hw/bsp/b-l475e-iot01a/include/bsp/stm32l4xx_hal_conf.h +++ b/hw/bsp/b-l475e-iot01a/include/bsp/stm32l4xx_hal_conf.h @@ -105,7 +105,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/black_vet6/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/black_vet6/include/bsp/stm32f4xx_hal_conf.h index f978f821e8..4468960093 100644 --- a/hw/bsp/black_vet6/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/black_vet6/include/bsp/stm32f4xx_hal_conf.h @@ -112,7 +112,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/bluepill/include/bsp/stm32f1xx_hal_conf.h b/hw/bsp/bluepill/include/bsp/stm32f1xx_hal_conf.h index c679310aa9..00eb92aab9 100644 --- a/hw/bsp/bluepill/include/bsp/stm32f1xx_hal_conf.h +++ b/hw/bsp/bluepill/include/bsp/stm32f1xx_hal_conf.h @@ -108,7 +108,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #if defined(USE_STM3210C_EVAL) #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ #else diff --git a/hw/bsp/nucleo-f030r8/include/bsp/stm32f0xx_hal_conf.h b/hw/bsp/nucleo-f030r8/include/bsp/stm32f0xx_hal_conf.h index e22c43fb09..07f22f77c9 100644 --- a/hw/bsp/nucleo-f030r8/include/bsp/stm32f0xx_hal_conf.h +++ b/hw/bsp/nucleo-f030r8/include/bsp/stm32f0xx_hal_conf.h @@ -86,7 +86,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-f072rb/include/bsp/stm32f0xx_hal_conf.h b/hw/bsp/nucleo-f072rb/include/bsp/stm32f0xx_hal_conf.h index 5d16c4a106..37ef9be3e7 100644 --- a/hw/bsp/nucleo-f072rb/include/bsp/stm32f0xx_hal_conf.h +++ b/hw/bsp/nucleo-f072rb/include/bsp/stm32f0xx_hal_conf.h @@ -86,7 +86,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-f103rb/include/bsp/stm32f1xx_hal_conf.h b/hw/bsp/nucleo-f103rb/include/bsp/stm32f1xx_hal_conf.h index 96de6eda82..ff881eba9a 100644 --- a/hw/bsp/nucleo-f103rb/include/bsp/stm32f1xx_hal_conf.h +++ b/hw/bsp/nucleo-f103rb/include/bsp/stm32f1xx_hal_conf.h @@ -108,7 +108,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #if defined(USE_STM3210C_EVAL) #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ #else diff --git a/hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h b/hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h index ce59158911..dfc4665bc4 100644 --- a/hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h +++ b/hw/bsp/nucleo-f303k8/include/bsp/stm32f3xx_hal_conf.h @@ -91,7 +91,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h b/hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h index 3039a0b4e9..c74009e850 100644 --- a/hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h +++ b/hw/bsp/nucleo-f303re/include/bsp/stm32f3xx_hal_conf.h @@ -91,7 +91,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-f401re/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/nucleo-f401re/include/bsp/stm32f4xx_hal_conf.h index ebff517c3e..6a2f7f22e0 100644 --- a/hw/bsp/nucleo-f401re/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/nucleo-f401re/include/bsp/stm32f4xx_hal_conf.h @@ -111,7 +111,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-f411re/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/nucleo-f411re/include/bsp/stm32f4xx_hal_conf.h index 4132e008b6..e182dff6b6 100644 --- a/hw/bsp/nucleo-f411re/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/nucleo-f411re/include/bsp/stm32f4xx_hal_conf.h @@ -109,7 +109,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-f413zh/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/nucleo-f413zh/include/bsp/stm32f4xx_hal_conf.h index 2554ca8675..22d1edaa45 100644 --- a/hw/bsp/nucleo-f413zh/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/nucleo-f413zh/include/bsp/stm32f4xx_hal_conf.h @@ -109,7 +109,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-f439zi/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/nucleo-f439zi/include/bsp/stm32f4xx_hal_conf.h index 03f61c778c..5ce593fa6f 100644 --- a/hw/bsp/nucleo-f439zi/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/nucleo-f439zi/include/bsp/stm32f4xx_hal_conf.h @@ -110,7 +110,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-f746zg/include/bsp/stm32f7xx_hal_conf.h b/hw/bsp/nucleo-f746zg/include/bsp/stm32f7xx_hal_conf.h index aa4400c566..3949a717c5 100644 --- a/hw/bsp/nucleo-f746zg/include/bsp/stm32f7xx_hal_conf.h +++ b/hw/bsp/nucleo-f746zg/include/bsp/stm32f7xx_hal_conf.h @@ -106,7 +106,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h b/hw/bsp/nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h index 532eb41de4..b4c0f462e3 100644 --- a/hw/bsp/nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h +++ b/hw/bsp/nucleo-f767zi/include/bsp/stm32f7xx_hal_conf.h @@ -104,7 +104,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-g0b1re/include/bsp/stm32g0xx_hal_conf.h b/hw/bsp/nucleo-g0b1re/include/bsp/stm32g0xx_hal_conf.h index 3f363abff4..430bcae558 100644 --- a/hw/bsp/nucleo-g0b1re/include/bsp/stm32g0xx_hal_conf.h +++ b/hw/bsp/nucleo-g0b1re/include/bsp/stm32g0xx_hal_conf.h @@ -99,7 +99,9 @@ extern "C" { * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-g491re/include/bsp/stm32g4xx_hal_conf.h b/hw/bsp/nucleo-g491re/include/bsp/stm32g4xx_hal_conf.h index d3ec2da08e..55cb18325b 100644 --- a/hw/bsp/nucleo-g491re/include/bsp/stm32g4xx_hal_conf.h +++ b/hw/bsp/nucleo-g491re/include/bsp/stm32g4xx_hal_conf.h @@ -115,7 +115,9 @@ extern "C" { * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE 24000000UL /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-h723zg/include/bsp/stm32h7xx_hal_conf.h b/hw/bsp/nucleo-h723zg/include/bsp/stm32h7xx_hal_conf.h index c48aa74b67..46f014ef0c 100644 --- a/hw/bsp/nucleo-h723zg/include/bsp/stm32h7xx_hal_conf.h +++ b/hw/bsp/nucleo-h723zg/include/bsp/stm32h7xx_hal_conf.h @@ -94,7 +94,9 @@ extern "C" { * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-l073rz/include/bsp/stm32l0xx_hal_conf.h b/hw/bsp/nucleo-l073rz/include/bsp/stm32l0xx_hal_conf.h index 00140ca121..38b7272f78 100644 --- a/hw/bsp/nucleo-l073rz/include/bsp/stm32l0xx_hal_conf.h +++ b/hw/bsp/nucleo-l073rz/include/bsp/stm32l0xx_hal_conf.h @@ -91,7 +91,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-l476rg/include/bsp/stm32l4xx_hal_conf.h b/hw/bsp/nucleo-l476rg/include/bsp/stm32l4xx_hal_conf.h index ccd27e3ae6..f875d95f32 100644 --- a/hw/bsp/nucleo-l476rg/include/bsp/stm32l4xx_hal_conf.h +++ b/hw/bsp/nucleo-l476rg/include/bsp/stm32l4xx_hal_conf.h @@ -105,7 +105,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/nucleo-u575zi-q/include/bsp/stm32u5xx_hal_conf.h b/hw/bsp/nucleo-u575zi-q/include/bsp/stm32u5xx_hal_conf.h index b210b73cae..a9a7186eaa 100644 --- a/hw/bsp/nucleo-u575zi-q/include/bsp/stm32u5xx_hal_conf.h +++ b/hw/bsp/nucleo-u575zi-q/include/bsp/stm32u5xx_hal_conf.h @@ -98,7 +98,9 @@ extern "C" { * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE 16000000UL /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/olimex-p103/include/bsp/stm32f1xx_hal_conf.h b/hw/bsp/olimex-p103/include/bsp/stm32f1xx_hal_conf.h index 96de6eda82..ff881eba9a 100644 --- a/hw/bsp/olimex-p103/include/bsp/stm32f1xx_hal_conf.h +++ b/hw/bsp/olimex-p103/include/bsp/stm32f1xx_hal_conf.h @@ -108,7 +108,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #if defined(USE_STM3210C_EVAL) #define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */ #else diff --git a/hw/bsp/olimex_stm32-e407_devboard/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/olimex_stm32-e407_devboard/include/bsp/stm32f4xx_hal_conf.h index 5174b1fd6c..8a0a3d5632 100644 --- a/hw/bsp/olimex_stm32-e407_devboard/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/olimex_stm32-e407_devboard/include/bsp/stm32f4xx_hal_conf.h @@ -113,7 +113,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/p-nucleo-wb55-usbdongle/include/bsp/stm32wbxx_hal_conf.h b/hw/bsp/p-nucleo-wb55-usbdongle/include/bsp/stm32wbxx_hal_conf.h index 6a736a7fb3..1e29421522 100644 --- a/hw/bsp/p-nucleo-wb55-usbdongle/include/bsp/stm32wbxx_hal_conf.h +++ b/hw/bsp/p-nucleo-wb55-usbdongle/include/bsp/stm32wbxx_hal_conf.h @@ -94,7 +94,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/p-nucleo-wb55/include/bsp/stm32wbxx_hal_conf.h b/hw/bsp/p-nucleo-wb55/include/bsp/stm32wbxx_hal_conf.h index 6a736a7fb3..1e29421522 100644 --- a/hw/bsp/p-nucleo-wb55/include/bsp/stm32wbxx_hal_conf.h +++ b/hw/bsp/p-nucleo-wb55/include/bsp/stm32wbxx_hal_conf.h @@ -94,7 +94,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h b/hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h index 32094a4328..d9d65f7eb9 100644 --- a/hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h +++ b/hw/bsp/stm32f3discovery/include/bsp/stm32f3xx_hal_conf.h @@ -91,7 +91,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/stm32f411discovery/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/stm32f411discovery/include/bsp/stm32f4xx_hal_conf.h index 7404155f5e..f41cb1be89 100644 --- a/hw/bsp/stm32f411discovery/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/stm32f411discovery/include/bsp/stm32f4xx_hal_conf.h @@ -110,7 +110,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/stm32f429discovery/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/stm32f429discovery/include/bsp/stm32f4xx_hal_conf.h index ef6c090c10..2447841402 100644 --- a/hw/bsp/stm32f429discovery/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/stm32f429discovery/include/bsp/stm32f4xx_hal_conf.h @@ -111,7 +111,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/stm32f4discovery/include/bsp/stm32f4xx_hal_conf.h b/hw/bsp/stm32f4discovery/include/bsp/stm32f4xx_hal_conf.h index 69ba6e05b7..c11b9b0062 100644 --- a/hw/bsp/stm32f4discovery/include/bsp/stm32f4xx_hal_conf.h +++ b/hw/bsp/stm32f4discovery/include/bsp/stm32f4xx_hal_conf.h @@ -110,7 +110,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/stm32f7discovery/include/bsp/stm32f7xx_hal_conf.h b/hw/bsp/stm32f7discovery/include/bsp/stm32f7xx_hal_conf.h index c058439c88..ca3bb6a4f4 100644 --- a/hw/bsp/stm32f7discovery/include/bsp/stm32f7xx_hal_conf.h +++ b/hw/bsp/stm32f7discovery/include/bsp/stm32f7xx_hal_conf.h @@ -105,7 +105,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/stm32l152discovery/include/bsp/stm32l1xx_hal_conf.h b/hw/bsp/stm32l152discovery/include/bsp/stm32l1xx_hal_conf.h index b364f95543..7c01419904 100644 --- a/hw/bsp/stm32l152discovery/include/bsp/stm32l1xx_hal_conf.h +++ b/hw/bsp/stm32l152discovery/include/bsp/stm32l1xx_hal_conf.h @@ -86,7 +86,9 @@ * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ diff --git a/hw/bsp/weact_g431cb/include/bsp/stm32g4xx_hal_conf.h b/hw/bsp/weact_g431cb/include/bsp/stm32g4xx_hal_conf.h index 913aadb887..35b0006b6c 100644 --- a/hw/bsp/weact_g431cb/include/bsp/stm32g4xx_hal_conf.h +++ b/hw/bsp/weact_g431cb/include/bsp/stm32g4xx_hal_conf.h @@ -115,7 +115,9 @@ extern "C" { * This value is used by the RCC HAL module to compute the system frequency * (when HSE is used as system clock source, directly or through the PLL). */ -#if !defined (HSE_VALUE) +#if defined (MYNEWT_VAL_STM32_CLOCK_HSE_VALUE) +#define HSE_VALUE MYNEWT_VAL(STM32_CLOCK_HSE_VALUE) +#elif !defined (HSE_VALUE) #define HSE_VALUE 8000000UL /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */