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:
Thu Nov 08 11:45:42 2018 +0000
Revision:
171:3a7713b1edbc
Parent:
145:64910690c574
mbed library. Release version 164

Who changed what in which revision?

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