Mercurial > louis > kiibohd-controller
annotate Lib/mk20dx256vlh7.bootloader.ld @ 334:9ac304aa1ab5
Adding initial dfu-upload code and debugging for Bootloader.
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Mon, 27 Apr 2015 00:57:34 -0700 |
parents | f4d4cad283c6 |
children | 795cc567b018 |
rev | line source |
---|---|
263
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
1 /* Teensyduino Core Library |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
2 * http://www.pjrc.com/teensy/ |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
3 * Copyright (c) 2013 PJRC.COM, LLC. |
330
f4d4cad283c6
Some initial bringup of the dfu bootloader on the mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
314
diff
changeset
|
4 * Modifications by Jacob Alexander 2014-2015 for use with McHCK and Kiibohd-dfu |
263
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
5 * |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
6 * Permission is hereby granted, free of charge, to any person obtaining |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
7 * a copy of this software and associated documentation files (the |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
8 * "Software"), to deal in the Software without restriction, including |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
9 * without limitation the rights to use, copy, modify, merge, publish, |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
10 * distribute, sublicense, and/or sell copies of the Software, and to |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
11 * permit persons to whom the Software is furnished to do so, subject to |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
12 * the following conditions: |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
13 * |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
14 * 1. The above copyright notice and this permission notice shall be |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
15 * included in all copies or substantial portions of the Software. |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
16 * |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
17 * 2. If the Software is incorporated into a build system that allows |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
18 * selection among a list of target devices, then similar target |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
19 * devices manufactured by PJRC.COM must be included in the list of |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
20 * target devices and selectable in the same manner. |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
21 * |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
25 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
26 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
27 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
28 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
29 * SOFTWARE. |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
30 */ |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
31 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
32 MEMORY |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
33 { |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
34 FLASH (rx) : ORIGIN = 0x0, LENGTH = 256K |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
35 FLASH_APP (rx) : ORIGIN = 8K, LENGTH = 256K-8K |
334
9ac304aa1ab5
Adding initial dfu-upload code and debugging for Bootloader.
Jacob Alexander <haata@kiibohd.com>
parents:
330
diff
changeset
|
36 FLASH_END (r) : ORIGIN = 256K, LENGTH = 32 |
263
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
37 RAM (rwx) : ORIGIN = 0x20000000 - 64K / 2, LENGTH = 64K |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
38 } |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
39 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
40 /* Starting Address of the application ROM */ |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
41 _app_rom = ORIGIN( FLASH_APP ); |
334
9ac304aa1ab5
Adding initial dfu-upload code and debugging for Bootloader.
Jacob Alexander <haata@kiibohd.com>
parents:
330
diff
changeset
|
42 _app_rom_end = ORIGIN( FLASH_END ); |
263
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
43 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
44 FlexRAM = 0x14000000; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
45 FTFL = 0x40020000; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
46 SCB = 0xe000ed00; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
47 USB0 = 0x40072000; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
48 SIM = 0x40047000; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
49 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
50 /* Section Definitions */ |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
51 SECTIONS |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
52 { |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
53 .text : |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
54 { |
330
f4d4cad283c6
Some initial bringup of the dfu bootloader on the mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
314
diff
changeset
|
55 . = 0; KEEP(* (.vectors)) /* MUST BE AT 0 */ |
263
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
56 *(.startup*) |
330
f4d4cad283c6
Some initial bringup of the dfu bootloader on the mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
314
diff
changeset
|
57 . = 0x400; KEEP(* (.flashconfig)) /* MUST BE AT 0x400 */ |
263
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
58 *(.rodata*) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
59 *(.text*) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
60 . = ALIGN(4); |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
61 KEEP(*(.init)) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
62 } > FLASH |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
63 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
64 .ARM.exidx : |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
65 { |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
66 __exidx_start = .; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
67 *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
68 __exidx_end = .; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
69 } > FLASH |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
70 _etext = .; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
71 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
72 .usbdescriptortable (NOLOAD) : { |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
73 . = ALIGN(512); |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
74 *(.usbdescriptortable*) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
75 } > RAM |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
76 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
77 .dmabuffers (NOLOAD) : { |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
78 . = ALIGN(4); |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
79 *(.dmabuffers*) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
80 } > RAM |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
81 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
82 .usbbuffers (NOLOAD) : { |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
83 . = ALIGN(4); |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
84 *(.usbbuffers*) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
85 } > RAM |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
86 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
87 .data : AT (_etext) { |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
88 . = ALIGN(4); |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
89 _sdata = .; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
90 *(SORT_BY_ALIGNMENT(.ramtext.*) SORT_BY_ALIGNMENT(.data*)) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
91 *(.data*) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
92 . = ALIGN(4); |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
93 _edata = .; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
94 } > RAM |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
95 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
96 .noinit (NOLOAD) : { |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
97 *(.noinit*) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
98 } > RAM |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
99 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
100 .bss : { |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
101 . = ALIGN(4); |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
102 _sbss = .; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
103 *(.bss*) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
104 *(COMMON) |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
105 . = ALIGN(4); |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
106 _ebss = .; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
107 __bss_end = .; |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
108 } > RAM |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
109 |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
110 _estack = ORIGIN(RAM) + LENGTH(RAM); |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
111 } |
9afed592bcb5
Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
112 |