2020-12-10 11:02:26 +08:00
|
|
|
/* Define the flash max size */
|
2020-12-25 17:23:26 +08:00
|
|
|
__max_flash_size = 1024k;
|
2020-12-10 11:02:26 +08:00
|
|
|
|
2020-12-25 17:23:26 +08:00
|
|
|
__data_ram_size = 8k;
|
2020-12-19 10:45:03 +08:00
|
|
|
__stack_ram_size = 4k;
|
2020-12-25 17:23:26 +08:00
|
|
|
__comm_ram_size = 83k;
|
2020-12-19 10:45:03 +08:00
|
|
|
__heap_ram_size = 29k;
|
2020-12-15 23:43:04 +08:00
|
|
|
|
2020-12-10 11:02:26 +08:00
|
|
|
__base = 0x10000000;
|
|
|
|
|
2020-12-19 10:45:03 +08:00
|
|
|
__data_vma = 0x11000;
|
|
|
|
__stack_vma = __data_vma + __data_ram_size;
|
|
|
|
__comm_vma = __stack_vma + __stack_ram_size;
|
2020-12-15 23:43:04 +08:00
|
|
|
__heap_vma = __comm_vma + __comm_ram_size;
|
|
|
|
|
|
|
|
__ram1_vma = 0x50000;
|
2020-12-10 11:02:26 +08:00
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
init : org = __base, len = 512
|
|
|
|
flash(rx) : org = __base + 512, len = __max_flash_size
|
2020-12-15 23:43:04 +08:00
|
|
|
comm(rx) : org = __comm_vma, len = __comm_ram_size
|
|
|
|
|
2020-12-19 10:45:03 +08:00
|
|
|
data : org = __data_vma, len = __data_ram_size
|
|
|
|
stack : org = __stack_vma, len = __stack_ram_size
|
2020-12-15 23:43:04 +08:00
|
|
|
heap : org = __heap_vma, len = __heap_ram_size
|
|
|
|
ram1(rx) : org = __ram1_vma, len = 0x7a00
|
2020-12-10 11:02:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
.init : {
|
|
|
|
*(.reset)
|
|
|
|
} > init
|
|
|
|
|
2020-12-15 23:43:04 +08:00
|
|
|
.ram1 __ram1_vma : {
|
2020-12-10 11:02:26 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
/* section information for initial */
|
|
|
|
__rt_init_start = .;
|
|
|
|
KEEP(*(SORT(.rti_fn*)))
|
|
|
|
__rt_init_end = .;
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
__fsymtab_start = .;
|
|
|
|
KEEP(*(FSymTab))
|
|
|
|
__fsymtab_end = .;
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
__vsymtab_start = .;
|
|
|
|
KEEP(*(VSymTab))
|
|
|
|
__vsymtab_end = .;
|
2020-12-15 23:43:04 +08:00
|
|
|
|
2021-01-27 14:37:57 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
PROVIDE(__ctors_start__ = .);
|
|
|
|
KEEP (*(SORT(.init_array.*)))
|
|
|
|
KEEP (*(.init_array))
|
|
|
|
PROVIDE(__ctors_end__ = .);
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
*components*drivers**.o (.text*)
|
|
|
|
*components.o (.text*)
|
|
|
|
*idle.o (.text*)
|
|
|
|
*object.o (.text*)
|
|
|
|
*scheduler.o (.text*)
|
2020-12-15 23:43:04 +08:00
|
|
|
} > ram1 AT > flash
|
|
|
|
|
2021-01-27 14:37:57 +08:00
|
|
|
.comm __comm_vma : {
|
2021-01-20 19:28:35 +08:00
|
|
|
. = ALIGN(4);
|
2020-12-30 17:43:23 +08:00
|
|
|
KEEP(*(.vector))
|
2021-01-26 16:06:21 +08:00
|
|
|
EXCLUDE_FILE(*components*finsh**.o *components*libc**.o *dfs*filesystems**.o
|
|
|
|
*romfs.o *lib_a**.o *divdi3.o *moddi3.o *divdf3.o *muldf3.o *eqtf2.o *getf2.o
|
2021-01-20 19:28:35 +08:00
|
|
|
*letf2.o *multf3.o *subtf3.o *fixtfsi.o *floatsitf.o *extenddftf2.o
|
|
|
|
*trunctfdf2.o *_clzsi2.o *cp-demangle.o *unwind*.o) *(.text)
|
2020-12-30 17:43:23 +08:00
|
|
|
*finsh*shell.o (.text*)
|
2021-01-20 19:28:35 +08:00
|
|
|
*(.text.unlikely)
|
|
|
|
*(.text.startup)
|
2021-01-26 16:06:21 +08:00
|
|
|
EXCLUDE_FILE (*components*libc**.o *dfs*filesystems**.o *romfs.o *lib_a**.o
|
|
|
|
*cp-demangle.o *divdf3.o *muldf3.o *multf3.o *unwind*.o *_clz.o) *(.rodata)
|
2021-01-20 19:28:35 +08:00
|
|
|
*(.rodata.name)
|
2021-01-26 16:06:21 +08:00
|
|
|
EXCLUDE_FILE(*lib_a**.o *cp-demangle.o *cp-demangle.o) *(.rodata.str1.4)
|
2021-01-20 19:28:35 +08:00
|
|
|
EXCLUDE_FILE(*lib_a**.o *unwind*.o) *(.srodata)
|
2020-12-15 23:43:04 +08:00
|
|
|
*(.rela*)
|
|
|
|
*(.data*)
|
2021-01-26 16:06:21 +08:00
|
|
|
*(.sdata*)
|
2020-12-10 11:02:26 +08:00
|
|
|
} > comm AT > flash
|
|
|
|
|
|
|
|
.bss (NOLOAD):
|
|
|
|
{
|
|
|
|
__bss_start = .;
|
|
|
|
*(COMMON)
|
|
|
|
*(.bss)
|
|
|
|
*(.sbss)
|
|
|
|
*(.buf*)
|
|
|
|
__bss_end = .;
|
|
|
|
} > data
|
|
|
|
__bss_size = __bss_end - __bss_start;
|
|
|
|
|
|
|
|
.stack (NOLOAD) : {
|
|
|
|
__irq_stack_start = .;
|
2020-12-19 10:45:03 +08:00
|
|
|
. = __stack_ram_size;
|
2020-12-10 11:02:26 +08:00
|
|
|
__irq_stack = .;
|
|
|
|
} > stack
|
|
|
|
__irq_stack_size = __irq_stack - __irq_stack_start;
|
|
|
|
|
2020-12-25 17:23:26 +08:00
|
|
|
.heap (NOLOAD) : {
|
2020-12-15 23:43:04 +08:00
|
|
|
__heap_start = .;
|
|
|
|
. = __heap_ram_size;
|
|
|
|
__heap_end = .;
|
|
|
|
} > heap
|
2020-12-25 17:23:26 +08:00
|
|
|
|
|
|
|
.flash : {
|
|
|
|
*(.text*)
|
|
|
|
*(.rodata*)
|
2021-01-20 19:28:35 +08:00
|
|
|
*(.srodata*)
|
2020-12-25 17:23:26 +08:00
|
|
|
. = ALIGN(512);
|
|
|
|
} > flash
|
2020-12-10 11:02:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Calc the lma */
|
|
|
|
__bank_size = SIZEOF(.flash);
|
|
|
|
__comm_lma = LOADADDR(.comm);
|
2020-12-15 23:43:04 +08:00
|
|
|
__comm_size = SIZEOF(.comm);
|
|
|
|
__ram1_lma = LOADADDR(.ram1);
|
2021-01-27 14:37:57 +08:00
|
|
|
__ram1_size = SIZEOF(.ram1);
|