修复mico-sdk错误

This commit is contained in:
nhkefus
2025-03-11 15:54:45 +08:00
parent 3422912129
commit 2ccb892a1c
2152 changed files with 664341 additions and 702636 deletions

View File

@@ -6,170 +6,170 @@
* duplicated in any form, in whole or in part, without the prior written
* permission of MXCHIP Corporation.
*
*/
Reset_Handler = _start;
ENTRY( _start );
/* Include memory map */
INCLUDE memory.ld
SECTIONS
{
/* Data transfer area for serial flash writing app - at start of memory */
.sflash_trnsf :
{
KEEP(*(*.data_config))
KEEP(*(*.data_transfer))
}>SRAM AT> SRAM
.vectors :
{
. = ALIGN(512);
link_interrupt_vectors_location = .;
KEEP(*(*.interrupt_vector_table))
}>SRAM AT> SRAM
.text :
{
. = ALIGN(4);
link_code_location = .;
KEEP(*(.text.irq ))
*(.text .text.* .gnu.linkonce.t.*)
link_code_end = .;
. = ALIGN(0x4);
link_const_variable_data_location = .;
wifi_firmware_image_location = .;
*(.rodata.wifi_firmware_image)
wifi_firmware_image_end = .;
*(.rodata .rodata.* .gnu.linkonce.r.*)
link_const_variable_data_end = .;
. = ALIGN(0x4);
link_constructors_location = .;
KEEP(*(.preinit_array))
KEEP(*(.init_array))
KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*crtend.o(.ctors))
link_constructors_end = .;
. = ALIGN(0x4);
link_destructors_location = .;
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*crtend.o(.dtors))
link_destructors_end = .;
. = ALIGN(16);
}>SRAM AT> SRAM
/*
* The .ARM.exidx and .ARM.exidx sections are used for C++ exception handling.
* It is located here for completeness. Bare-metal ARM projects
* typically cannot afford the overhead associated with C++
* exceptions handling.
*/
.ARM.exidx :
{
__exidx_start = ALIGN(4);
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
__exidx_end = .;
} >SRAM AT> SRAM
.ARM.extab :
{
__extab_start = ALIGN(4);
*(.ARM.extab*)
__extab_end = .;
} > SRAM AT> SRAM
.fast : /* This section contains code that is run from RAM after being loaded from flash - functions can be put in this section with the C attribute: __attribute__ ((section (".fast"))) */
{
link_run_from_ram_code_flash_location = LOADADDR( .fast ); /* This is the location in flash of the code */
link_run_from_ram_code_ram_location = .;
*(.fast .fast.* .text.fastcode)
link_run_from_ram_code_ram_end = .;
}>SRAM AT> SRAM
.data : /* Contains the non-zero initialised global variables */
{
link_global_data_initial_values = LOADADDR( .data ); /* This is the location in flash of the initial values of global variables */
link_global_data_start = .;
*(.data*)
link_global_data_end = .;
. = ALIGN(., 4);
}>SRAM AT> SRAM
.bss : /* Zero initialised memory used for zero initialised variables */
{
link_bss_location = ALIGN(., 4);
*(.bss*)
*(COMMON)
link_bss_end = .;
. = ALIGN(., 4);
}> SRAM AT> SRAM
.stack : /* Contains the initial stack */
{
link_stack_location = ALIGN(., 4);
*(.stack)
. = ALIGN(MAX(link_stack_location + __STACKSIZE__ , .), 4);
link_stack_end = .;
}> SRAM AT> SRAM
/DISCARD/ :
{
*(.ARM.attributes*)
*(.comment)
*(.init)
*(.preinit)
*(.fini)
*(.fini_array)
*(.ARM.exidx*)
*(.gnu.linkonce.armexidx.*)
*(.eh_frame_hdr)
*(.eh_frame)
*(.gnu.linkonce.armextab.*)
*(.v4_bx)
*(.vfp11_veneer)
*(.gcc_except_table)
*(.eh_frame_hdr)
*(.eh_frame)
*(.glue*)
}
}
/* Declare libc Heap to start at end of allocated RAM */
PROVIDE( _heap = link_stack_end );
/* End of the heap is top of RAM, aligned 8 byte */
PROVIDE( _eheap = ALIGN( ORIGIN( SRAM ) + LENGTH( SRAM ) - 8, 8 ) );
PROVIDE( total_app_image_size = LOADADDR( .data ) - ORIGIN( SRAM ) + link_global_data_end - link_global_data_start );
PROVIDE( wifi_firmware_image_size_from_link = wifi_firmware_image_end - wifi_firmware_image_location );
/* ThreadX aliases */
PROVIDE( __RAM_segment_used_end__ = link_stack_end );
PROVIDE( __tx_free_memory_start = link_stack_end );
PROVIDE( __tx_vectors = link_interrupt_vectors_location );
PROVIDE( wifi_firmware_image = 0 );
*/
Reset_Handler = _start;
ENTRY( _start );
/* Include memory map */
INCLUDE memory.ld
SECTIONS
{
/* Data transfer area for serial flash writing app - at start of memory */
.sflash_trnsf :
{
KEEP(*(*.data_config))
KEEP(*(*.data_transfer))
}>SRAM AT> SRAM
.vectors :
{
. = ALIGN(512);
link_interrupt_vectors_location = .;
KEEP(*(*.interrupt_vector_table))
}>SRAM AT> SRAM
.text :
{
. = ALIGN(4);
link_code_location = .;
KEEP(*(.text.irq ))
*(.text .text.* .gnu.linkonce.t.*)
link_code_end = .;
. = ALIGN(0x4);
link_const_variable_data_location = .;
wifi_firmware_image_location = .;
*(.rodata.wifi_firmware_image)
wifi_firmware_image_end = .;
*(.rodata .rodata.* .gnu.linkonce.r.*)
link_const_variable_data_end = .;
. = ALIGN(0x4);
link_constructors_location = .;
KEEP(*(.preinit_array))
KEEP(*(.init_array))
KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*crtend.o(.ctors))
link_constructors_end = .;
. = ALIGN(0x4);
link_destructors_location = .;
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*crtend.o(.dtors))
link_destructors_end = .;
. = ALIGN(16);
}>SRAM AT> SRAM
/*
* The .ARM.exidx and .ARM.exidx sections are used for C++ exception handling.
* It is located here for completeness. Bare-metal ARM projects
* typically cannot afford the overhead associated with C++
* exceptions handling.
*/
.ARM.exidx :
{
__exidx_start = ALIGN(4);
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
__exidx_end = .;
} >SRAM AT> SRAM
.ARM.extab :
{
__extab_start = ALIGN(4);
*(.ARM.extab*)
__extab_end = .;
} > SRAM AT> SRAM
.fast : /* This section contains code that is run from RAM after being loaded from flash - functions can be put in this section with the C attribute: __attribute__ ((section (".fast"))) */
{
link_run_from_ram_code_flash_location = LOADADDR( .fast ); /* This is the location in flash of the code */
link_run_from_ram_code_ram_location = .;
*(.fast .fast.* .text.fastcode)
link_run_from_ram_code_ram_end = .;
}>SRAM AT> SRAM
.data : /* Contains the non-zero initialised global variables */
{
link_global_data_initial_values = LOADADDR( .data ); /* This is the location in flash of the initial values of global variables */
link_global_data_start = .;
*(.data*)
link_global_data_end = .;
. = ALIGN(., 4);
}>SRAM AT> SRAM
.bss : /* Zero initialised memory used for zero initialised variables */
{
link_bss_location = ALIGN(., 4);
*(.bss*)
*(COMMON)
link_bss_end = .;
. = ALIGN(., 4);
}> SRAM AT> SRAM
.stack : /* Contains the initial stack */
{
link_stack_location = ALIGN(., 4);
*(.stack)
. = ALIGN(MAX(link_stack_location + __STACKSIZE__ , .), 4);
link_stack_end = .;
}> SRAM AT> SRAM
/DISCARD/ :
{
*(.ARM.attributes*)
*(.comment)
*(.init)
*(.preinit)
*(.fini)
*(.fini_array)
*(.ARM.exidx*)
*(.gnu.linkonce.armexidx.*)
*(.eh_frame_hdr)
*(.eh_frame)
*(.gnu.linkonce.armextab.*)
*(.v4_bx)
*(.vfp11_veneer)
*(.gcc_except_table)
*(.eh_frame_hdr)
*(.eh_frame)
*(.glue*)
}
}
/* Declare libc Heap to start at end of allocated RAM */
PROVIDE( _heap = link_stack_end );
/* End of the heap is top of RAM, aligned 8 byte */
PROVIDE( _eheap = ALIGN( ORIGIN( SRAM ) + LENGTH( SRAM ) - 8, 8 ) );
PROVIDE( total_app_image_size = LOADADDR( .data ) - ORIGIN( SRAM ) + link_global_data_end - link_global_data_start );
PROVIDE( wifi_firmware_image_size_from_link = wifi_firmware_image_end - wifi_firmware_image_location );
/* ThreadX aliases */
PROVIDE( __RAM_segment_used_end__ = link_stack_end );
PROVIDE( __tx_free_memory_start = link_stack_end );
PROVIDE( __tx_vectors = link_interrupt_vectors_location );
PROVIDE( wifi_firmware_image = 0 );

