Ben Katz / mbed-dev-f303

Dependents:   Hobbyking_Cheetah_Compact Hobbyking_Cheetah_Compact_DRV8323_14bit Hobbyking_Cheetah_Compact_DRV8323_V51_201907 HKC_MiniCheetah ... more

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Wed Apr 12 16:21:43 2017 +0100
Revision:
162:e13f6fdb2ac4
Parent:
154:37f96f9d4de2
Child:
175:af195413fb11
This updates the lib to the mbed lib v140

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 154:37f96f9d4de2 1 /*
<> 154:37f96f9d4de2 2 ** ###################################################################
<> 154:37f96f9d4de2 3 ** Processors: MK66FN2M0VLQ18
<> 154:37f96f9d4de2 4 ** MK66FN2M0VMD18
<> 154:37f96f9d4de2 5 **
<> 154:37f96f9d4de2 6 ** Compiler: GNU C Compiler
<> 154:37f96f9d4de2 7 ** Reference manual: K66P144M180SF5RMV2, Rev. 1, Mar 2015
<> 154:37f96f9d4de2 8 ** Version: rev. 3.0, 2015-03-25
<> 154:37f96f9d4de2 9 ** Build: b151217
<> 154:37f96f9d4de2 10 **
<> 154:37f96f9d4de2 11 ** Abstract:
<> 154:37f96f9d4de2 12 ** Linker file for the GNU C Compiler
<> 154:37f96f9d4de2 13 **
<> 154:37f96f9d4de2 14 ** Copyright (c) 2015 Freescale Semiconductor, Inc.
<> 154:37f96f9d4de2 15 ** All rights reserved.
<> 154:37f96f9d4de2 16 **
<> 154:37f96f9d4de2 17 ** Redistribution and use in source and binary forms, with or without modification,
<> 154:37f96f9d4de2 18 ** are permitted provided that the following conditions are met:
<> 154:37f96f9d4de2 19 **
<> 154:37f96f9d4de2 20 ** o Redistributions of source code must retain the above copyright notice, this list
<> 154:37f96f9d4de2 21 ** of conditions and the following disclaimer.
<> 154:37f96f9d4de2 22 **
<> 154:37f96f9d4de2 23 ** o Redistributions in binary form must reproduce the above copyright notice, this
<> 154:37f96f9d4de2 24 ** list of conditions and the following disclaimer in the documentation and/or
<> 154:37f96f9d4de2 25 ** other materials provided with the distribution.
<> 154:37f96f9d4de2 26 **
<> 154:37f96f9d4de2 27 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
<> 154:37f96f9d4de2 28 ** contributors may be used to endorse or promote products derived from this
<> 154:37f96f9d4de2 29 ** software without specific prior written permission.
<> 154:37f96f9d4de2 30 **
<> 154:37f96f9d4de2 31 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<> 154:37f96f9d4de2 32 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
<> 154:37f96f9d4de2 33 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 154:37f96f9d4de2 34 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
<> 154:37f96f9d4de2 35 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
<> 154:37f96f9d4de2 36 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
<> 154:37f96f9d4de2 37 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
<> 154:37f96f9d4de2 38 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<> 154:37f96f9d4de2 39 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
<> 154:37f96f9d4de2 40 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 154:37f96f9d4de2 41 **
<> 154:37f96f9d4de2 42 ** http: www.freescale.com
<> 154:37f96f9d4de2 43 ** mail: support@freescale.com
<> 154:37f96f9d4de2 44 **
<> 154:37f96f9d4de2 45 ** ###################################################################
<> 154:37f96f9d4de2 46 */
<> 154:37f96f9d4de2 47
<> 154:37f96f9d4de2 48 /* Entry Point */
<> 154:37f96f9d4de2 49 ENTRY(Reset_Handler)
<> 154:37f96f9d4de2 50
<> 154:37f96f9d4de2 51 __ram_vector_table__ = 1;
<> 154:37f96f9d4de2 52
<> 162:e13f6fdb2ac4 53 /* With the RTOS in use, this does not affect the main stack size. The size of
<> 162:e13f6fdb2ac4 54 * the stack where main runs is determined via the RTOS. */
<> 162:e13f6fdb2ac4 55 __stack_size__ = 0x400;
<> 162:e13f6fdb2ac4 56
<> 162:e13f6fdb2ac4 57 /* This is the guaranteed minimum available heap size for an application. When
<> 162:e13f6fdb2ac4 58 * uVisor is enabled, this is also the maximum available heap size. The
<> 162:e13f6fdb2ac4 59 * HEAP_SIZE value is set by uVisor porters to balance the size of the legacy
<> 162:e13f6fdb2ac4 60 * heap and the page heap in uVisor applications. */
<> 162:e13f6fdb2ac4 61 __heap_size__ = 0x6000;
<> 154:37f96f9d4de2 62
<> 154:37f96f9d4de2 63 HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
<> 154:37f96f9d4de2 64 STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
<> 154:37f96f9d4de2 65 M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0400 : 0x0;
<> 154:37f96f9d4de2 66
<> 154:37f96f9d4de2 67 /* Specify the memory areas */
<> 154:37f96f9d4de2 68 MEMORY
<> 154:37f96f9d4de2 69 {
<> 154:37f96f9d4de2 70 m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
<> 154:37f96f9d4de2 71 m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
<> 154:37f96f9d4de2 72 m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x001FFBF0
<> 154:37f96f9d4de2 73 m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
<> 154:37f96f9d4de2 74 m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00030000
<> 154:37f96f9d4de2 75 }
<> 154:37f96f9d4de2 76
<> 154:37f96f9d4de2 77 /* Define output sections */
<> 154:37f96f9d4de2 78 SECTIONS
<> 154:37f96f9d4de2 79 {
<> 154:37f96f9d4de2 80 /* The startup code goes first into internal flash */
<> 154:37f96f9d4de2 81 .interrupts :
<> 154:37f96f9d4de2 82 {
<> 154:37f96f9d4de2 83 __VECTOR_TABLE = .;
<> 154:37f96f9d4de2 84 . = ALIGN(4);
<> 154:37f96f9d4de2 85 KEEP(*(.isr_vector)) /* Startup code */
<> 154:37f96f9d4de2 86 . = ALIGN(4);
<> 154:37f96f9d4de2 87 } > m_interrupts
<> 154:37f96f9d4de2 88
<> 154:37f96f9d4de2 89 .flash_config :
<> 154:37f96f9d4de2 90 {
<> 154:37f96f9d4de2 91 . = ALIGN(4);
<> 154:37f96f9d4de2 92 KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */
<> 154:37f96f9d4de2 93 . = ALIGN(4);
<> 154:37f96f9d4de2 94 } > m_flash_config
<> 154:37f96f9d4de2 95
<> 154:37f96f9d4de2 96 /* The program code and other data goes into internal flash */
<> 154:37f96f9d4de2 97 .text :
<> 154:37f96f9d4de2 98 {
<> 154:37f96f9d4de2 99 . = ALIGN(4);
<> 154:37f96f9d4de2 100 *(.text) /* .text sections (code) */
<> 154:37f96f9d4de2 101 *(.text*) /* .text* sections (code) */
<> 154:37f96f9d4de2 102 *(.rodata) /* .rodata sections (constants, strings, etc.) */
<> 154:37f96f9d4de2 103 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
<> 154:37f96f9d4de2 104 *(.glue_7) /* glue arm to thumb code */
<> 154:37f96f9d4de2 105 *(.glue_7t) /* glue thumb to arm code */
<> 154:37f96f9d4de2 106 *(.eh_frame)
<> 154:37f96f9d4de2 107 KEEP (*(.init))
<> 154:37f96f9d4de2 108 KEEP (*(.fini))
<> 154:37f96f9d4de2 109 . = ALIGN(4);
<> 154:37f96f9d4de2 110 } > m_text
<> 154:37f96f9d4de2 111
<> 154:37f96f9d4de2 112 .ARM.extab :
<> 154:37f96f9d4de2 113 {
<> 154:37f96f9d4de2 114 *(.ARM.extab* .gnu.linkonce.armextab.*)
<> 154:37f96f9d4de2 115 } > m_text
<> 154:37f96f9d4de2 116
<> 154:37f96f9d4de2 117 .ARM :
<> 154:37f96f9d4de2 118 {
<> 154:37f96f9d4de2 119 __exidx_start = .;
<> 154:37f96f9d4de2 120 *(.ARM.exidx*)
<> 154:37f96f9d4de2 121 __exidx_end = .;
<> 154:37f96f9d4de2 122 } > m_text
<> 154:37f96f9d4de2 123
<> 154:37f96f9d4de2 124 .ctors :
<> 154:37f96f9d4de2 125 {
<> 154:37f96f9d4de2 126 __CTOR_LIST__ = .;
<> 154:37f96f9d4de2 127 /* gcc uses crtbegin.o to find the start of
<> 154:37f96f9d4de2 128 the constructors, so we make sure it is
<> 154:37f96f9d4de2 129 first. Because this is a wildcard, it
<> 154:37f96f9d4de2 130 doesn't matter if the user does not
<> 154:37f96f9d4de2 131 actually link against crtbegin.o; the
<> 154:37f96f9d4de2 132 linker won't look for a file to match a
<> 154:37f96f9d4de2 133 wildcard. The wildcard also means that it
<> 154:37f96f9d4de2 134 doesn't matter which directory crtbegin.o
<> 154:37f96f9d4de2 135 is in. */
<> 154:37f96f9d4de2 136 KEEP (*crtbegin.o(.ctors))
<> 154:37f96f9d4de2 137 KEEP (*crtbegin?.o(.ctors))
<> 154:37f96f9d4de2 138 /* We don't want to include the .ctor section from
<> 154:37f96f9d4de2 139 from the crtend.o file until after the sorted ctors.
<> 154:37f96f9d4de2 140 The .ctor section from the crtend file contains the
<> 154:37f96f9d4de2 141 end of ctors marker and it must be last */
<> 154:37f96f9d4de2 142 KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
<> 154:37f96f9d4de2 143 KEEP (*(SORT(.ctors.*)))
<> 154:37f96f9d4de2 144 KEEP (*(.ctors))
<> 154:37f96f9d4de2 145 __CTOR_END__ = .;
<> 154:37f96f9d4de2 146 } > m_text
<> 154:37f96f9d4de2 147
<> 154:37f96f9d4de2 148 .dtors :
<> 154:37f96f9d4de2 149 {
<> 154:37f96f9d4de2 150 __DTOR_LIST__ = .;
<> 154:37f96f9d4de2 151 KEEP (*crtbegin.o(.dtors))
<> 154:37f96f9d4de2 152 KEEP (*crtbegin?.o(.dtors))
<> 154:37f96f9d4de2 153 KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
<> 154:37f96f9d4de2 154 KEEP (*(SORT(.dtors.*)))
<> 154:37f96f9d4de2 155 KEEP (*(.dtors))
<> 154:37f96f9d4de2 156 __DTOR_END__ = .;
<> 154:37f96f9d4de2 157 } > m_text
<> 154:37f96f9d4de2 158
<> 154:37f96f9d4de2 159 .preinit_array :
<> 154:37f96f9d4de2 160 {
<> 154:37f96f9d4de2 161 PROVIDE_HIDDEN (__preinit_array_start = .);
<> 154:37f96f9d4de2 162 KEEP (*(.preinit_array*))
<> 154:37f96f9d4de2 163 PROVIDE_HIDDEN (__preinit_array_end = .);
<> 154:37f96f9d4de2 164 } > m_text
<> 154:37f96f9d4de2 165
<> 154:37f96f9d4de2 166 .init_array :
<> 154:37f96f9d4de2 167 {
<> 154:37f96f9d4de2 168 PROVIDE_HIDDEN (__init_array_start = .);
<> 154:37f96f9d4de2 169 KEEP (*(SORT(.init_array.*)))
<> 154:37f96f9d4de2 170 KEEP (*(.init_array*))
<> 154:37f96f9d4de2 171 PROVIDE_HIDDEN (__init_array_end = .);
<> 154:37f96f9d4de2 172 } > m_text
<> 154:37f96f9d4de2 173
<> 154:37f96f9d4de2 174 .fini_array :
<> 154:37f96f9d4de2 175 {
<> 154:37f96f9d4de2 176 PROVIDE_HIDDEN (__fini_array_start = .);
<> 154:37f96f9d4de2 177 KEEP (*(SORT(.fini_array.*)))
<> 154:37f96f9d4de2 178 KEEP (*(.fini_array*))
<> 154:37f96f9d4de2 179 PROVIDE_HIDDEN (__fini_array_end = .);
<> 154:37f96f9d4de2 180 } > m_text
<> 154:37f96f9d4de2 181
<> 154:37f96f9d4de2 182 __etext = .; /* define a global symbol at end of code */
<> 154:37f96f9d4de2 183 __DATA_ROM = .; /* Symbol is used by startup for data initialization */
<> 154:37f96f9d4de2 184
<> 154:37f96f9d4de2 185 .interrupts_ram :
<> 154:37f96f9d4de2 186 {
<> 154:37f96f9d4de2 187 . = ALIGN(4);
<> 154:37f96f9d4de2 188 __VECTOR_RAM__ = .;
<> 154:37f96f9d4de2 189 __interrupts_ram_start__ = .; /* Create a global symbol at data start */
<> 154:37f96f9d4de2 190 *(.m_interrupts_ram) /* This is a user defined section */
<> 154:37f96f9d4de2 191 . += M_VECTOR_RAM_SIZE;
<> 154:37f96f9d4de2 192 . = ALIGN(4);
<> 154:37f96f9d4de2 193 __interrupts_ram_end__ = .; /* Define a global symbol at data end */
<> 154:37f96f9d4de2 194 } > m_data
<> 154:37f96f9d4de2 195
<> 154:37f96f9d4de2 196 __VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts);
<> 154:37f96f9d4de2 197 __RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
<> 154:37f96f9d4de2 198
<> 154:37f96f9d4de2 199 .data : AT(__DATA_ROM)
<> 154:37f96f9d4de2 200 {
<> 154:37f96f9d4de2 201 . = ALIGN(4);
<> 154:37f96f9d4de2 202 __DATA_RAM = .;
<> 154:37f96f9d4de2 203 __data_start__ = .; /* create a global symbol at data start */
<> 154:37f96f9d4de2 204 *(.data) /* .data sections */
<> 154:37f96f9d4de2 205 *(.data*) /* .data* sections */
<> 154:37f96f9d4de2 206 KEEP(*(.jcr*))
<> 154:37f96f9d4de2 207 . = ALIGN(4);
<> 154:37f96f9d4de2 208 __data_end__ = .; /* define a global symbol at data end */
<> 154:37f96f9d4de2 209 } > m_data
<> 154:37f96f9d4de2 210
<> 154:37f96f9d4de2 211 __DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
<> 154:37f96f9d4de2 212 text_end = ORIGIN(m_text) + LENGTH(m_text);
<> 154:37f96f9d4de2 213 ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
<> 154:37f96f9d4de2 214
<> 154:37f96f9d4de2 215 USB_RAM_GAP = DEFINED(__usb_ram_size__) ? __usb_ram_size__ : 0x800;
<> 154:37f96f9d4de2 216 /* Uninitialized data section */
<> 154:37f96f9d4de2 217 .bss :
<> 154:37f96f9d4de2 218 {
<> 154:37f96f9d4de2 219 /* This is used by the startup in order to initialize the .bss section */
<> 154:37f96f9d4de2 220 . = ALIGN(4);
<> 154:37f96f9d4de2 221 __START_BSS = .;
<> 154:37f96f9d4de2 222 __bss_start__ = .;
<> 154:37f96f9d4de2 223 *(.bss)
<> 154:37f96f9d4de2 224 *(.bss*)
<> 154:37f96f9d4de2 225 . = ALIGN(512);
<> 154:37f96f9d4de2 226 USB_RAM_START = .;
<> 154:37f96f9d4de2 227 . += USB_RAM_GAP;
<> 154:37f96f9d4de2 228 *(COMMON)
<> 154:37f96f9d4de2 229 . = ALIGN(4);
<> 154:37f96f9d4de2 230 __bss_end__ = .;
<> 154:37f96f9d4de2 231 __END_BSS = .;
<> 162:e13f6fdb2ac4 232 } > m_data_2
<> 154:37f96f9d4de2 233
<> 154:37f96f9d4de2 234 .heap :
<> 154:37f96f9d4de2 235 {
<> 154:37f96f9d4de2 236 . = ALIGN(8);
<> 154:37f96f9d4de2 237 __end__ = .;
<> 154:37f96f9d4de2 238 PROVIDE(end = .);
<> 154:37f96f9d4de2 239 __HeapBase = .;
<> 154:37f96f9d4de2 240 . += HEAP_SIZE;
<> 154:37f96f9d4de2 241 __HeapLimit = .;
<> 154:37f96f9d4de2 242 __heap_limit = .; /* Add for _sbrk */
<> 154:37f96f9d4de2 243 } > m_data_2
<> 154:37f96f9d4de2 244
<> 154:37f96f9d4de2 245 .stack :
<> 154:37f96f9d4de2 246 {
<> 154:37f96f9d4de2 247 . = ALIGN(8);
<> 154:37f96f9d4de2 248 . += STACK_SIZE;
<> 154:37f96f9d4de2 249 } > m_data_2
<> 154:37f96f9d4de2 250
<> 154:37f96f9d4de2 251 m_usb_bdt USB_RAM_START (NOLOAD) :
<> 154:37f96f9d4de2 252 {
<> 154:37f96f9d4de2 253 *(m_usb_bdt)
<> 154:37f96f9d4de2 254 USB_RAM_BDT_END = .;
<> 154:37f96f9d4de2 255 }
<> 154:37f96f9d4de2 256
<> 154:37f96f9d4de2 257 m_usb_global USB_RAM_BDT_END (NOLOAD) :
<> 154:37f96f9d4de2 258 {
<> 154:37f96f9d4de2 259 *(m_usb_global)
<> 154:37f96f9d4de2 260 }
<> 154:37f96f9d4de2 261
<> 154:37f96f9d4de2 262 /* Initializes stack on the end of block */
<> 154:37f96f9d4de2 263 __StackTop = ORIGIN(m_data_2) + LENGTH(m_data_2);
<> 154:37f96f9d4de2 264 __StackLimit = __StackTop - STACK_SIZE;
<> 154:37f96f9d4de2 265 PROVIDE(__stack = __StackTop);
<> 154:37f96f9d4de2 266
<> 154:37f96f9d4de2 267 .ARM.attributes 0 : { *(.ARM.attributes) }
<> 154:37f96f9d4de2 268
<> 154:37f96f9d4de2 269 ASSERT(__StackLimit >= __HeapLimit, "region m_data_2 overflowed with stack and heap")
<> 154:37f96f9d4de2 270 }
<> 154:37f96f9d4de2 271