-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlayout.ld
52 lines (42 loc) · 1.12 KB
/
layout.ld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* First off, let's define the regions for flash and RAM.
* The teensy 3.1/3.2 uses a MK20DX256VLH7 with 256K flash starting at 0
*
* The RAM is split into two halfes called SRAM_L and SRAM_U.
* SRAM_L ends at 0x1fff ffff and SRAM_U starts with 0x2000 0000
* for most purposes, both blocks can be used as one. However, when in
* VLLS2 power mode, only SRAM_U is powered.
*
* For the 64K of RAM in the MK20DX256VLH7, this translates to a
* start address of 0x1fff8000
*/
MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K
/*think about splitting up the RAM into SRAM_U and SRAM_L*/
RAM (rwx) : ORIGIN = 0x1FFF8000, LENGTH = 64K
}
EXTERN(_INTERRUPTS);
SECTIONS
{
PROVIDE(_stack_top = ORIGIN(RAM) + LENGTH(RAM));
.vector_table ORIGIN(FLASH) : {
/* Initial stack pointer */
LONG(_stack_top);
/* Interrupts */
KEEP(*(.vector_table.interrupts));
} > FLASH
.text : {
. = 0x400;
KEEP(*(.flashconfig*))
. = ALIGN(4);
*(.text*)
} > FLASH = 0xFF
.rodata : ALIGN(4){
*(.rodata .rodata.*);
. = ALIGN(4);
} > FLASH
/DISCARD/ : {
*(.ARM.*)
}
}