mirror of
https://github.com/candle-usb/candleLight_fw.git
synced 2025-01-28 06:02:52 +08:00
a0caf93e50
There is a pair of USB requests ( GS_USB_BREQ_GET_USER_ID and _SET_USER_ID) that is not supported by the linux driver, and not used by any known software : https://github.com/candle-usb/candleLight_fw/issues/91 Since the firmware returns a unique serial #, there doesn't appear to be any use case for assigning a user ID. Using a whole flash page for that purpose can be wasteful on bigger targets . This removes all the relevant code and adjusts the linker scripts accordingly.
142 lines
2.4 KiB
Plaintext
142 lines
2.4 KiB
Plaintext
__STACK_SIZE = 32K;
|
|
__HEAP_SIZE = 64K;
|
|
|
|
__FLASH_SIZE = 512K;
|
|
|
|
MEMORY
|
|
{
|
|
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = __FLASH_SIZE
|
|
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 144K
|
|
}
|
|
|
|
ENTRY(Reset_Handler)
|
|
|
|
SECTIONS
|
|
{
|
|
.text :
|
|
{
|
|
KEEP(*(.vectors))
|
|
*(.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 :
|
|
{
|
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
|
} > FLASH
|
|
|
|
__exidx_start = .;
|
|
.ARM.exidx :
|
|
{
|
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
|
} > FLASH
|
|
__exidx_end = .;
|
|
|
|
.copy.table :
|
|
{
|
|
. = ALIGN(4);
|
|
__copy_table_start__ = .;
|
|
LONG (__etext)
|
|
LONG (__data_start__)
|
|
LONG (__data_end__ - __data_start__)
|
|
__copy_table_end__ = .;
|
|
} > FLASH
|
|
|
|
.zero.table :
|
|
{
|
|
. = ALIGN(4);
|
|
__zero_table_start__ = .;
|
|
__zero_table_end__ = .;
|
|
} > FLASH
|
|
|
|
__etext = ALIGN (4);
|
|
|
|
.data : AT (__etext)
|
|
{
|
|
__data_start__ = .;
|
|
*(vtable)
|
|
*(.data)
|
|
*(.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*))
|
|
. = ALIGN(4);
|
|
/* All data end */
|
|
__data_end__ = .;
|
|
|
|
} > RAM
|
|
|
|
.bss :
|
|
{
|
|
. = ALIGN(4);
|
|
__bss_start__ = .;
|
|
*(.bss)
|
|
*(.bss.*)
|
|
*(COMMON)
|
|
. = ALIGN(4);
|
|
__bss_end__ = .;
|
|
} > RAM AT > RAM
|
|
|
|
.heap (COPY) :
|
|
{
|
|
. = ALIGN(8);
|
|
__end__ = .;
|
|
PROVIDE(end = .);
|
|
. = . + __HEAP_SIZE;
|
|
. = ALIGN(8);
|
|
__HeapLimit = .;
|
|
} > RAM
|
|
|
|
.stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE) (COPY) :
|
|
{
|
|
. = ALIGN(8);
|
|
__StackLimit = .;
|
|
. = . + __STACK_SIZE;
|
|
. = ALIGN(8);
|
|
__StackTop = .;
|
|
} > RAM
|
|
PROVIDE(__stack = __StackTop);
|
|
|
|
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
|
}
|