You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.1 KiB
81 lines
2.1 KiB
![]()
7 years ago
|
/* TREZORv2 firmware linker script */
|
||
![]()
8 years ago
|
|
||
![]()
7 years ago
|
ENTRY(reset_handler)
|
||
![]()
8 years ago
|
|
||
![]()
7 years ago
|
MEMORY {
|
||
![]()
7 years ago
|
FLASH (rx) : ORIGIN = 0x08040000, LENGTH = 768K
|
||
![]()
6 years ago
|
FLASH2 (r) : ORIGIN = 0x08120000, LENGTH = 896K
|
||
![]()
7 years ago
|
CCMRAM (wal) : ORIGIN = 0x10000000, LENGTH = 64K
|
||
![]()
7 years ago
|
SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 192K
|
||
![]()
7 years ago
|
}
|
||
![]()
8 years ago
|
|
||
![]()
7 years ago
|
main_stack_base = ORIGIN(SRAM) + LENGTH(SRAM); /* 8-byte aligned full descending stack */
|
||
|
_estack = main_stack_base;
|
||
![]()
8 years ago
|
|
||
![]()
7 years ago
|
/* used by the startup code to populate variables used by the C code */
|
||
|
data_lma = LOADADDR(.data);
|
||
|
data_vma = ADDR(.data);
|
||
|
data_size = SIZEOF(.data);
|
||
![]()
8 years ago
|
|
||
![]()
7 years ago
|
/* used by the startup code to wipe memory */
|
||
|
ccmram_start = ORIGIN(CCMRAM);
|
||
|
ccmram_end = ORIGIN(CCMRAM) + LENGTH(CCMRAM);
|
||
![]()
8 years ago
|
|
||
![]()
7 years ago
|
/* used by the startup code to wipe memory */
|
||
|
sram_start = ORIGIN(SRAM);
|
||
|
sram_end = ORIGIN(SRAM) + LENGTH(SRAM);
|
||
|
_ram_start = sram_start;
|
||
|
_ram_end = sram_end;
|
||
![]()
8 years ago
|
|
||
![]()
6 years ago
|
_codelen = LENGTH(FLASH) - SIZEOF(.vendorheader) - SIZEOF(.header) + SIZEOF(.flash2);
|
||
![]()
7 years ago
|
_flash_start = ORIGIN(FLASH);
|
||
|
_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
|
||
![]()
7 years ago
|
_heap_start = ADDR(.heap);
|
||
|
_heap_end = ADDR(.heap) + SIZEOF(.heap);
|
||
|
|
||
|
SECTIONS {
|
||
![]()
7 years ago
|
.vendorheader : ALIGN(4) {
|
||
![]()
7 years ago
|
KEEP(*(.vendorheader))
|
||
![]()
7 years ago
|
} >FLASH AT>FLASH
|
||
|
|
||
|
.header : ALIGN(4) {
|
||
![]()
7 years ago
|
KEEP(*(.header));
|
||
|
} >FLASH AT>FLASH
|
||
|
|
||
![]()
6 years ago
|
.flash2 : ALIGN(512) {
|
||
|
build/firmware/frozen_mpy.o(.rodata*);
|
||
![]()
6 years ago
|
build/firmware/vendor/secp256k1-zkp/src/secp256k1.o(.rodata*);
|
||
![]()
6 years ago
|
. = ALIGN(512);
|
||
|
} >FLASH2 AT>FLASH2
|
||
|
|
||
![]()
7 years ago
|
.flash : ALIGN(512) {
|
||
|
KEEP(*(.vector_table));
|
||
|
. = ALIGN(4);
|
||
|
*(.text*);
|
||
|
. = ALIGN(4);
|
||
|
*(.rodata*);
|
||
![]()
6 years ago
|
. = ALIGN(4);
|
||
|
*(.bootloader*);
|
||
![]()
7 years ago
|
. = ALIGN(512);
|
||
|
} >FLASH AT>FLASH
|
||
|
|
||
|
.data : ALIGN(4) {
|
||
|
*(.data*);
|
||
|
. = ALIGN(512);
|
||
|
} >SRAM AT>FLASH
|
||
|
|
||
|
.bss : ALIGN(4) {
|
||
|
*(.bss*);
|
||
|
. = ALIGN(4);
|
||
|
} >SRAM
|
||
|
|
||
|
.heap : ALIGN(4) {
|
||
|
. = 37K; /* this acts as a build time assertion that at least this much memory is available for heap use */
|
||
|
. = ABSOLUTE(sram_end - 16K); /* this explicitly sets the end of the heap effectively giving the stack at most 16K */
|
||
|
} >SRAM
|
||
|
|
||
|
.stack : ALIGN(8) {
|
||
|
. = 4K; /* this acts as a build time assertion that at least this much memory is available for stack use */
|
||
|
} >SRAM
|
||
|
}
|