This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 393dc5abe6c8ae61224916b4c82f09459459a78e
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Fri Jul 5 09:58:32 2024 +0200

    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 <[email protected]>
---
 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 +++-
 hw/bsp/olimex_stm32-e407_devboard/include/bsp/stm32f4xx_hal_conf.h | 4 +++-
 hw/bsp/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 546918ff6..2e4cc4964 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 00140ca12..38b7272f7 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 f1396846d..9831de858 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 f978f821e..446896009 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 c679310aa..00eb92aab 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 e22c43fb0..07f22f77c 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 5d16c4a10..37ef9be3e 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 96de6eda8..ff881eba9 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 ce5915891..dfc4665bc 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 3039a0b4e..c74009e85 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 ebff517c3..6a2f7f22e 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 4132e008b..e182dff6b 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 2554ca867..22d1edaa4 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 03f61c778..5ce593fa6 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 aa4400c56..3949a717c 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 532eb41de..b4c0f462e 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 3f363abff..430bcae55 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 d3ec2da08..55cb18325 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 c48aa74b6..46f014ef0 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 00140ca12..38b7272f7 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 ccd27e3ae..f875d95f3 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 b210b73ca..a9a7186ea 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 96de6eda8..ff881eba9 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 5174b1fd6..8a0a3d563 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 6a736a7fb..1e2942152 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 6a736a7fb..1e2942152 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 32094a432..d9d65f7eb 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 7404155f5..f41cb1be8 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 ef6c090c1..244784140 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 69ba6e05b..c11b9b006 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 c058439c8..ca3bb6a4f 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 b364f9554..7c0141990 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 913aadb88..35b0006b6 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 */
 

Reply via email to