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 e1e9ee113 bsp/stm32f74x: Fix RAM and DTCM description
e1e9ee113 is described below

commit e1e9ee113619e2521d4f64968f31cb2ef98983f6
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Fri Jan 24 15:49:07 2025 +0100

    bsp/stm32f74x: Fix RAM and DTCM description
    
    Start or RAM and size of DTCM were taken from STM32F76x series.
    
    DTCM should be 64KB
    and RAM1 should start at 0x20010000
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 .../nucleo-f746zg/link/include/memory_regions.ld.h |  2 +-
 hw/bsp/nucleo-f746zg/syscfg.yml                    |  2 +-
 .../link/include/mcu_config.ld.h}                  | 33 +++++++++++-----------
 .../link/include/memory_regions.ld.h               |  2 +-
 hw/bsp/stm32f7discovery/syscfg.yml                 |  2 +-
 5 files changed, 20 insertions(+), 21 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 32e5efe16..c1301e2ac 100644
--- a/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
+++ b/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
@@ -22,7 +22,7 @@
 
 #ifdef STACK_REGION
     DTCM (rwx) :  ORIGIN = 0x20000000, LENGTH = (64K - STACK_SIZE)
-    STACK_RAM (rw) : ORIGIN = 0x20020000 - STACK_SIZE, LENGTH = STACK_SIZE
+    STACK_RAM (rw) : ORIGIN = 0x20010000 - STACK_SIZE, LENGTH = STACK_SIZE
 #else
     DTCM (rwx) :  ORIGIN = 0x20000000, LENGTH = 64K
 #endif
diff --git a/hw/bsp/nucleo-f746zg/syscfg.yml b/hw/bsp/nucleo-f746zg/syscfg.yml
index 7a863eb35..aba218cba 100644
--- a/hw/bsp/nucleo-f746zg/syscfg.yml
+++ b/hw/bsp/nucleo-f746zg/syscfg.yml
@@ -27,7 +27,7 @@ syscfg.defs:
         value: 8
 
 syscfg.vals:
-    MCU_RAM_START: 0x20020000
+    MCU_RAM_START: 0x20010000
     MCU_RAM_SIZE: 240K
     REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG
     CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS
diff --git a/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h 
b/hw/bsp/stm32f7discovery/link/include/mcu_config.ld.h
similarity index 57%
copy from hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
copy to hw/bsp/stm32f7discovery/link/include/mcu_config.ld.h
index 32e5efe16..bf87b06bc 100644
--- a/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
+++ b/hw/bsp/stm32f7discovery/link/include/mcu_config.ld.h
@@ -17,22 +17,21 @@
  * 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 = 0x20020000 - STACK_SIZE, LENGTH = STACK_SIZE
-#else
-    DTCM (rwx) :  ORIGIN = 0x20000000, LENGTH = 64K
-#endif
-    ITCM (rx)  :  ORIGIN = 0x00000000, LENGTH = 16K
+/*
+ * Memory regions placed in DTCM
+ * If stack or core data or other section should be place in RAM
+ * <target_name>/link/include/target_config.ld.h should just do:
+ *  #undef BSSNZ_RAM
+ *  #undef COREBSS_RAM
+ *  #undef COREDATA_RAM
+ *  #undef STACK_REGION
+ *  #undef VECTOR_RELOCATION_RAM DTCM
+ */
 
-#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);
+#define BSSNZ_RAM DTCM
+#define COREBSS_RAM DTCM
+#define COREDATA_RAM DTCM
+#define STACK_REGION DTCM
+#define VECTOR_RELOCATION_RAM DTCM
 
-#endif
+#define TEXT_RAM ITCM
diff --git a/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h 
b/hw/bsp/stm32f7discovery/link/include/memory_regions.ld.h
similarity index 95%
copy from hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
copy to hw/bsp/stm32f7discovery/link/include/memory_regions.ld.h
index 32e5efe16..c1301e2ac 100644
--- a/hw/bsp/nucleo-f746zg/link/include/memory_regions.ld.h
+++ b/hw/bsp/stm32f7discovery/link/include/memory_regions.ld.h
@@ -22,7 +22,7 @@
 
 #ifdef STACK_REGION
     DTCM (rwx) :  ORIGIN = 0x20000000, LENGTH = (64K - STACK_SIZE)
-    STACK_RAM (rw) : ORIGIN = 0x20020000 - STACK_SIZE, LENGTH = STACK_SIZE
+    STACK_RAM (rw) : ORIGIN = 0x20010000 - STACK_SIZE, LENGTH = STACK_SIZE
 #else
     DTCM (rwx) :  ORIGIN = 0x20000000, LENGTH = 64K
 #endif
diff --git a/hw/bsp/stm32f7discovery/syscfg.yml 
b/hw/bsp/stm32f7discovery/syscfg.yml
index 878ea583a..22ee4dfcc 100644
--- a/hw/bsp/stm32f7discovery/syscfg.yml
+++ b/hw/bsp/stm32f7discovery/syscfg.yml
@@ -27,7 +27,7 @@ syscfg.defs:
         value: 8
 
 syscfg.vals:
-    MCU_RAM_START: 0x20020000
+    MCU_RAM_START: 0x20010000
     MCU_RAM_SIZE: 240K
     REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG
     CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS

Reply via email to