From 9c74080124ac8665a084ad39c252a5b0b6d2fcc7 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 1 Aug 2024 13:59:42 +0300 Subject: [PATCH] variants/GENERIC_STM32H747_M4: Update linker_script to support DRAM firmware. To load the M4 firmware into SDRAM, we must ensure the linker script does not include any loadable sections that are placed in the shared memory region. If such sections exist, the ELF loader will overwrite the shared memory region when loading the firmware. Additionally, the Open-AMP section is no longer required, as the resource table is now populated manually in resource_table_init. Therefore, this section can be removed. Signed-off-by: iabdalkader --- variants/GENERIC_STM32H747_M4/linker_script.ld | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/variants/GENERIC_STM32H747_M4/linker_script.ld b/variants/GENERIC_STM32H747_M4/linker_script.ld index f93b6e2e6..d05b0095b 100644 --- a/variants/GENERIC_STM32H747_M4/linker_script.ld +++ b/variants/GENERIC_STM32H747_M4/linker_script.ld @@ -91,16 +91,12 @@ SECTIONS __bss_end__ = .; _ebss = .; } > RAM - .openamp_section (NOLOAD) : { - . = ABSOLUTE(0x38000000); - *(.resource_table) - } >RAM_D3 AT > FLASH - .pdm_section (NOLOAD) : { - . = ABSOLUTE(0x3800FC00); - *(.pdm_buffer) - } > RAM_D3 - .heap (COPY): + .pdm_section 0x3800FC00 (NOLOAD): { + *(.pdm_buffer) + } > RAM_D3 + + .heap (NOLOAD): { __end__ = .; PROVIDE(end = .); @@ -108,7 +104,8 @@ SECTIONS . = ORIGIN(RAM) + LENGTH(RAM) - 0x400; __HeapLimit = .; } > RAM - .stack_dummy (COPY): + + .stack_dummy (NOLOAD): { *(.stack*) } > RAM