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

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new afa5c7c65b6 arch/arm/imxrt: rt118x ocram heap size fix
afa5c7c65b6 is described below

commit afa5c7c65b66dfc064c5a26d220652c850977da4
Author: Ari Kimari <[email protected]>
AuthorDate: Fri Oct 2 14:37:02 2026 +0300

    arch/arm/imxrt: rt118x ocram heap size fix
    
    Fix OCRAM heap for rt118x
    
    Signed-off-by: Ari Kimari <[email protected]>
---
 arch/arm/src/imxrt/hardware/rt118x/imxrt118x_memorymap.h |  1 -
 arch/arm/src/imxrt/imxrt_allocateheap.c                  | 10 ++++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/imxrt/hardware/rt118x/imxrt118x_memorymap.h 
b/arch/arm/src/imxrt/hardware/rt118x/imxrt118x_memorymap.h
index fbd7deb5711..622f442275e 100644
--- a/arch/arm/src/imxrt/hardware/rt118x/imxrt118x_memorymap.h
+++ b/arch/arm/src/imxrt/hardware/rt118x/imxrt118x_memorymap.h
@@ -57,7 +57,6 @@
 /* The first 16 KB of OCRAM1 is reserved by the boot ROM */
 
 #define IMXRT_OCRAM_BASE                (IMXRT_OCRAM1_BASE + 0x4000)
-#define IMXRT_OCRAM_SIZE                (512 * 1024 - 0x4000)
 
 /* WAKEUPMIX Peripheral Domain (0x4200_0000 - 0x42FF_FFFF) ******************/
 
diff --git a/arch/arm/src/imxrt/imxrt_allocateheap.c 
b/arch/arm/src/imxrt/imxrt_allocateheap.c
index 2fca4332358..ce55ef85662 100644
--- a/arch/arm/src/imxrt/imxrt_allocateheap.c
+++ b/arch/arm/src/imxrt/imxrt_allocateheap.c
@@ -129,7 +129,8 @@
  * The pieces of the OCRAM used for DTCM and ITCM DTCM and ITCM memory spaces
  */
 
-#if defined(CONFIG_ARCH_FAMILY_IMXRT117x)
+#if defined(CONFIG_ARCH_FAMILY_IMXRT117x) || \
+    defined(CONFIG_ARCH_FAMILY_IMXRT118x)
 # define _IMXRT_OCRAM_BASE IMXRT_OCRAM_BASE
 #elif defined(IMXRT_OCRAM2_BASE)
 # define _IMXRT_OCRAM_BASE IMXRT_OCRAM2_BASE
@@ -177,7 +178,12 @@ extern const uint32_t _ram_size[];    /* See linker script 
*/
 #  define PRIMARY_RAM_SIZE     ((uint32_t)_ram_size)
 #elif defined(CONFIG_IMXRT_OCRAM_PRIMARY)
 #  define PRIMARY_RAM_START    _IMXRT_OCRAM_BASE
-#  define PRIMARY_RAM_SIZE     IMXRT_OCRAM_SIZE - (CONFIG_ITCM_USED + 
CONFIG_DTCM_USED)
+#  if defined(CONFIG_ARCH_FAMILY_IMXRT118x)
+#    define PRIMARY_RAM_SIZE   IMXRT_OCRAM_SIZE
+#  else
+#    define PRIMARY_RAM_SIZE   IMXRT_OCRAM_SIZE - \
+                               (CONFIG_ITCM_USED + CONFIG_DTCM_USED)
+#  endif
 #  define IMXRT_OCRAM_ASSIGNED 1
 #elif defined(CONFIG_IMXRT_SDRAM_PRIMARY)
 #  define PRIMARY_RAM_START    CONFIG_IMXRT_SDRAM_START /* CONFIG_RAM_START */

Reply via email to