boards: STM32F76xxx/STM32F77xxx linker add ITCM RAM and .ramfuncs handling

- this doesn't currently change anything, but gets us ready to start
experimenting with using the small amount of instruction tightly memory
on STM32F7
 - the .ramfuncs section works with NuttX CONFIG_ARCH_RAMFUNCS
This commit is contained in:
Daniel Agar 2020-04-05 10:34:08 -04:00
parent c9e64988b9
commit a89bba470a
6 changed files with 138 additions and 72 deletions

View File

@ -71,11 +71,13 @@
MEMORY
{
itcm (rwx) : ORIGIN = 0x00208000, LENGTH = 2016K
flash (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
sram1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
sram2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K
FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K
DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
}
OUTPUT_ARCH(arm)
@ -118,7 +120,7 @@ SECTIONS
* use the NuttX get_errno_ptr() function.
*/
__errno = get_errno_ptr;
} > flash
} > FLASH_AXIM
/*
* Init functions (static constructors and the like)
@ -127,7 +129,7 @@ SECTIONS
_sinit = ABSOLUTE(.);
KEEP(*(.init_array .init_array.*))
_einit = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
/*
* Construction data for parameters.
@ -136,16 +138,16 @@ SECTIONS
__param_start = ABSOLUTE(.);
KEEP(*(__param*))
__param_end = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
.ARM.extab : {
*(.ARM.extab*)
} > flash
} > FLASH_AXIM
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > flash
} > FLASH_AXIM
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
@ -156,7 +158,7 @@ SECTIONS
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram1 AT > flash
} > SRAM1 AT > FLASH_AXIM
.bss : {
_sbss = ABSOLUTE(.);
@ -165,7 +167,7 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > sram1
} > SRAM1
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
@ -180,4 +182,13 @@ SECTIONS
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.ramfunc : {
_sramfuncs = .;
*(.ramfunc .ramfunc.*)
. = ALIGN(4);
_eramfuncs = .;
} > ITCM_RAM AT > FLASH_AXIM
_framfuncs = LOADADDR(.ramfunc);
}

View File

@ -71,11 +71,13 @@
MEMORY
{
itcm (rwx) : ORIGIN = 0x00208000, LENGTH = 2016K
flash (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
sram1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
sram2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K
FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K
DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
}
OUTPUT_ARCH(arm)
@ -118,7 +120,7 @@ SECTIONS
* use the NuttX get_errno_ptr() function.
*/
__errno = get_errno_ptr;
} > flash
} > FLASH_AXIM
/*
* Init functions (static constructors and the like)
@ -127,7 +129,7 @@ SECTIONS
_sinit = ABSOLUTE(.);
KEEP(*(.init_array .init_array.*))
_einit = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
/*
* Construction data for parameters.
@ -136,16 +138,16 @@ SECTIONS
__param_start = ABSOLUTE(.);
KEEP(*(__param*))
__param_end = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
.ARM.extab : {
*(.ARM.extab*)
} > flash
} > FLASH_AXIM
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > flash
} > FLASH_AXIM
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
@ -156,7 +158,7 @@ SECTIONS
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram1 AT > flash
} > SRAM1 AT > FLASH_AXIM
.bss : {
_sbss = ABSOLUTE(.);
@ -165,7 +167,7 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > sram1
} > SRAM1
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
@ -180,4 +182,13 @@ SECTIONS
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.ramfunc : {
_sramfuncs = .;
*(.ramfunc .ramfunc.*)
. = ALIGN(4);
_eramfuncs = .;
} > ITCM_RAM AT > FLASH_AXIM
_framfuncs = LOADADDR(.ramfunc);
}

View File

@ -71,11 +71,13 @@
MEMORY
{
itcm (rwx) : ORIGIN = 0x00218000, LENGTH = 1952K
flash (rx) : ORIGIN = 0x08018000, LENGTH = 1952K /* start on 4th sector (1st sector for bootloader, 2 for extra storage) */
dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
sram1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
sram2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
FLASH_ITCM (rx) : ORIGIN = 0x00218000, LENGTH = 1952K
FLASH_AXIM (rx) : ORIGIN = 0x08018000, LENGTH = 1952K /* start on 4th sector (1st sector for bootloader, 2 for extra storage) */
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K
DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
}
OUTPUT_ARCH(arm)
@ -118,7 +120,7 @@ SECTIONS
* use the NuttX get_errno_ptr() function.
*/
__errno = get_errno_ptr;
} > flash
} > FLASH_AXIM
/*
* Init functions (static constructors and the like)
@ -127,7 +129,7 @@ SECTIONS
_sinit = ABSOLUTE(.);
KEEP(*(.init_array .init_array.*))
_einit = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
/*
* Construction data for parameters.
@ -136,16 +138,16 @@ SECTIONS
__param_start = ABSOLUTE(.);
KEEP(*(__param*))
__param_end = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
.ARM.extab : {
*(.ARM.extab*)
} > flash
} > FLASH_AXIM
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > flash
} > FLASH_AXIM
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
@ -156,7 +158,7 @@ SECTIONS
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram1 AT > flash
} > SRAM1 AT > FLASH_AXIM
.bss : {
_sbss = ABSOLUTE(.);
@ -165,7 +167,7 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > sram1
} > SRAM1
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
@ -180,4 +182,13 @@ SECTIONS
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.ramfunc : {
_sramfuncs = .;
*(.ramfunc .ramfunc.*)
. = ALIGN(4);
_eramfuncs = .;
} > ITCM_RAM AT > FLASH_AXIM
_framfuncs = LOADADDR(.ramfunc);
}

View File

@ -71,11 +71,13 @@
MEMORY
{
itcm (rwx) : ORIGIN = 0x00208000, LENGTH = 2016K
flash (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
sram1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
sram2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K
FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K
DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
}
OUTPUT_ARCH(arm)
@ -118,7 +120,7 @@ SECTIONS
* use the NuttX get_errno_ptr() function.
*/
__errno = get_errno_ptr;
} > flash
} > FLASH_AXIM
/*
* Init functions (static constructors and the like)
@ -127,7 +129,7 @@ SECTIONS
_sinit = ABSOLUTE(.);
KEEP(*(.init_array .init_array.*))
_einit = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
/*
* Construction data for parameters.
@ -136,16 +138,16 @@ SECTIONS
__param_start = ABSOLUTE(.);
KEEP(*(__param*))
__param_end = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
.ARM.extab : {
*(.ARM.extab*)
} > flash
} > FLASH_AXIM
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > flash
} > FLASH_AXIM
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
@ -156,7 +158,7 @@ SECTIONS
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram1 AT > flash
} > SRAM1 AT > FLASH_AXIM
.bss : {
_sbss = ABSOLUTE(.);
@ -165,7 +167,7 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > sram1
} > SRAM1
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
@ -180,4 +182,13 @@ SECTIONS
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.ramfunc : {
_sramfuncs = .;
*(.ramfunc .ramfunc.*)
. = ALIGN(4);
_eramfuncs = .;
} > ITCM_RAM AT > FLASH_AXIM
_framfuncs = LOADADDR(.ramfunc);
}

View File

@ -71,11 +71,13 @@
MEMORY
{
itcm (rwx) : ORIGIN = 0x00208000, LENGTH = 2016K
flash (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
sram1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
sram2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K
FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K
DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
}
OUTPUT_ARCH(arm)
@ -118,7 +120,7 @@ SECTIONS
* use the NuttX get_errno_ptr() function.
*/
__errno = get_errno_ptr;
} > flash
} > FLASH_AXIM
/*
* Init functions (static constructors and the like)
@ -127,7 +129,7 @@ SECTIONS
_sinit = ABSOLUTE(.);
KEEP(*(.init_array .init_array.*))
_einit = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
/*
* Construction data for parameters.
@ -136,16 +138,16 @@ SECTIONS
__param_start = ABSOLUTE(.);
KEEP(*(__param*))
__param_end = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
.ARM.extab : {
*(.ARM.extab*)
} > flash
} > FLASH_AXIM
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > flash
} > FLASH_AXIM
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
@ -156,7 +158,7 @@ SECTIONS
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram1 AT > flash
} > SRAM1 AT > FLASH_AXIM
.bss : {
_sbss = ABSOLUTE(.);
@ -165,7 +167,7 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > sram1
} > SRAM1
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
@ -180,4 +182,13 @@ SECTIONS
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.ramfunc : {
_sramfuncs = .;
*(.ramfunc .ramfunc.*)
. = ALIGN(4);
_eramfuncs = .;
} > ITCM_RAM AT > FLASH_AXIM
_framfuncs = LOADADDR(.ramfunc);
}

View File

@ -71,11 +71,13 @@
MEMORY
{
itcm (rwx) : ORIGIN = 0x00208000, LENGTH = 2016K
flash (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
sram1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
sram2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
FLASH_ITCM (rx) : ORIGIN = 0x00208000, LENGTH = 2016K
FLASH_AXIM (rx) : ORIGIN = 0x08008000, LENGTH = 2016K
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K
DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
SRAM1 (rwx) : ORIGIN = 0x20020000, LENGTH = 368K
SRAM2 (rwx) : ORIGIN = 0x2007c000, LENGTH = 16K
}
OUTPUT_ARCH(arm)
@ -118,7 +120,7 @@ SECTIONS
* use the NuttX get_errno_ptr() function.
*/
__errno = get_errno_ptr;
} > flash
} > FLASH_AXIM
/*
* Init functions (static constructors and the like)
@ -127,7 +129,7 @@ SECTIONS
_sinit = ABSOLUTE(.);
KEEP(*(.init_array .init_array.*))
_einit = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
/*
* Construction data for parameters.
@ -136,16 +138,16 @@ SECTIONS
__param_start = ABSOLUTE(.);
KEEP(*(__param*))
__param_end = ABSOLUTE(.);
} > flash
} > FLASH_AXIM
.ARM.extab : {
*(.ARM.extab*)
} > flash
} > FLASH_AXIM
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > flash
} > FLASH_AXIM
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
@ -156,7 +158,7 @@ SECTIONS
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram1 AT > flash
} > SRAM1 AT > FLASH_AXIM
.bss : {
_sbss = ABSOLUTE(.);
@ -165,7 +167,7 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > sram1
} > SRAM1
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
@ -180,4 +182,13 @@ SECTIONS
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.ramfunc : {
_sramfuncs = .;
*(.ramfunc .ramfunc.*)
. = ALIGN(4);
_eramfuncs = .;
} > ITCM_RAM AT > FLASH_AXIM
_framfuncs = LOADADDR(.ramfunc);
}