[PATCH 5/7] bsps/stm32h7: add configuration and enable build of stm32h757i-eval-m4 BSP

Karel Gardas karel at functional.vision
Sun May 29 23:36:06 UTC 2022


This is minimalist configuration for the stm32h757i-eval-m4 BSP provided
here. The only general enhancement worth mention is a flash origin address
configuration which is needed for simplification as M4 core boots
from second flash bank which starts at 0x8100000 by default. The boot
address of the core may be changed by using STM32CubeProgrammer. If done
so then also BSP configuration needs to be changed accordingly.

As the BSP variant is running on M4 core, there is also more configuration
changes required here. E.g. boot core and ABI (compilation flags)
in comparison with stm32h757i-eval BSP. On the other hand, C code is shared
completely with this BSP variant.

Sponsored-By:   Precidata
---
 spec/build/bsps/arm/stm32h7/abi.yml           |  9 ++++++-
 .../arm/stm32h7/bspstm32h757i-eval-m4.yml     | 24 +++++++++++++++++++
 spec/build/bsps/arm/stm32h7/grp.yml           |  2 ++
 .../build/bsps/arm/stm32h7/linkcmdsmemory.yml |  2 +-
 spec/build/bsps/arm/stm32h7/optbootcore.yml   |  3 +++
 spec/build/bsps/arm/stm32h7/optlinkcmds.yml   |  1 +
 .../bsps/arm/stm32h7/optmemflashorigin.yml    | 19 +++++++++++++++
 spec/build/bsps/arm/stm32h7/optmemflashsz.yml |  6 ++++-
 spec/build/bsps/arm/stm32h7/optpwrsupply.yml  |  1 +
 .../bsps/arm/stm32h7/optusart1gpioregs.yml    |  1 +
 spec/build/bsps/arm/stm32h7/optvariant.yml    |  1 +
 11 files changed, 66 insertions(+), 3 deletions(-)
 create mode 100644 spec/build/bsps/arm/stm32h7/bspstm32h757i-eval-m4.yml
 create mode 100644 spec/build/bsps/arm/stm32h7/optmemflashorigin.yml

diff --git a/spec/build/bsps/arm/stm32h7/abi.yml b/spec/build/bsps/arm/stm32h7/abi.yml
index 697220b1b1..dd751cb72e 100644
--- a/spec/build/bsps/arm/stm32h7/abi.yml
+++ b/spec/build/bsps/arm/stm32h7/abi.yml
@@ -8,7 +8,14 @@ default:
 - -mcpu=cortex-m7
 - -mfpu=fpv5-d16
 - -mfloat-abi=hard
-default-by-variant: []
+default-by-variant:
+- value:
+  - -mthumb
+  - -mcpu=cortex-m4
+  - -mfpu=fpv4-sp-d16
+  - -mfloat-abi=hard
+  variants:
+  - arm/stm32h757i-eval-m4
 enabled-by: true
 links: []
 name: ABI_FLAGS
diff --git a/spec/build/bsps/arm/stm32h7/bspstm32h757i-eval-m4.yml b/spec/build/bsps/arm/stm32h7/bspstm32h757i-eval-m4.yml
new file mode 100644
index 0000000000..4850396281
--- /dev/null
+++ b/spec/build/bsps/arm/stm32h7/bspstm32h757i-eval-m4.yml
@@ -0,0 +1,24 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+arch: arm
+bsp: stm32h757i-eval-m4
+build-type: bsp
+cflags: []
+copyrights:
+- Copyright (C) 2022 Karel Gardas <karel at functional.vision>
+cppflags: []
+enabled-by: true
+family: stm32h7
+includes: []
+install: []
+links:
+- role: build-dependency
+  uid: grp
+- role: build-dependency
+  uid: tststm32h757i-eval
+source:
+- bsps/arm/stm32h7/boards/stm/stm32h757i-eval/stm32h7-config-clk.c
+- bsps/arm/stm32h7/boards/stm/stm32h757i-eval/stm32h7-config-osc.c
+- bsps/arm/stm32h7/boards/stm/stm32h757i-eval/stm32h7-config-per.c
+- bsps/arm/stm32h7/boards/stm/stm32h757i-eval/system_stm32h7xx.c
+- bsps/shared/cache/nocache.c
+type: build
diff --git a/spec/build/bsps/arm/stm32h7/grp.yml b/spec/build/bsps/arm/stm32h7/grp.yml
index 6e7036b6aa..c056a2034b 100644
--- a/spec/build/bsps/arm/stm32h7/grp.yml
+++ b/spec/build/bsps/arm/stm32h7/grp.yml
@@ -51,6 +51,8 @@ links:
   uid: optmemflashsz
 - role: build-dependency
   uid: optmemflashlatency
+- role: build-dependency
+  uid: optmemflashorigin
 - role: build-dependency
   uid: optmemitcmsz
 - role: build-dependency
