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 09 11:14:10 2017 +0000
Revision:
157:e7ca05fa8600
Parent:
135:176b8275d35d
Child:
171:3a7713b1edbc
Release 155 of the mbed library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 135:176b8275d35d 1 /*******************************************************************************
<> 135:176b8275d35d 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
<> 135:176b8275d35d 3 *
<> 135:176b8275d35d 4 * Permission is hereby granted, free of charge, to any person obtaining a
<> 135:176b8275d35d 5 * copy of this software and associated documentation files (the "Software"),
<> 135:176b8275d35d 6 * to deal in the Software without restriction, including without limitation
<> 135:176b8275d35d 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
<> 135:176b8275d35d 8 * and/or sell copies of the Software, and to permit persons to whom the
<> 135:176b8275d35d 9 * Software is furnished to do so, subject to the following conditions:
<> 135:176b8275d35d 10 *
<> 135:176b8275d35d 11 * The above copyright notice and this permission notice shall be included
<> 135:176b8275d35d 12 * in all copies or substantial portions of the Software.
<> 135:176b8275d35d 13 *
<> 135:176b8275d35d 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
<> 135:176b8275d35d 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
<> 135:176b8275d35d 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
<> 135:176b8275d35d 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
<> 135:176b8275d35d 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
<> 135:176b8275d35d 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
<> 135:176b8275d35d 20 * OTHER DEALINGS IN THE SOFTWARE.
<> 135:176b8275d35d 21 *
<> 135:176b8275d35d 22 * Except as contained in this notice, the name of Maxim Integrated
<> 135:176b8275d35d 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
<> 135:176b8275d35d 24 * Products, Inc. Branding Policy.
<> 135:176b8275d35d 25 *
<> 135:176b8275d35d 26 * The mere transfer of this software does not imply any licenses
<> 135:176b8275d35d 27 * of trade secrets, proprietary technology, copyrights, patents,
<> 135:176b8275d35d 28 * trademarks, maskwork rights, or any other form of intellectual
<> 135:176b8275d35d 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
<> 135:176b8275d35d 30 * ownership rights.
<> 135:176b8275d35d 31 *******************************************************************************
<> 135:176b8275d35d 32 */
<> 135:176b8275d35d 33
<> 135:176b8275d35d 34 MEMORY
<> 135:176b8275d35d 35 {
<> 135:176b8275d35d 36 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00200000
<> 135:176b8275d35d 37 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00080000
<> 135:176b8275d35d 38 }
<> 135:176b8275d35d 39
<> 135:176b8275d35d 40 /* Linker script to place sections and symbol values. Should be used together
<> 135:176b8275d35d 41 * with other linker script that defines memory regions FLASH and RAM.
<> 135:176b8275d35d 42 * It references following symbols, which must be defined in code:
<> 135:176b8275d35d 43 * Reset_Handler : Entry of reset handler
<> 135:176b8275d35d 44 *
<> 135:176b8275d35d 45 * It defines following symbols, which code can use without definition:
<> 135:176b8275d35d 46 * __exidx_start
<> 135:176b8275d35d 47 * __exidx_end
<> 135:176b8275d35d 48 * __etext
<> 135:176b8275d35d 49 * __data_start__
<> 135:176b8275d35d 50 * __preinit_array_start
<> 135:176b8275d35d 51 * __preinit_array_end
<> 135:176b8275d35d 52 * __init_array_start
<> 135:176b8275d35d 53 * __init_array_end
<> 135:176b8275d35d 54 * __fini_array_start
<> 135:176b8275d35d 55 * __fini_array_end
<> 135:176b8275d35d 56 * __data_end__
<> 135:176b8275d35d 57 * __bss_start__
<> 135:176b8275d35d 58 * __bss_end__
<> 135:176b8275d35d 59 * __end__
<> 135:176b8275d35d 60 * end
<> 135:176b8275d35d 61 * __HeapLimit
<> 135:176b8275d35d 62 * __StackLimit
<> 135:176b8275d35d 63 * __StackTop
<> 135:176b8275d35d 64 * __stack
<> 135:176b8275d35d 65 */
<> 135:176b8275d35d 66 ENTRY(Reset_Handler)
<> 135:176b8275d35d 67
<> 135:176b8275d35d 68 SECTIONS
<> 135:176b8275d35d 69 {
<> 135:176b8275d35d 70 .text :
<> 135:176b8275d35d 71 {
<> 135:176b8275d35d 72 KEEP(*(.isr_vector))
<> 135:176b8275d35d 73 *(.text*)
<> 135:176b8275d35d 74
<> 135:176b8275d35d 75 KEEP(*(.init))
<> 135:176b8275d35d 76 KEEP(*(.fini))
<> 135:176b8275d35d 77
<> 135:176b8275d35d 78 /* .ctors */
<> 135:176b8275d35d 79 *crtbegin.o(.ctors)
<> 135:176b8275d35d 80 *crtbegin?.o(.ctors)
<> 135:176b8275d35d 81 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
<> 135:176b8275d35d 82 *(SORT(.ctors.*))
<> 135:176b8275d35d 83 *(.ctors)
<> 135:176b8275d35d 84
<> 135:176b8275d35d 85 /* .dtors */
<> 135:176b8275d35d 86 *crtbegin.o(.dtors)
<> 135:176b8275d35d 87 *crtbegin?.o(.dtors)
<> 135:176b8275d35d 88 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
<> 135:176b8275d35d 89 *(SORT(.dtors.*))
<> 135:176b8275d35d 90 *(.dtors)
<> 135:176b8275d35d 91
<> 135:176b8275d35d 92 *(.rodata*)
<> 135:176b8275d35d 93
<> 135:176b8275d35d 94 KEEP(*(.eh_frame*))
<> 135:176b8275d35d 95 } > FLASH
<> 135:176b8275d35d 96
<> 135:176b8275d35d 97 .ARM.extab :
<> 135:176b8275d35d 98 {
<> 135:176b8275d35d 99 *(.ARM.extab* .gnu.linkonce.armextab.*)
<> 135:176b8275d35d 100 } > FLASH
<> 135:176b8275d35d 101
<> 135:176b8275d35d 102 __exidx_start = .;
<> 135:176b8275d35d 103 .ARM.exidx :
<> 135:176b8275d35d 104 {
<> 135:176b8275d35d 105 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
<> 135:176b8275d35d 106 } > FLASH
<> 135:176b8275d35d 107 __exidx_end = .;
<> 135:176b8275d35d 108
<> 135:176b8275d35d 109 __etext = .;
<> 135:176b8275d35d 110
<> 135:176b8275d35d 111 .data : AT (__etext)
<> 135:176b8275d35d 112 {
<> 135:176b8275d35d 113 __data_start__ = .;
<> 135:176b8275d35d 114 *(vtable)
<> 135:176b8275d35d 115 *(.data*)
<> 135:176b8275d35d 116
<> 135:176b8275d35d 117 . = ALIGN(4);
<> 135:176b8275d35d 118 /* preinit data */
<> 135:176b8275d35d 119 PROVIDE_HIDDEN (__preinit_array_start = .);
<> 135:176b8275d35d 120 KEEP(*(.preinit_array))
<> 135:176b8275d35d 121 PROVIDE_HIDDEN (__preinit_array_end = .);
<> 135:176b8275d35d 122
<> 135:176b8275d35d 123 . = ALIGN(4);
<> 135:176b8275d35d 124 /* init data */
<> 135:176b8275d35d 125 PROVIDE_HIDDEN (__init_array_start = .);
<> 135:176b8275d35d 126 KEEP(*(SORT(.init_array.*)))
<> 135:176b8275d35d 127 KEEP(*(.init_array))
<> 135:176b8275d35d 128 PROVIDE_HIDDEN (__init_array_end = .);
<> 135:176b8275d35d 129
<> 135:176b8275d35d 130
<> 135:176b8275d35d 131 . = ALIGN(4);
<> 135:176b8275d35d 132 /* finit data */
<> 135:176b8275d35d 133 PROVIDE_HIDDEN (__fini_array_start = .);
<> 135:176b8275d35d 134 KEEP(*(SORT(.fini_array.*)))
<> 135:176b8275d35d 135 KEEP(*(.fini_array))
<> 135:176b8275d35d 136 PROVIDE_HIDDEN (__fini_array_end = .);
<> 135:176b8275d35d 137
<> 135:176b8275d35d 138 . = ALIGN(4);
<> 135:176b8275d35d 139 /* All data end */
<> 135:176b8275d35d 140 __data_end__ = .;
<> 135:176b8275d35d 141
<> 135:176b8275d35d 142 } > RAM
<> 135:176b8275d35d 143
<> 135:176b8275d35d 144 .bss :
<> 135:176b8275d35d 145 {
<> 135:176b8275d35d 146 __bss_start__ = .;
<> 135:176b8275d35d 147 *(.bss*)
<> 135:176b8275d35d 148 *(COMMON)
<> 135:176b8275d35d 149 __bss_end__ = .;
<> 135:176b8275d35d 150 } > RAM
<> 135:176b8275d35d 151
<> 135:176b8275d35d 152 .heap :
<> 135:176b8275d35d 153 {
<> 135:176b8275d35d 154 __end__ = .;
<> 135:176b8275d35d 155 end = __end__;
<> 135:176b8275d35d 156 *(.heap*)
<> 135:176b8275d35d 157 __HeapLimit = .;
<> 135:176b8275d35d 158 } > RAM
<> 135:176b8275d35d 159
<> 135:176b8275d35d 160 /* .stack_dummy section doesn't contains any symbols. It is only
<> 135:176b8275d35d 161 * used for linker to calculate size of stack sections, and assign
<> 135:176b8275d35d 162 * values to stack symbols later */
<> 135:176b8275d35d 163 .stack_dummy :
<> 135:176b8275d35d 164 {
<> 135:176b8275d35d 165 *(.stack)
<> 135:176b8275d35d 166 } > RAM
<> 135:176b8275d35d 167
<> 135:176b8275d35d 168 /* Set stack top to end of RAM, and stack limit move down by
<> 135:176b8275d35d 169 * size of stack_dummy section */
<> 135:176b8275d35d 170 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
<> 135:176b8275d35d 171 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
<> 135:176b8275d35d 172 PROVIDE(__stack = __StackTop);
<> 135:176b8275d35d 173
<> 135:176b8275d35d 174 /* Check if data + heap + stack exceeds RAM limit */
<> 135:176b8275d35d 175 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
<> 135:176b8275d35d 176 }