annotate Lib/mk20dx256vlh7.bootloader.ld @ 412:e7a3be42ae1e

Debug code for interconnect cable debugging
author Jacob Alexander <haata@kiibohd.com>
date Sat, 20 Feb 2016 13:27:49 -0800
parents 795cc567b018
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
36 RAM (rwx) : ORIGIN = 0x20000000 - 64K / 2, LENGTH = 64K
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
37 }
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 /* Starting Address of the application ROM */
335
795cc567b018 Basic code for mk20dx256vlh7 flashing
Jacob Alexander <haata@kiibohd.com>
parents: 334
diff changeset
40 _bootloader = ORIGIN( FLASH );
263
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
41 _app_rom = ORIGIN( FLASH_APP );
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
42
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
43 FlexRAM = 0x14000000;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
44 FTFL = 0x40020000;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
45 SCB = 0xe000ed00;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
46 USB0 = 0x40072000;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
47 SIM = 0x40047000;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
48
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
49 /* Section Definitions */
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
50 SECTIONS
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
51 {
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
52 .text :
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
53 {
330
f4d4cad283c6 Some initial bringup of the dfu bootloader on the mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents: 314
diff changeset
54 . = 0; KEEP(* (.vectors)) /* MUST BE AT 0 */
263
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
55 *(.startup*)
330
f4d4cad283c6 Some initial bringup of the dfu bootloader on the mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents: 314
diff changeset
56 . = 0x400; KEEP(* (.flashconfig)) /* MUST BE AT 0x400 */
263
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
57 *(.rodata*)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
58 *(.text*)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
59 . = ALIGN(4);
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
60 KEEP(*(.init))
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
61 } > FLASH
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
62
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
63 .ARM.exidx :
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
64 {
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
65 __exidx_start = .;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
66 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
67 __exidx_end = .;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
68 } > FLASH
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
69 _etext = .;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
70
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
71 .usbdescriptortable (NOLOAD) : {
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
72 . = ALIGN(512);
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
73 *(.usbdescriptortable*)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
74 } > RAM
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
75
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
76 .dmabuffers (NOLOAD) : {
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
77 . = ALIGN(4);
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
78 *(.dmabuffers*)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
79 } > RAM
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
80
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
81 .usbbuffers (NOLOAD) : {
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
82 . = ALIGN(4);
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
83 *(.usbbuffers*)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
84 } > RAM
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
85
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
86 .data : AT (_etext) {
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
87 . = ALIGN(4);
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
88 _sdata = .;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
89 *(SORT_BY_ALIGNMENT(.ramtext.*) SORT_BY_ALIGNMENT(.data*))
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
90 *(.data*)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
91 . = ALIGN(4);
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
92 _edata = .;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
93 } > RAM
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
94
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
95 .noinit (NOLOAD) : {
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
96 *(.noinit*)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
97 } > RAM
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
98
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
99 .bss : {
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
100 . = ALIGN(4);
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
101 _sbss = .;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
102 *(.bss*)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
103 *(COMMON)
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
104 . = ALIGN(4);
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
105 _ebss = .;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
106 __bss_end = .;
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
107 } > RAM
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
108
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
109 _estack = ORIGIN(RAM) + LENGTH(RAM);
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
110 }
9afed592bcb5 Preparing for mk20dx256vlh7
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
111