Skip to content

Commit f580c00

Browse files
committed
Merge pull request #78 from mconners/master
Added KL46Z support
2 parents 8f57c1e + afcc79a commit f580c00

File tree

27 files changed

+7339
-0
lines changed

27 files changed

+7339
-0
lines changed

libraries/mbed/targets/cmsis/TARGET_Freescale/TARGET_KL46Z/MKL46Z4.h

Lines changed: 4155 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
/*
2+
* KL25Z ARM GCC linker script file
3+
*/
4+
5+
MEMORY
6+
{
7+
VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400
8+
FLASH_PROTECTION (rx) : ORIGIN = 0x00000400, LENGTH = 0x00000010
9+
FLASH (rx) : ORIGIN = 0x00000410, LENGTH = 256K - 0x00000410
10+
RAM (rwx) : ORIGIN = 0x1FFFE000, LENGTH = 32K
11+
}
12+
13+
/* Linker script to place sections and symbol values. Should be used together
14+
* with other linker script that defines memory regions FLASH and RAM.
15+
* It references following symbols, which must be defined in code:
16+
* _reset_init : Entry of reset handler
17+
*
18+
* It defines following symbols, which code can use without definition:
19+
* __exidx_start
20+
* __exidx_end
21+
* __etext
22+
* __data_start__
23+
* __preinit_array_start
24+
* __preinit_array_end
25+
* __init_array_start
26+
* __init_array_end
27+
* __fini_array_start
28+
* __fini_array_end
29+
* __data_end__
30+
* __bss_start__
31+
* __bss_end__
32+
* __end__
33+
* end
34+
* __HeapLimit
35+
* __StackLimit
36+
* __StackTop
37+
* __stack
38+
*/
39+
ENTRY(Reset_Handler)
40+
41+
SECTIONS
42+
{
43+
.isr_vector :
44+
{
45+
__vector_table = .;
46+
KEEP(*(.vector_table))
47+
*(.text.Reset_Handler)
48+
*(.text.System_Init)
49+
. = ALIGN(4);
50+
} > VECTORS
51+
52+
.flash_protect :
53+
{
54+
KEEP(*(.kinetis_flash_config_field))
55+
. = ALIGN(4);
56+
} > FLASH_PROTECTION
57+
58+
.text :
59+
{
60+
*(.text*)
61+
62+
KEEP(*(.init))
63+
KEEP(*(.fini))
64+
65+
/* .ctors */
66+
*crtbegin.o(.ctors)
67+
*crtbegin?.o(.ctors)
68+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
69+
*(SORT(.ctors.*))
70+
*(.ctors)
71+
72+
/* .dtors */
73+
*crtbegin.o(.dtors)
74+
*crtbegin?.o(.dtors)
75+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
76+
*(SORT(.dtors.*))
77+
*(.dtors)
78+
79+
*(.rodata*)
80+
81+
KEEP(*(.eh_frame*))
82+
} > FLASH
83+
84+
.ARM.extab :
85+
{
86+
*(.ARM.extab* .gnu.linkonce.armextab.*)
87+
} > FLASH
88+
89+
__exidx_start = .;
90+
.ARM.exidx :
91+
{
92+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
93+
} > FLASH
94+
__exidx_end = .;
95+
96+
__etext = .;
97+
98+
.data : AT (__etext)
99+
{
100+
__data_start__ = .;
101+
*(vtable)
102+
*(.data*)
103+
104+
. = ALIGN(4);
105+
/* preinit data */
106+
PROVIDE_HIDDEN (__preinit_array_start = .);
107+
KEEP(*(.preinit_array))
108+
PROVIDE_HIDDEN (__preinit_array_end = .);
109+
110+
. = ALIGN(4);
111+
/* init data */
112+
PROVIDE_HIDDEN (__init_array_start = .);
113+
KEEP(*(SORT(.init_array.*)))
114+
KEEP(*(.init_array))
115+
PROVIDE_HIDDEN (__init_array_end = .);
116+
117+
118+
. = ALIGN(4);
119+
/* finit data */
120+
PROVIDE_HIDDEN (__fini_array_start = .);
121+
KEEP(*(SORT(.fini_array.*)))
122+
KEEP(*(.fini_array))
123+
PROVIDE_HIDDEN (__fini_array_end = .);
124+
125+
. = ALIGN(4);
126+
/* All data end */
127+
__data_end__ = .;
128+
129+
} > RAM
130+
131+
.bss :
132+
{
133+
__bss_start__ = .;
134+
*(.bss*)
135+
*(COMMON)
136+
__bss_end__ = .;
137+
} > RAM
138+
139+
.heap :
140+
{
141+
__end__ = .;
142+
end = __end__;
143+
*(.heap*)
144+
__HeapLimit = .;
145+
} > RAM
146+
147+
/* .stack_dummy section doesn't contains any symbols. It is only
148+
* used for linker to calculate size of stack sections, and assign
149+
* values to stack symbols later */
150+
.stack_dummy :
151+
{
152+
*(.stack)
153+
} > RAM
154+
155+
/* Set stack top to end of RAM, and stack limit move down by
156+
* size of stack_dummy section */
157+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
158+
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
159+
PROVIDE(__stack = __StackTop);
160+
161+
/* Check if data + heap + stack exceeds RAM limit */
162+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
163+
}

0 commit comments

Comments
 (0)