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
The following commit(s) were added to refs/heads/master by this push:
new 3529871a8 boot/startup: Fix link problems for stm32f7/stm32h7
3529871a8 is described below
commit 3529871a89c3187984e26b4e20e7f054c49b3707
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Mon Mar 24 10:28:23 2025 +0100
boot/startup: Fix link problems for stm32f7/stm32h7
There was discrepancy in memory_regions.ld.h files for
few bsp's. File gave an impression that it can be
included twice in generated linker script and
second inclusion would provide definition for
region related symbols.
It may be done this way in the future but now symbols
are added in user_sections.ld.h instead.
For stm32h753 bsp was expecting symbols _dtcmram_start and
_itcmram_start while linker script provided _dtcm_start and
_itcm_start. Now later symbols are used to make it consistent
with other bsp's.
Signed-off-by: Jerzy Kasenberg <[email protected]>
---
hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h | 12 ------------
hw/bsp/nucleo-f767zi/link/include/memory_regions.ld.h | 12 ------------
hw/bsp/nucleo-h723zg/include/bsp/bsp.h | 4 ++--
hw/bsp/nucleo-h723zg/src/hal_bsp.c | 4 ++--
hw/bsp/stm32f7discovery/link/include/memory_regions.ld.h | 12 ------------
.../{stm32h7xx => stm32f7xx}/link/include/user_sections.ld.h | 8 ++++----
hw/mcu/stm/stm32f7xx/syscfg.yml | 3 +++
hw/mcu/stm/stm32h7xx/link/include/user_sections.ld.h | 8 ++++----
8 files changed, 15 insertions(+), 48 deletions(-)
diff --git a/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
b/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
index c1301e2ac..d0f697772 100644
--- a/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
+++ b/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
@@ -17,9 +17,6 @@
* under the License.
*/
-/* Fragment that goes to MEMORY section */
-#ifndef SECTIONS_REGIONS
-
#ifdef STACK_REGION
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x20010000 - STACK_SIZE, LENGTH = STACK_SIZE
@@ -27,12 +24,3 @@
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
#endif
ITCM (rx) : ORIGIN = 0x00000000, LENGTH = 16K
-
-#else
-/* Fragment that goes into SECTIONS, can provide definition and sections if
needed */
- _itcm_start = ORIGIN(ITCM);
- _itcm_end = ORIGIN(ITCM) + LENGTH(ITCM);
- _dtcm_start = ORIGIN(DTCM);
- _dtcm_end = ORIGIN(DTCM) + LENGTH(DTCM);
-
-#endif
diff --git a/hw/bsp/nucleo-f767zi/link/include/memory_regions.ld.h
b/hw/bsp/nucleo-f767zi/link/include/memory_regions.ld.h
index 0c209b03e..1b487fa23 100644
--- a/hw/bsp/nucleo-f767zi/link/include/memory_regions.ld.h
+++ b/hw/bsp/nucleo-f767zi/link/include/memory_regions.ld.h
@@ -17,9 +17,6 @@
* under the License.
*/
-/* Fragment that goes to MEMORY section */
-#ifndef SECTIONS_REGIONS
-
#ifdef STACK_REGION
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = (128K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x20020000 - STACK_SIZE, LENGTH = STACK_SIZE
@@ -27,12 +24,3 @@
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
#endif
ITCM (rx) : ORIGIN = 0x00000000, LENGTH = 16K
-
-#else
-/* Fragment that goes into SECTIONS, can provide definition and sections if
needed */
- _itcm_start = ORIGIN(ITCM);
- _itcm_end = ORIGIN(ITCM) + LENGTH(ITCM);
- _dtcm_start = ORIGIN(DTCM);
- _dtcm_end = ORIGIN(DTCM) + LENGTH(DTCM);
-
-#endif
diff --git a/hw/bsp/nucleo-h723zg/include/bsp/bsp.h
b/hw/bsp/nucleo-h723zg/include/bsp/bsp.h
index 56d591c0f..f58ddddc8 100644
--- a/hw/bsp/nucleo-h723zg/include/bsp/bsp.h
+++ b/hw/bsp/nucleo-h723zg/include/bsp/bsp.h
@@ -35,8 +35,8 @@ extern "C" {
#define bssnz_t sec_bss_nz_core
extern uint8_t _ram_start;
-extern uint8_t _dtcmram_start;
-extern uint8_t _itcmram_start;
+extern uint8_t _dtcm_start;
+extern uint8_t _itcm_start;
extern uint8_t _ram2_start;
#define RAM_SIZE (320 * 1024)
diff --git a/hw/bsp/nucleo-h723zg/src/hal_bsp.c
b/hw/bsp/nucleo-h723zg/src/hal_bsp.c
index 1a04da2d6..c427e7c35 100644
--- a/hw/bsp/nucleo-h723zg/src/hal_bsp.c
+++ b/hw/bsp/nucleo-h723zg/src/hal_bsp.c
@@ -174,11 +174,11 @@ static const struct hal_bsp_mem_dump dump_cfg[] = {
.hbmd_size = RAM_SIZE,
},
[1] = {
- .hbmd_start = &_dtcmram_start,
+ .hbmd_start = &_dtcm_start,
.hbmd_size = DTCMRAM_SIZE,
},
[2] = {
- .hbmd_start = &_itcmram_start,
+ .hbmd_start = &_itcm_start,
.hbmd_size = ITCMRAM_SIZE,
},
};
diff --git a/hw/bsp/stm32f7discovery/link/include/memory_regions.ld.h
b/hw/bsp/stm32f7discovery/link/include/memory_regions.ld.h
index c1301e2ac..d0f697772 100644
--- a/hw/bsp/stm32f7discovery/link/include/memory_regions.ld.h
+++ b/hw/bsp/stm32f7discovery/link/include/memory_regions.ld.h
@@ -17,9 +17,6 @@
* under the License.
*/
-/* Fragment that goes to MEMORY section */
-#ifndef SECTIONS_REGIONS
-
#ifdef STACK_REGION
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = (64K - STACK_SIZE)
STACK_RAM (rw) : ORIGIN = 0x20010000 - STACK_SIZE, LENGTH = STACK_SIZE
@@ -27,12 +24,3 @@
DTCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
#endif
ITCM (rx) : ORIGIN = 0x00000000, LENGTH = 16K
-
-#else
-/* Fragment that goes into SECTIONS, can provide definition and sections if
needed */
- _itcm_start = ORIGIN(ITCM);
- _itcm_end = ORIGIN(ITCM) + LENGTH(ITCM);
- _dtcm_start = ORIGIN(DTCM);
- _dtcm_end = ORIGIN(DTCM) + LENGTH(DTCM);
-
-#endif
diff --git a/hw/mcu/stm/stm32h7xx/link/include/user_sections.ld.h
b/hw/mcu/stm/stm32f7xx/link/include/user_sections.ld.h
similarity index 82%
copy from hw/mcu/stm/stm32h7xx/link/include/user_sections.ld.h
copy to hw/mcu/stm/stm32f7xx/link/include/user_sections.ld.h
index b5a18a10e..e1427e21f 100644
--- a/hw/mcu/stm/stm32h7xx/link/include/user_sections.ld.h
+++ b/hw/mcu/stm/stm32f7xx/link/include/user_sections.ld.h
@@ -17,7 +17,7 @@
* under the License.
*/
- _dtcmram_start = ORIGIN(DTCM);
- _dtcmram_limit = ORIGIN(DTCM) + LENGTH(DTCM);
- _itcmram_start = ORIGIN(ITCM);
- _itcmram_limit = ORIGIN(ITCM) + LENGTH(ITCM);
+ _dtcm_start = ORIGIN(DTCM);
+ _dtcm_limit = ORIGIN(DTCM) + LENGTH(DTCM);
+ _itcm_start = ORIGIN(ITCM);
+ _itcm_limit = ORIGIN(ITCM) + LENGTH(ITCM);
diff --git a/hw/mcu/stm/stm32f7xx/syscfg.yml b/hw/mcu/stm/stm32f7xx/syscfg.yml
index 698796afd..f9f58659b 100644
--- a/hw/mcu/stm/stm32f7xx/syscfg.yml
+++ b/hw/mcu/stm/stm32f7xx/syscfg.yml
@@ -134,3 +134,6 @@ syscfg.defs:
MCU_FLASH_ERASED_VAL:
description: Value read from erased flash.
value: 0xff
+
+ MCU_PATH:
+ value: '"repos/apache-mynewt-core/hw/mcu/stm/stm32f7xx"'
diff --git a/hw/mcu/stm/stm32h7xx/link/include/user_sections.ld.h
b/hw/mcu/stm/stm32h7xx/link/include/user_sections.ld.h
index b5a18a10e..e1427e21f 100644
--- a/hw/mcu/stm/stm32h7xx/link/include/user_sections.ld.h
+++ b/hw/mcu/stm/stm32h7xx/link/include/user_sections.ld.h
@@ -17,7 +17,7 @@
* under the License.
*/
- _dtcmram_start = ORIGIN(DTCM);
- _dtcmram_limit = ORIGIN(DTCM) + LENGTH(DTCM);
- _itcmram_start = ORIGIN(ITCM);
- _itcmram_limit = ORIGIN(ITCM) + LENGTH(ITCM);
+ _dtcm_start = ORIGIN(DTCM);
+ _dtcm_limit = ORIGIN(DTCM) + LENGTH(DTCM);
+ _itcm_start = ORIGIN(ITCM);
+ _itcm_limit = ORIGIN(ITCM) + LENGTH(ITCM);