From 53fccb56c955d971c45feaedcac482be2e623eac Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 30 Dec 2025 12:47:05 +0100 Subject: [PATCH] boards/{nrf53|stm32h7}: mark shmem region as NOLOAD Shmem region lives in RAM and should not be load in FLASH. This fixes the issue with wrong binary size when build AMP configurations with RPTUN enabled. Before this change shmem region was exported by objcopy to binary file which caused the bin size to be huge and impossible to flash. Signed-off-by: raiden00pl --- boards/arm/nrf53/common/scripts/flash_app.ld | 2 +- boards/arm/nrf53/nrf5340-audio-dk/scripts/flash_app.ld | 2 +- boards/arm/nrf53/nrf5340-dk/scripts/flash_app.ld | 2 +- boards/arm/nrf53/thingy53/scripts/flash_app.ld | 2 +- boards/arm/stm32h7/nucleo-h745zi/scripts/flash.ld | 2 +- boards/arm/stm32h7/portenta-h7/scripts/flash.ld | 2 +- boards/arm/stm32h7/stm32h745i-disco/scripts/flash.ld | 2 +- boards/arm/stm32h7/stm32h750b-dk/scripts/flash.ld | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/boards/arm/nrf53/common/scripts/flash_app.ld b/boards/arm/nrf53/common/scripts/flash_app.ld index 23355645e7c..439a5d7a0ad 100644 --- a/boards/arm/nrf53/common/scripts/flash_app.ld +++ b/boards/arm/nrf53/common/scripts/flash_app.ld @@ -126,7 +126,7 @@ SECTIONS /* Shmem */ - .shmem : + .shmem (NOLOAD): { . = ALIGN(4); *(.shmem); diff --git a/boards/arm/nrf53/nrf5340-audio-dk/scripts/flash_app.ld b/boards/arm/nrf53/nrf5340-audio-dk/scripts/flash_app.ld index 0f76c01ea86..f7f911b9283 100644 --- a/boards/arm/nrf53/nrf5340-audio-dk/scripts/flash_app.ld +++ b/boards/arm/nrf53/nrf5340-audio-dk/scripts/flash_app.ld @@ -103,7 +103,7 @@ SECTIONS /* Shmem */ - .shmem : + .shmem (NOLOAD): { . = ALIGN(4); *(.shmem); diff --git a/boards/arm/nrf53/nrf5340-dk/scripts/flash_app.ld b/boards/arm/nrf53/nrf5340-dk/scripts/flash_app.ld index 9176663d750..44b055b92f9 100644 --- a/boards/arm/nrf53/nrf5340-dk/scripts/flash_app.ld +++ b/boards/arm/nrf53/nrf5340-dk/scripts/flash_app.ld @@ -103,7 +103,7 @@ SECTIONS /* Shmem */ - .shmem : + .shmem (NOLOAD): { . = ALIGN(4); *(.shmem); diff --git a/boards/arm/nrf53/thingy53/scripts/flash_app.ld b/boards/arm/nrf53/thingy53/scripts/flash_app.ld index 7ea55a35d1a..da340683689 100644 --- a/boards/arm/nrf53/thingy53/scripts/flash_app.ld +++ b/boards/arm/nrf53/thingy53/scripts/flash_app.ld @@ -103,7 +103,7 @@ SECTIONS /* Shmem */ - .shmem : + .shmem (NOLOAD): { . = ALIGN(4); *(.shmem); diff --git a/boards/arm/stm32h7/nucleo-h745zi/scripts/flash.ld b/boards/arm/stm32h7/nucleo-h745zi/scripts/flash.ld index a4df8b00110..88ac407d181 100644 --- a/boards/arm/stm32h7/nucleo-h745zi/scripts/flash.ld +++ b/boards/arm/stm32h7/nucleo-h745zi/scripts/flash.ld @@ -117,7 +117,7 @@ SECTIONS _ebss = ABSOLUTE(.); } > sram - .shmem : + .shmem (NOLOAD): { . = ALIGN(4); *(.shmem); diff --git a/boards/arm/stm32h7/portenta-h7/scripts/flash.ld b/boards/arm/stm32h7/portenta-h7/scripts/flash.ld index c290d19025c..c68cfc1684a 100644 --- a/boards/arm/stm32h7/portenta-h7/scripts/flash.ld +++ b/boards/arm/stm32h7/portenta-h7/scripts/flash.ld @@ -123,7 +123,7 @@ SECTIONS _ebss = ABSOLUTE(.); } > sram - .shmem : + .shmem (NOLOAD): { . = ALIGN(4); *(.shmem); diff --git a/boards/arm/stm32h7/stm32h745i-disco/scripts/flash.ld b/boards/arm/stm32h7/stm32h745i-disco/scripts/flash.ld index 73540b36851..f9f81c972c9 100644 --- a/boards/arm/stm32h7/stm32h745i-disco/scripts/flash.ld +++ b/boards/arm/stm32h7/stm32h745i-disco/scripts/flash.ld @@ -193,7 +193,7 @@ SECTIONS } > sram #ifdef CONFIG_STM32H7_CORTEXM4_ENABLED - .shmem : + .shmem (NOLOAD): { . = ALIGN(4); *(.shmem); diff --git a/boards/arm/stm32h7/stm32h750b-dk/scripts/flash.ld b/boards/arm/stm32h7/stm32h750b-dk/scripts/flash.ld index ccbf78a82ba..b8e1798bb33 100644 --- a/boards/arm/stm32h7/stm32h750b-dk/scripts/flash.ld +++ b/boards/arm/stm32h7/stm32h750b-dk/scripts/flash.ld @@ -192,7 +192,7 @@ SECTIONS } > sram #ifdef CONFIG_STM32H7_CORTEXM4_ENABLED - .shmem : + .shmem (NOLOAD): { . = ALIGN(4); *(.shmem);