feat: H7 support (#5738)
Co-authored-by: Richard Li <richard.li@ces.hk> Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
co-authored by
Richard Li
philmoz
raphaelcoeffic
parent
5a15ffb017
commit
3d25c2a0f8
@@ -7,13 +7,25 @@ INCLUDE definitions.ld
|
||||
/* Define output sections */
|
||||
SECTIONS
|
||||
{
|
||||
/* The startup code goes first into FLASH */
|
||||
/* ISR vector to be loaded */
|
||||
.isr_vector :
|
||||
{
|
||||
_sisr_vector = .;
|
||||
KEEP(*(.isr_vector))
|
||||
|
||||
. = ALIGN(4);
|
||||
_eisr_vector = .;
|
||||
} > REGION_ISR_VECT AT> REGION_TEXT_STORAGE
|
||||
|
||||
_isr_load = LOADADDR(.isr_vector);
|
||||
|
||||
/* The program code and other data goes into FLASH */
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
FILL(0xFFFF)
|
||||
CREATE_OBJECT_SYMBOLS
|
||||
|
||||
_stext = .;
|
||||
KEEP(*(.version))
|
||||
KEEP(*(.bootversiondata))
|
||||
|
||||
@@ -21,7 +33,9 @@ SECTIONS
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .; /* define a global symbols at end of code */
|
||||
} >FLASH
|
||||
} > REGION_TEXT AT> REGION_TEXT_STORAGE
|
||||
|
||||
_text_load = LOADADDR(.text);
|
||||
|
||||
INCLUDE common_sections.ld
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
PROVIDE(__exidx_end = .);
|
||||
} > REGION_TEXT AT> REGION_TEXT_STORAGE
|
||||
|
||||
.reboot_buffer(NOLOAD) :
|
||||
/* Bootstrap code to load ISR vector and code sections */
|
||||
.bootstrap :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
*(.reboot*)
|
||||
} > REGION_DATA
|
||||
*(.bootstrap)
|
||||
} > REGION_TEXT_STORAGE
|
||||
|
||||
/* Initialized data sections goes into RAM, load LMA copy after code */
|
||||
.data :
|
||||
@@ -32,7 +32,7 @@
|
||||
_sidata = LOADADDR(.data);
|
||||
|
||||
/* Uninitialized data section */
|
||||
.bss(NOLOAD) :
|
||||
.bss(NOLOAD) : AT (ADDR(.bss))
|
||||
{
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .bss secion */
|
||||
@@ -43,8 +43,8 @@ _sidata = LOADADDR(.data);
|
||||
_ebss = .; /* define a global symbol at bss end */
|
||||
} > REGION_BSS
|
||||
|
||||
/* collect all uninitialized .ram sections (force DMA accessible) */
|
||||
.ram (NOLOAD) :
|
||||
/* collect all uninitialized .ram sections */
|
||||
.ram (NOLOAD) : AT (ADDR(.ram))
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sram = .;
|
||||
@@ -55,6 +55,12 @@ _sidata = LOADADDR(.data);
|
||||
|
||||
INCLUDE extra_sections.ld
|
||||
|
||||
/* Seems to be the safest place for all targets (see AN2606) */
|
||||
.reboot_buffer (ORIGIN(REGION_DATA) + LENGTH(REGION_DATA) - 4) (NOLOAD) : AT (ADDR(.reboot_buffer))
|
||||
{
|
||||
KEEP(*(.reboot*))
|
||||
} > REGION_DATA
|
||||
|
||||
/* Remove information from the standard libraries */
|
||||
/DISCARD/ :
|
||||
{
|
||||
|
||||
@@ -9,13 +9,21 @@ SECTIONS
|
||||
{
|
||||
.bootloader :
|
||||
{
|
||||
FILL(0xFFFF)
|
||||
KEEP(*(.bootloader))
|
||||
. = BOOTLOADER_SIZE;
|
||||
} > REGION_BOOTLOADER
|
||||
|
||||
/* Used only with H7 */
|
||||
.firmware_header :
|
||||
{
|
||||
KEEP(*(.fwdescription))
|
||||
} > REGION_TEXT AT> REGION_TEXT_STORAGE
|
||||
|
||||
/* ISR vector to be loaded */
|
||||
.isr_vector :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sisr_vector = .;
|
||||
KEEP(*(.isr_vector))
|
||||
|
||||
@@ -42,11 +50,9 @@ SECTIONS
|
||||
|
||||
_text_load = LOADADDR(.text);
|
||||
|
||||
/* Firmware bootstrap code to load ISR vector and code sections */
|
||||
.bootstrap :
|
||||
{
|
||||
*(.bootstrap)
|
||||
} > REGION_TEXT_STORAGE
|
||||
|
||||
INCLUDE common_sections.ld
|
||||
|
||||
.text_end_section : {} > REGION_TEXT AT > REGION_TEXT_STORAGE
|
||||
_firmware_length = LOADADDR(.text_end_section) - LOADADDR(.firmware_header);
|
||||
_firmware_version = _text_load;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* SDRAM definitions */
|
||||
SDRAM_START = DEFINED(__SDRAM_START__) ? __SDRAM_START__ : 0xC0000000;
|
||||
SDRAM_SIZE = DEFINED(__SDRAM_SIZE__) ? __SDRAM_SIZE__ : 8192K;
|
||||
|
||||
/* Highest heap address */
|
||||
HEAP_ADDRESS = SDRAM_START + SDRAM_SIZE;
|
||||
|
||||
/* Highest address of the user mode stack */
|
||||
STACK_ADDRESS = ORIGIN(DTCMRAM) + LENGTH(DTCMRAM) - 16; /* end of RAM */
|
||||
|
||||
/* Maximum bootloader code size */
|
||||
BOOTLOADER_SIZE = 0x20000;
|
||||
|
||||
/* Required amount of stack for interrupt stack (Main stack) */
|
||||
MAIN_STACK_SIZE = 8192;
|
||||
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
MIN_HEAP_SIZE = 4096k; /* required amount of heap */
|
||||
|
||||
/* Specify the memory areas */
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
|
||||
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
|
||||
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
|
||||
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
|
||||
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
|
||||
SDRAM (rwx) : ORIGIN = SDRAM_START, LENGTH = SDRAM_SIZE
|
||||
}
|
||||
|
||||
REGION_ALIAS("REGION_TEXT_STORAGE", FLASH);
|
||||
REGION_ALIAS("REGION_TEXT", FLASH);
|
||||
REGION_ALIAS("REGION_DATA", DTCMRAM);
|
||||
REGION_ALIAS("REGION_BSS", RAM_D1);
|
||||
REGION_ALIAS("REGION_RAM", RAM_D1);
|
||||
@@ -0,0 +1,58 @@
|
||||
|
||||
/* Task stacks */
|
||||
.ccm (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sccm = .;
|
||||
*(.ccm)
|
||||
. = ALIGN(4);
|
||||
_eccm = .;
|
||||
} > DTCMRAM
|
||||
|
||||
/* Reserve stack space */
|
||||
.stack (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
. = . + MAIN_STACK_SIZE;
|
||||
. = ALIGN(4);
|
||||
} > DTCMRAM
|
||||
|
||||
/* Fast code */
|
||||
.iram (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_siram = .;
|
||||
*(.iram)
|
||||
. = ALIGN(4);
|
||||
_eiram = .;
|
||||
} > ITCMRAM AT> REGION_TEXT_STORAGE
|
||||
|
||||
_stext_iram = LOADADDR(.iram);
|
||||
|
||||
/* Extra DMA section */
|
||||
.dram (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_s_dram = .;
|
||||
*(.dram)
|
||||
. = ALIGN(4);
|
||||
_e_dram = .;
|
||||
} > RAM_D2
|
||||
|
||||
.sdram (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
*(.sdram)
|
||||
*(.sdram*)
|
||||
*(.sdram_rodata)
|
||||
*(.sdram_rodata*)
|
||||
|
||||
. = ALIGN(4);
|
||||
_esdram = .;
|
||||
|
||||
/* Reserve heap space in RAM */
|
||||
. = . + MIN_HEAP_SIZE;
|
||||
. = ALIGN(4);
|
||||
} > SDRAM
|
||||
|
||||
PROVIDE(_heap_start = _esdram);
|
||||
@@ -0,0 +1,40 @@
|
||||
/* SDRAM definitions */
|
||||
SDRAM_START = DEFINED(__SDRAM_START__) ? __SDRAM_START__ : 0xC0000000;
|
||||
SDRAM_SIZE = DEFINED(__SDRAM_SIZE__) ? __SDRAM_SIZE__ : 8192K;
|
||||
|
||||
/* Highest heap address */
|
||||
HEAP_ADDRESS = SDRAM_START + SDRAM_SIZE;
|
||||
|
||||
/* Highest address of the user mode stack */
|
||||
STACK_ADDRESS = ORIGIN(DTCMRAM) + LENGTH(DTCMRAM); /* end of RAM */
|
||||
|
||||
/* Maximum bootloader code size */
|
||||
BOOTLOADER_SIZE = 0x20000;
|
||||
|
||||
/* Required amount of stack for interrupt stack (Main stack) */
|
||||
MAIN_STACK_SIZE = 8192;
|
||||
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
MIN_HEAP_SIZE = 4096k; /* required amount of heap */
|
||||
/*_Min_Stack_Size = 0x400; /* required amount of stack */
|
||||
|
||||
/* Specify the memory areas */
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
|
||||
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
|
||||
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
|
||||
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
|
||||
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
|
||||
SDRAM (rwx) : ORIGIN = SDRAM_START, LENGTH = SDRAM_SIZE
|
||||
QSPIFLASH (rx) : ORIGIN = 0x90000000, LENGTH = 8M
|
||||
}
|
||||
|
||||
REGION_ALIAS("REGION_BOOTLOADER", FLASH);
|
||||
REGION_ALIAS("REGION_ISR_VECT", DTCMRAM);
|
||||
REGION_ALIAS("REGION_TEXT_STORAGE", QSPIFLASH);
|
||||
REGION_ALIAS("REGION_TEXT", SDRAM);
|
||||
REGION_ALIAS("REGION_DATA", DTCMRAM);
|
||||
REGION_ALIAS("REGION_BSS", RAM_D1);
|
||||
REGION_ALIAS("REGION_RAM", RAM_D1);
|
||||
@@ -0,0 +1,39 @@
|
||||
/* PSRAM definitions */
|
||||
PSRAM_START = DEFINED(__PSRAM_START__) ? __PSRAM_START__ : 0x90000000;
|
||||
PSRAM_SIZE = DEFINED(__PSRAM_SIZE__) ? __PSRAM_SIZE__ : 32678K;
|
||||
|
||||
NORFLASH_START = 0x70000000;
|
||||
NORFLASH_SIZE = 128M;
|
||||
|
||||
/* Highest heap address */
|
||||
HEAP_ADDRESS = PSRAM_START + PSRAM_SIZE;
|
||||
|
||||
/* Highest address of the user mode stack */
|
||||
STACK_ADDRESS = ORIGIN(DTCMRAM) + LENGTH(DTCMRAM) - 16; /* end of RAM */
|
||||
|
||||
/* Maximum bootloader code size */
|
||||
BOOTLOADER_SIZE = 0x10000;
|
||||
|
||||
/* Required amount of stack for interrupt stack (Main stack) */
|
||||
MAIN_STACK_SIZE = 8192;
|
||||
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
MIN_HEAP_SIZE = 4096k; /* required amount of heap */
|
||||
|
||||
/* Specify the memory areas */
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
|
||||
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
|
||||
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 384K
|
||||
DMA (xrw) : ORIGIN = 0x24060000, LENGTH = 72K
|
||||
PSRAM (rwx) : ORIGIN = PSRAM_START, LENGTH = PSRAM_SIZE
|
||||
}
|
||||
|
||||
REGION_ALIAS("REGION_TEXT_STORAGE", FLASH);
|
||||
REGION_ALIAS("REGION_TEXT", ITCMRAM);
|
||||
REGION_ALIAS("REGION_ISR_VECT", DTCMRAM);
|
||||
REGION_ALIAS("REGION_DATA", RAM);
|
||||
REGION_ALIAS("REGION_BSS", RAM);
|
||||
REGION_ALIAS("REGION_RAM", RAM);
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
/* Task stacks */
|
||||
.ccm (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sccm = .;
|
||||
*(.ccm)
|
||||
. = ALIGN(4);
|
||||
_eccm = .;
|
||||
} > DTCMRAM
|
||||
|
||||
/* Reserve stack space */
|
||||
.stack(NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
. = . + MAIN_STACK_SIZE;
|
||||
. = ALIGN(4);
|
||||
} > DTCMRAM
|
||||
|
||||
/* Fast code */
|
||||
.iram (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_siram = .;
|
||||
*(.iram)
|
||||
. = ALIGN(4);
|
||||
_eiram = .;
|
||||
} > ITCMRAM AT> REGION_TEXT_STORAGE
|
||||
|
||||
_stext_iram = LOADADDR(.iram);
|
||||
|
||||
/* Extra DMA section */
|
||||
.dram (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_s_dram = .;
|
||||
*(.dram)
|
||||
_e_dram = .;
|
||||
} > DMA
|
||||
|
||||
_dram_addr = ADDR(.dram);
|
||||
|
||||
.sdram (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
*(.sdram)
|
||||
*(.sdram*)
|
||||
*(.sdram_rodata)
|
||||
*(.sdram_rodata*)
|
||||
|
||||
. = ALIGN(4);
|
||||
_esdram = .;
|
||||
|
||||
/* Reserve heap space in RAM */
|
||||
. = . + MIN_HEAP_SIZE;
|
||||
. = ALIGN(4);
|
||||
} > PSRAM
|
||||
|
||||
PROVIDE(_heap_start = _esdram);
|
||||
@@ -0,0 +1,41 @@
|
||||
/* PSRAM definitions */
|
||||
PSRAM_START = DEFINED(__PSRAM_START__) ? __PSRAM_START__ : 0x90000000;
|
||||
PSRAM_SIZE = DEFINED(__PSRAM_SIZE__) ? __PSRAM_SIZE__ : 32678K;
|
||||
|
||||
NORFLASH_START = 0x70000000;
|
||||
NORFLASH_SIZE = 128M;
|
||||
|
||||
/* Highest heap address */
|
||||
HEAP_ADDRESS = PSRAM_START + PSRAM_SIZE;
|
||||
|
||||
/* Highest address of the user mode stack */
|
||||
STACK_ADDRESS = ORIGIN(DTCMRAM) + LENGTH(DTCMRAM);
|
||||
|
||||
/* Maximum bootloader code size */
|
||||
BOOTLOADER_SIZE = 0x10000;
|
||||
|
||||
/* Required amount of stack for interrupt stack (Main stack) */
|
||||
MAIN_STACK_SIZE = 8192;
|
||||
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
MIN_HEAP_SIZE = 4096k; /* required amount of heap */
|
||||
|
||||
/* Specify the memory areas */
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
|
||||
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K /* SRAM1 = 128K */
|
||||
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K /* SRAM3 = 128K */
|
||||
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 384K /* SRAM1 + SRAM2 + SRAM3 */
|
||||
DMA (xrw) : ORIGIN = 0x24060000, LENGTH = 72K /* SRAM4 */
|
||||
PSRAM (rwx) : ORIGIN = PSRAM_START, LENGTH = PSRAM_SIZE
|
||||
NORFLASH (rwx) : ORIGIN = 0x70000000, LENGTH = 128M
|
||||
}
|
||||
|
||||
REGION_ALIAS("REGION_BOOTLOADER", FLASH);
|
||||
REGION_ALIAS("REGION_TEXT_STORAGE", NORFLASH);
|
||||
REGION_ALIAS("REGION_TEXT", PSRAM);
|
||||
REGION_ALIAS("REGION_ISR_VECT", DTCMRAM);
|
||||
REGION_ALIAS("REGION_DATA", RAM);
|
||||
REGION_ALIAS("REGION_BSS", RAM);
|
||||
REGION_ALIAS("REGION_RAM", RAM);
|
||||
Reference in New Issue
Block a user