anyThing Connected Team / mbed-dev

Dependents:   BREAK_SENSOR_LED

Fork of mbed-dev by mbed official

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