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:
Kojto
Date:
Wed Jul 19 16:46:19 2017 +0100
Revision:
147:a97add6d7e64
Parent:
140:97feb9bacc10
Release 147 of the mbed library.

Who changed what in which revision?

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