Skip to content

Commit 36008de

Browse files
committed
added custom ld file for samd51 no crystal, ext flash
1 parent eda3423 commit 36008de

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
GNU linker script for SAMD51x19 (512K flash, 192K RAM)
3+
*/
4+
5+
/* Specify the memory areas */
6+
MEMORY
7+
{
8+
/* Leave 16KiB for the bootloader. 8K for user data and 256b for user config.*/
9+
FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 512K - 16K - 8K - 256
10+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K
11+
}
12+
13+
/* top end of the stack */
14+
/* stack must be double-word (8 byte) aligned */
15+
_estack = ORIGIN(RAM) + LENGTH(RAM) - 8;
16+
_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4;
17+
18+
/* define output sections */
19+
SECTIONS
20+
{
21+
/* The program code and other data goes into FLASH */
22+
.text :
23+
{
24+
. = ALIGN(4);
25+
_sfixed = .;
26+
KEEP(*(.vectors)) /* isr vector table */
27+
*(.text) /* .text sections (code) */
28+
*(.text*) /* .text* sections (code) */
29+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
30+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
31+
32+
. = ALIGN(4);
33+
} >FLASH
34+
35+
.ARM.exidx :
36+
{
37+
*(.ARM.exidx*)
38+
*(.gnu.linkonce.armexidx.*)
39+
_etext = .; /* define a global symbol at end of code */
40+
_sidata = .; /* start of .data section */
41+
} > FLASH
42+
43+
/* This is the initialized data section
44+
The program executes knowing that the data is in the RAM
45+
but the loader puts the initial values in the FLASH (inidata).
46+
It is one task of the startup to copy the initial values from FLASH to RAM. */
47+
.data : AT ( _sidata )
48+
{
49+
. = ALIGN(4);
50+
_srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
51+
*(.ramfunc)
52+
*(.ramfunc*)
53+
*(.data) /* .data sections */
54+
*(.data*) /* .data* sections */
55+
56+
. = ALIGN(4);
57+
_erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
58+
} >RAM
59+
60+
/* Uninitialized data section */
61+
.bss :
62+
{
63+
. = ALIGN(4);
64+
_sbss = .;
65+
_szero = .; /* define a global symbol at bss start; used by startup code */
66+
*(.bss)
67+
*(.bss*)
68+
*(COMMON)
69+
70+
. = ALIGN(4);
71+
_ezero = .; /* define a global symbol at bss end; used by startup code */
72+
_ebss = .;
73+
} >RAM
74+
75+
/* this just checks there is enough RAM for a minimal stack */
76+
.stack :
77+
{
78+
. = ALIGN(4);
79+
. = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */
80+
. = ALIGN(4);
81+
} >RAM
82+
83+
.ARM.attributes 0 : { *(.ARM.attributes) }
84+
}

0 commit comments

Comments
 (0)