-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKW01-bl.ld
122 lines (102 loc) · 3.04 KB
/
KW01-bl.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
This file is part of ChibiOS.
ChibiOS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* KL02Z32 memory setup.
*/
ENTRY(Reset_Handler)
MEMORY
{
bl_flash : org = 0x00000000, len = 8k,
storage : org = 0x00002000, len = 2k,
app_flash : org = 0x00002800, len = 16k,
ram : org = 0x1FFFFC00, len = 4k
}
__bl_start__ = ORIGIN(bl_flash);
__bl_size__ = LENGTH(bl_flash);
__bl_end__ = __bl_start__ + __bl_size__;
__app_start__ = ORIGIN(app_flash);
__app_end__ = __app_start__ + LENGTH(app_flash);
__ram_start__ = ORIGIN(ram);
__ram_size__ = LENGTH(ram);
__ram_end__ = __ram_start__ + __ram_size__;
SECTIONS
{
.text : ALIGN(4) SUBALIGN(4) {
. = 0;
KEEP(*(.vectors))
*(.startup*)
. = 0x400;
KEEP(*(.flashconfig*))
*(.text*)
} > bl_flash = 0xFF
_eflash = .;
.apptext (NOLOAD) : {
. = ORIGIN(app_flash);
*(.appvectors)
} > app_flash = 0xFF
/* Combined data and text, after relocation */
.dtext : AT (_eflash) {
. = ALIGN(4);
_sdtext = .;
*(.ramtext*)
*(.rodata*)
*(.data*)
. = ALIGN(4);
_edtext = .;
} > ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.bss : {
. = ALIGN(4);
_sbss = .;
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .;
__bss_end = .;
} > ram
__main_stack_end__ = ORIGIN(ram) + LENGTH(ram) - 8;
boot_token = __main_stack_end__;
/DISCARD/ : {
*(.note.GNU-stack)
*(.gnu_debuglink)
*(.note.gnu.build-id)
*(.note.gnu.build-id.*);
*(.glue_7t)
*(.glue_7)
*(.gcc*)
*(.interp)
*(.ARM.exidx*)
*(.gnu.linkonce.armexidx.*)
}
/* ld.bfd will segfault without these */
.rel.plt : {
. = ALIGN(4);
}
.got.plt : {
. = ALIGN(4);
}
}
/* RAM region to be used for Main stack. This stack accommodates the processing
of all exceptions and interrupts*/
REGION_ALIAS("MAIN_STACK_RAM", ram);
/* RAM region to be used for the process stack. This is the stack used by
the main() function.*/
REGION_ALIAS("PROCESS_STACK_RAM", ram);
/* RAM region to be used for data segment.*/
REGION_ALIAS("DATA_RAM", ram);
/* RAM region to be used for BSS segment.*/
REGION_ALIAS("BSS_RAM", ram);