diff --git a/spec/build/bsps/arm/stm32h7/linkcmdsmemory.yml b/spec/build/bsps/arm/stm32h7/linkcmdsmemory.yml
index 7ff7f3da5e..78f0308832 100644
--- a/spec/build/bsps/arm/stm32h7/linkcmdsmemory.yml
+++ b/spec/build/bsps/arm/stm32h7/linkcmdsmemory.yml
@@ -3,7 +3,7 @@ content: |
   MEMORY {
     NULL        : ORIGIN = 0x00000000, LENGTH = ${STM32H7_MEMORY_NULL_SIZE:#010x}
     ITCM        : ORIGIN = ${STM32H7_MEMORY_NULL_SIZE:#010x}, LENGTH = ${STM32H7_MEMORY_ITCM_SIZE:#010x}
-    FLASH       : ORIGIN = 0x08000000, LENGTH = ${STM32H7_MEMORY_FLASH_SIZE:#010x}
+    FLASH       : ORIGIN = ${STM32H7_MEMORY_FLASH_ORIGIN:#010x}, LENGTH = ${STM32H7_MEMORY_FLASH_SIZE:#010x}
     DTCM        : ORIGIN = 0x20000000, LENGTH = ${STM32H7_MEMORY_DTCM_SIZE:#010x}
     SRAM_AXI    : ORIGIN = 0x24000000, LENGTH = ${STM32H7_MEMORY_SRAM_AXI_SIZE:#010x}
     SRAM_1      : ORIGIN = 0x30000000, LENGTH = ${STM32H7_MEMORY_SRAM_1_SIZE:#010x}
diff --git a/spec/build/bsps/arm/stm32h7/optbootcore.yml b/spec/build/bsps/arm/stm32h7/optbootcore.yml
index 53ffb496cc..e6f52e8631 100644
--- a/spec/build/bsps/arm/stm32h7/optbootcore.yml
+++ b/spec/build/bsps/arm/stm32h7/optbootcore.yml
@@ -11,6 +11,9 @@ default-by-variant:
 - value: CORE_CM7
   variants:
   - arm/stm32h757i-eval
+- value: CORE_CM4
+  variants:
+  - arm/stm32h757i-eval-m4
 enabled-by: true
 format: '{}'
 links: []
diff --git a/spec/build/bsps/arm/stm32h7/optlinkcmds.yml b/spec/build/bsps/arm/stm32h7/optlinkcmds.yml
index 43af9c8613..c3c76f9496 100644
--- a/spec/build/bsps/arm/stm32h7/optlinkcmds.yml
+++ b/spec/build/bsps/arm/stm32h7/optlinkcmds.yml
@@ -8,6 +8,7 @@ default-by-variant:
   variants:
   - arm/stm32h7b3i-dk
   - arm/stm32h757i-eval
+  - arm/stm32h757i-eval-m4
 enabled-by: true
 format: '{}'
 links: []
diff --git a/spec/build/bsps/arm/stm32h7/optmemflashorigin.yml b/spec/build/bsps/arm/stm32h7/optmemflashorigin.yml
new file mode 100644
index 0000000000..f36a7da8b9
--- /dev/null
+++ b/spec/build/bsps/arm/stm32h7/optmemflashorigin.yml
@@ -0,0 +1,19 @@
+actions:
+- get-integer: null
+- env-assign: null
+build-type: option
+default: 0x8000000
+default-by-variant:
+- value: 0x8100000
+  variants:
+  - arm/stm32h757i-eval-m4
+enabled-by: true
+format: '{:#010x}'
+links: []
+name: STM32H7_MEMORY_FLASH_ORIGIN
+description: |
+  Origin address of the internal flash.
+type: build
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
diff --git a/spec/build/bsps/arm/stm32h7/optmemflashsz.yml b/spec/build/bsps/arm/stm32h7/optmemflashsz.yml
index 627543f9a8..5bb89abb33 100644
--- a/spec/build/bsps/arm/stm32h7/optmemflashsz.yml
+++ b/spec/build/bsps/arm/stm32h7/optmemflashsz.yml
@@ -3,7 +3,11 @@ actions:
 - env-assign: null
 build-type: option
 default: 0x200000
-default-by-variant: []
+default-by-variant:
+default-by-variant:
+- value: 0x100000
+  variants:
+  - arm/stm32h757i-eval-m4
 enabled-by: true
 format: '{:#010x}'
 links: []
diff --git a/spec/build/bsps/arm/stm32h7/optpwrsupply.yml b/spec/build/bsps/arm/stm32h7/optpwrsupply.yml
index 76888fc1ca..c974654366 100644
--- a/spec/build/bsps/arm/stm32h7/optpwrsupply.yml
+++ b/spec/build/bsps/arm/stm32h7/optpwrsupply.yml
@@ -8,6 +8,7 @@ default-by-variant:
   variants:
   - arm/stm32h7b3i-dk
   - arm/stm32h757i-eval
+  - arm/stm32h757i-eval-m4
 enabled-by: true
 format: '{}'
 links: []
diff --git a/spec/build/bsps/arm/stm32h7/optusart1gpioregs.yml b/spec/build/bsps/arm/stm32h7/optusart1gpioregs.yml
index e389efe6a9..233a5ac813 100644
--- a/spec/build/bsps/arm/stm32h7/optusart1gpioregs.yml
+++ b/spec/build/bsps/arm/stm32h7/optusart1gpioregs.yml
@@ -10,6 +10,7 @@ default-by-variant:
 - value: GPIOB
   variants:
   - arm/stm32h757i-eval
+  - arm/stm32h757i-eval-m4
 enabled-by: true
 format: '{}'
 links: []
diff --git a/spec/build/bsps/arm/stm32h7/optvariant.yml b/spec/build/bsps/arm/stm32h7/optvariant.yml
index fd77d26f7f..ade5d5931d 100644
--- a/spec/build/bsps/arm/stm32h7/optvariant.yml
+++ b/spec/build/bsps/arm/stm32h7/optvariant.yml
@@ -20,6 +20,7 @@ default-by-variant:
 - value: STM32H757xx
   variants:
     - arm/stm32h757i-eval
+    - arm/stm32h757i-eval-m4
 enabled-by: true
 format: '{}'
 links: []
-- 
2.25.1



More information about the devel mailing list