Skip to content

Commit 535c005

Browse files
tannewtdhalbert
authored andcommitted
atmel-samd: Turn on SAMD51 bootloader build layout. (micropython#348)
1 parent b41cbe9 commit 535c005

File tree

3 files changed

+83
-2
lines changed

3 files changed

+83
-2
lines changed

atmel-samd/boards/metro_m4_express/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LD_FILE = boards/samd51x20.ld
1+
LD_FILE = boards/samd51x20-bootloader.ld
22
USB_VID = 0x239A
33
USB_PID = 0x8015
44

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

atmel-samd/boards/samd51x20.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000 - 0x80000 /* 1024 KiB mius 512KiB for the internal file system. */
8+
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000 - 0x80000 /* 1024 KiB minus 512KiB for the internal file system. */
99
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x00040000 /* 256 KiB */
1010
}
1111

0 commit comments

Comments
 (0)