The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Wed Nov 08 17:18:06 2017 +0000
Revision:
156:ff21514d8981
Child:
171:3a7713b1edbc
Reverting back to release 154 of the mbed library

Who changed what in which revision?

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