View File

@@ -1,220 +1,220 @@
/*
* Script for GNU linker.
* Describes layout of sections, location of stack.
*
* In this case vectors are at location 0 (reset @ 0x08)
*
*
*
* +------------+ 0x0040000
* Vect redirect 32
* +------------+
*
* +------------+ 0x00400020
* data |
* end
* |(heap) |
* . .
* . .
* |(heap limit)|
*
* |- - - - - - |
* stack bottom 256k
* +------------+
*
*
* +------------+ 0x0000000
* |Bootloader |
* | | 64k
* +------------+ 0x0010000
* | Para 1 | 4k
* +------------+
* | Para 2 | 4k
* +------------+ 0x0012000
* |vectors |
* | |
* |------------+
* |text |
* |data | 632k
* | |
* +------------+
*
*
* +------------+ 0x00B0000
* | |
* | |
* | OTA TEMP |
* | |
* | |
* | | 320k
* +------------+
*/
/* Split memory into area for vectors and ram */
MEMORY
{
flash (rx) : ORIGIN = 0x0012000, LENGTH = 546936
ram (rwx): ORIGIN = 0x00400020, LENGTH = 256k - 32
}
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_vector_start);
_vector_start = 0x0012000;
SECTIONS
{
/* vectors go to vectors region */
. = 0x0012000;
.vectors :
{
KEEP(*(*.vectors))
} > flash
/* instructions go to the text region*/
. = ALIGN(0x8);
/* code, instructions.for example: i=i+1; */
.text :
{
*(.text*)
KEEP(*(.init))
KEEP(*(.fini))
/* .ctors */
*crtbegin.o(.ctors)
*crtbegin?.o(.ctors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
*(SORT(.ctors.*))
*(.ctors)
/* .dtors */
*crtbegin.o(.dtors)
*crtbegin?.o(.dtors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
*(SORT(.dtors.*))
*(.dtors)
*(.rodata*)
KEEP(*(.eh_frame*))
} > flash
.ARM.extab ALIGN(8) :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > flash
.ARM.exidx ALIGN(8):
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > flash
_begin_data = .;
.data : AT ( _begin_data )
{
__data_start__ = .;
_sdata = .;
*(.data*)
. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
/* init data */
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(4);
/* finit data */
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP(*(SORT(.fini_array.*)))
KEEP(*(.fini_array))
PROVIDE_HIDDEN (__fini_array_end = .);
KEEP(*(.jcr*))
SORT(CONSTRUCTORS)
/* All data end */
__data_end__ = .;
_edata = .;
KEEP(*(.dummydata))
} >ram
/* Loader will copy data from _flash_begin to _ram_begin..ram_end */
_data_flash_begin = LOADADDR(.data);
_data_ram_begin = ADDR(.data);
_data_ram_end = .;
/* uninitialized data section - global int i; */
.bss ALIGN(8):
{
. = ALIGN(4);
_bss_start = .;
__bss_start__ = .;
_sbss = .;
*(.bss*)
*(COMMON)
. = ALIGN(4);
_bss_end = .;
__bss_end__ = .;
_ebss = .;
} > ram /* in RAM */
. = ALIGN (8);
_empty_ram = .;
/* This symbol defines end of code/data sections. Heap starts here. */
PROVIDE(end = .);
PROVIDE(_heap_start = .);
.heap (COPY):
{
__end__ = .;
end = __end__;
*(.heap*)
__HeapLimit = .;
} > ram
.stack_dummy (COPY):
{
*(.stack*)
} > ram
/* _stack symbol defines initial stack bottom addres. Stack grows to lower addresses.
Typically you set this to be top of your RAM. Note: code never checks, if stack
grows into heap area!
*/
PROVIDE(_stack_unused = 0x440000 - 0x3F0 - 0x7F0 - 0xFF0 - 0x3F0 - 0x10); /* 0x10*/
PROVIDE(_stack_svc = 0x440000 - 0x3F0 - 0x7F0 - 0xFF0 - 0x3F0); /* 0x3F0*/
PROVIDE(_stack_irq = 0x440000 - 0x3F0 - 0x7F0 - 0xFF0); /* 0xFF0*/
PROVIDE(_stack_fiq = 0x440000 - 0x3F0 - 0x7F0); /* 0x7F0*/
PROVIDE(_stack_sys = 0x440000 - 0x3F0); /* 0x3F0*/
PROVIDE(_heap_end = _stack_unused);
PROVIDE(_heap_len = _heap_end - _heap_start);
ASSERT ((_heap_len > 0x19000 - 1 ), "Error: No room left for the heap") /*heap must bigger than 100k*/
__StackTop = ORIGIN(ram) + LENGTH(ram);
_estack = __StackTop;
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop);
}
GROUP(
libstdc++.a
libsupc++.a
libgcc.a
libg.a
libc.a
libm.a
libnosys.a
/*
* Script for GNU linker.
* Describes layout of sections, location of stack.
*
* In this case vectors are at location 0 (reset @ 0x08)
*
*
*
* +------------+ 0x0040000
* Vect redirect 32
* +------------+
*
* +------------+ 0x00400020
* data |
* end
* |(heap) |
* . .
* . .
* |(heap limit)|
*
* |- - - - - - |
* stack bottom 256k
* +------------+
*
*
* +------------+ 0x0000000
* |Bootloader |
* | | 64k
* +------------+ 0x0010000
* | Para 1 | 4k
* +------------+
* | Para 2 | 4k
* +------------+ 0x0012000
* |vectors |
* | |
* |------------+
* |text |
* |data | 632k
* | |
* +------------+
*
*
* +------------+ 0x00B0000
* | |
* | |
* | OTA TEMP |
* | |
* | |
* | | 320k
* +------------+
*/
/* Split memory into area for vectors and ram */
MEMORY
{
flash (rx) : ORIGIN = 0x0012000, LENGTH = 546936
ram (rwx): ORIGIN = 0x00400020, LENGTH = 256k - 32
}
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_vector_start);
_vector_start = 0x0012000;
SECTIONS
{
/* vectors go to vectors region */
. = 0x0012000;
.vectors :
{
KEEP(*(*.vectors))
} > flash
/* instructions go to the text region*/
. = ALIGN(0x8);
/* code, instructions.for example: i=i+1; */
.text :
{
*(.text*)
KEEP(*(.init))
KEEP(*(.fini))
/* .ctors */
*crtbegin.o(.ctors)
*crtbegin?.o(.ctors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
*(SORT(.ctors.*))
*(.ctors)
/* .dtors */
*crtbegin.o(.dtors)
*crtbegin?.o(.dtors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
*(SORT(.dtors.*))
*(.dtors)
*(.rodata*)
KEEP(*(.eh_frame*))
} > flash
.ARM.extab ALIGN(8) :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > flash
.ARM.exidx ALIGN(8):
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > flash
_begin_data = .;
.data : AT ( _begin_data )
{
__data_start__ = .;
_sdata = .;
*(.data*)
. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
/* init data */
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(4);
/* finit data */
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP(*(SORT(.fini_array.*)))
KEEP(*(.fini_array))
PROVIDE_HIDDEN (__fini_array_end = .);
KEEP(*(.jcr*))
SORT(CONSTRUCTORS)
/* All data end */
__data_end__ = .;
_edata = .;
KEEP(*(.dummydata))
} >ram
/* Loader will copy data from _flash_begin to _ram_begin..ram_end */
_data_flash_begin = LOADADDR(.data);
_data_ram_begin = ADDR(.data);
_data_ram_end = .;
/* uninitialized data section - global int i; */
.bss ALIGN(8):
{
. = ALIGN(4);
_bss_start = .;
__bss_start__ = .;
_sbss = .;
*(.bss*)
*(COMMON)
. = ALIGN(4);
_bss_end = .;
__bss_end__ = .;
_ebss = .;
} > ram /* in RAM */
. = ALIGN (8);
_empty_ram = .;
/* This symbol defines end of code/data sections. Heap starts here. */
PROVIDE(end = .);
PROVIDE(_heap_start = .);
.heap (COPY):
{
__end__ = .;
end = __end__;
*(.heap*)
__HeapLimit = .;
} > ram
.stack_dummy (COPY):
{
*(.stack*)
} > ram
/* _stack symbol defines initial stack bottom addres. Stack grows to lower addresses.
Typically you set this to be top of your RAM. Note: code never checks, if stack
grows into heap area!
*/
PROVIDE(_stack_unused = 0x440000 - 0x3F0 - 0x7F0 - 0xFF0 - 0x3F0 - 0x10); /* 0x10*/
PROVIDE(_stack_svc = 0x440000 - 0x3F0 - 0x7F0 - 0xFF0 - 0x3F0); /* 0x3F0*/
PROVIDE(_stack_irq = 0x440000 - 0x3F0 - 0x7F0 - 0xFF0); /* 0xFF0*/
PROVIDE(_stack_fiq = 0x440000 - 0x3F0 - 0x7F0); /* 0x7F0*/
PROVIDE(_stack_sys = 0x440000 - 0x3F0); /* 0x3F0*/
PROVIDE(_heap_end = _stack_unused);
PROVIDE(_heap_len = _heap_end - _heap_start);
ASSERT ((_heap_len > 0x19000 - 1 ), "Error: No room left for the heap") /*heap must bigger than 100k*/
__StackTop = ORIGIN(ram) + LENGTH(ram);
_estack = __StackTop;
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop);
}
GROUP(
libstdc++.a
libsupc++.a
libgcc.a
libg.a
libc.a
libm.a
libnosys.a
)