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:
Mon Oct 02 15:20:36 2017 +0100
Revision:
152:235179ab3f27
Parent:
140:97feb9bacc10
Release 152 of the mbed library.

Who changed what in which revision?

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