From b9f7261f22d2c04d0add7c1902e9b7ec4f80b72e Mon Sep 17 00:00:00 2001 From: bkleiner Date: Fri, 11 Aug 2023 16:04:33 +0200 Subject: [PATCH] add ram section for functions --- src/core/project.h | 2 ++ src/system/at32f435/flash_layout.ld | 2 +- src/system/stm32f405/flash_layout.ld | 2 +- src/system/stm32f411/flash_layout.ld | 2 +- src/system/stm32f722/flash_layout.ld | 4 +--- src/system/stm32f745/flash_layout.ld | 4 +--- src/system/stm32f765/flash_layout.ld | 4 +--- src/system/stm32h743/flash_layout.ld | 4 +--- 8 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/core/project.h b/src/core/project.h index ebd2ccadf..defebc37e 100644 --- a/src/core/project.h +++ b/src/core/project.h @@ -24,3 +24,5 @@ #else #define DMA_RAM #endif + +#define RAM_FUNC __attribute__((section(".ram_functions"))) \ No newline at end of file diff --git a/src/system/at32f435/flash_layout.ld b/src/system/at32f435/flash_layout.ld index 0b67668a6..8cc3f6926 100644 --- a/src/system/at32f435/flash_layout.ld +++ b/src/system/at32f435/flash_layout.ld @@ -118,7 +118,7 @@ SECTIONS _sdata = .; /* create a global symbol at data start */ *(.data) /* .data sections */ *(.data*) /* .data* sections */ - + *(.ram_functions) . = ALIGN(4); _edata = .; /* define a global symbol at data end */ } >RAM AT> FLASH diff --git a/src/system/stm32f405/flash_layout.ld b/src/system/stm32f405/flash_layout.ld index ef3a3d667..ae0e1672f 100644 --- a/src/system/stm32f405/flash_layout.ld +++ b/src/system/stm32f405/flash_layout.ld @@ -143,7 +143,7 @@ SECTIONS _sdata = .; /* create a global symbol at data start */ *(.data) /* .data sections */ *(.data*) /* .data* sections */ - + *(.ram_functions) . = ALIGN(4); _edata = .; /* define a global symbol at data end */ } >RAM AT> FLASH diff --git a/src/system/stm32f411/flash_layout.ld b/src/system/stm32f411/flash_layout.ld index 96423120e..7702ee10a 100644 --- a/src/system/stm32f411/flash_layout.ld +++ b/src/system/stm32f411/flash_layout.ld @@ -141,7 +141,7 @@ SECTIONS _sdata = .; /* create a global symbol at data start */ *(.data) /* .data sections */ *(.data*) /* .data* sections */ - + *(.ram_functions) . = ALIGN(4); _edata = .; /* define a global symbol at data end */ } >RAM AT> FLASH diff --git a/src/system/stm32f722/flash_layout.ld b/src/system/stm32f722/flash_layout.ld index 2f86ec716..0aa25c803 100644 --- a/src/system/stm32f722/flash_layout.ld +++ b/src/system/stm32f722/flash_layout.ld @@ -125,9 +125,7 @@ SECTIONS _sdata = .; /* create a global symbol at data start */ *(.data) /* .data sections */ *(.data*) /* .data* sections */ - *(.RamFunc) /* .RamFunc sections */ - *(.RamFunc*) /* .RamFunc* sections */ - + *(.ram_functions) . = ALIGN(4); _edata = .; /* define a global symbol at data end */ diff --git a/src/system/stm32f745/flash_layout.ld b/src/system/stm32f745/flash_layout.ld index 2d7b5de69..472628763 100644 --- a/src/system/stm32f745/flash_layout.ld +++ b/src/system/stm32f745/flash_layout.ld @@ -125,9 +125,7 @@ SECTIONS _sdata = .; /* create a global symbol at data start */ *(.data) /* .data sections */ *(.data*) /* .data* sections */ - *(.RamFunc) /* .RamFunc sections */ - *(.RamFunc*) /* .RamFunc* sections */ - + *(.ram_functions) . = ALIGN(4); _edata = .; /* define a global symbol at data end */ diff --git a/src/system/stm32f765/flash_layout.ld b/src/system/stm32f765/flash_layout.ld index f872e4e6d..3232882bf 100644 --- a/src/system/stm32f765/flash_layout.ld +++ b/src/system/stm32f765/flash_layout.ld @@ -126,9 +126,7 @@ SECTIONS _sdata = .; /* create a global symbol at data start */ *(.data) /* .data sections */ *(.data*) /* .data* sections */ - *(.RamFunc) /* .RamFunc sections */ - *(.RamFunc*) /* .RamFunc* sections */ - + *(.ram_functions) . = ALIGN(4); _edata = .; /* define a global symbol at data end */ diff --git a/src/system/stm32h743/flash_layout.ld b/src/system/stm32h743/flash_layout.ld index 5fc81e68a..24a1f74d9 100644 --- a/src/system/stm32h743/flash_layout.ld +++ b/src/system/stm32h743/flash_layout.ld @@ -127,9 +127,7 @@ SECTIONS _sdata = .; /* create a global symbol at data start */ *(.data) /* .data sections */ *(.data*) /* .data* sections */ - *(.RamFunc) /* .RamFunc sections */ - *(.RamFunc*) /* .RamFunc* sections */ - + *(.ram_functions) . = ALIGN(4); _edata = .; /* define a global symbol at data end */