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:
<>
Date:
Wed Apr 12 16:07:08 2017 +0100
Revision:
140:97feb9bacc10
Parent:
128:9bcdf88f62b0
Child:
152:235179ab3f27
Release 140 of the mbed library

Ports for Upcoming Targets

3841: Add nRf52840 target https://github.com/ARMmbed/mbed-os/pull/3841
3992: Introducing UBLOX_C030 platform. https://github.com/ARMmbed/mbed-os/pull/3992

Fixes and Changes

3951: [NUCLEO_F303ZE] Correct ARDUINO pin https://github.com/ARMmbed/mbed-os/pull/3951
4021: Fixing a macro to detect when RTOS was in use for the NRF52840_DK https://github.com/ARMmbed/mbed-os/pull/4021
3979: KW24D: Add missing SPI defines and Arduino connector definitions https://github.com/ARMmbed/mbed-os/pull/3979
3990: UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the https://github.com/ARMmbed/mbed-os/pull/3990
4003: Fixed OBOE in async serial tx for NRF52 target, fixes #4002 https://github.com/ARMmbed/mbed-os/pull/4003
4012: STM32: Correct I2C master error handling https://github.com/ARMmbed/mbed-os/pull/4012
4020: NUCLEO_L011K4 remove unsupported tool chain files https://github.com/ARMmbed/mbed-os/pull/4020
4065: K66F: Move bss section to m_data_2 Section https://github.com/ARMmbed/mbed-os/pull/4065
4014: Issue 3763: Reduce heap allocation in the GCC linker file https://github.com/ARMmbed/mbed-os/pull/4014
4030: [STM32L0] reduce IAR heap and stack size for small targets https://github.com/ARMmbed/mbed-os/pull/4030
4109: NUCLEO_L476RG : minor serial pin update https://github.com/ARMmbed/mbed-os/pull/4109
3982: Ticker - kl25z bugfix for handling events in the past https://github.com/ARMmbed/mbed-os/pull/3982

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
<> 128:9bcdf88f62b0 61 HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
<> 128:9bcdf88f62b0 62 STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
<> 128:9bcdf88f62b0 63 M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0400 : 0x0;
<> 128:9bcdf88f62b0 64
<> 128:9bcdf88f62b0 65 /* Specify the memory areas */
<> 128:9bcdf88f62b0 66 MEMORY
<> 128:9bcdf88f62b0 67 {
<> 128:9bcdf88f62b0 68 m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
<> 128:9bcdf88f62b0 69 m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
<> 128:9bcdf88f62b0 70 m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0
<> 128:9bcdf88f62b0 71 m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000
<> 128:9bcdf88f62b0 72 m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00008000
<> 128:9bcdf88f62b0 73 }
<> 128:9bcdf88f62b0 74
<> 128:9bcdf88f62b0 75 /* Define output sections */
<> 128:9bcdf88f62b0 76 SECTIONS
<> 128:9bcdf88f62b0 77 {
<> 128:9bcdf88f62b0 78 /* The startup code goes first into internal flash */
<> 128:9bcdf88f62b0 79 .interrupts :
<> 128:9bcdf88f62b0 80 {
<> 128:9bcdf88f62b0 81 __VECTOR_TABLE = .;
<> 128:9bcdf88f62b0 82 . = ALIGN(4);
<> 128:9bcdf88f62b0 83 KEEP(*(.isr_vector)) /* Startup code */
<> 128:9bcdf88f62b0 84 . = ALIGN(4);
<> 128:9bcdf88f62b0 85 } > m_interrupts
<> 128:9bcdf88f62b0 86
<> 128:9bcdf88f62b0 87 .flash_config :
<> 128:9bcdf88f62b0 88 {
<> 128:9bcdf88f62b0 89 . = ALIGN(4);
<> 128:9bcdf88f62b0 90 KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */
<> 128:9bcdf88f62b0 91 . = ALIGN(4);
<> 128:9bcdf88f62b0 92 } > m_flash_config
<> 128:9bcdf88f62b0 93
<> 128:9bcdf88f62b0 94 /* The program code and other data goes into internal flash */
<> 128:9bcdf88f62b0 95 .text :
<> 128:9bcdf88f62b0 96 {
<> 128:9bcdf88f62b0 97 . = ALIGN(4);
<> 128:9bcdf88f62b0 98 *(.text) /* .text sections (code) */
<> 128:9bcdf88f62b0 99 *(.text*) /* .text* sections (code) */
<> 128:9bcdf88f62b0 100 *(.rodata) /* .rodata sections (constants, strings, etc.) */
<> 128:9bcdf88f62b0 101 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
<> 128:9bcdf88f62b0 102 *(.glue_7) /* glue arm to thumb code */
<> 128:9bcdf88f62b0 103 *(.glue_7t) /* glue thumb to arm code */
<> 128:9bcdf88f62b0 104 *(.eh_frame)
<> 128:9bcdf88f62b0 105 KEEP (*(.init))
<> 128:9bcdf88f62b0 106 KEEP (*(.fini))
<> 128:9bcdf88f62b0 107 . = ALIGN(4);
<> 128:9bcdf88f62b0 108 } > m_text
<> 128:9bcdf88f62b0 109
<> 128:9bcdf88f62b0 110 .ARM.extab :
<> 128:9bcdf88f62b0 111 {
<> 128:9bcdf88f62b0 112 *(.ARM.extab* .gnu.linkonce.armextab.*)
<> 128:9bcdf88f62b0 113 } > m_text
<> 128:9bcdf88f62b0 114
<> 128:9bcdf88f62b0 115 .ARM :
<> 128:9bcdf88f62b0 116 {
<> 128:9bcdf88f62b0 117 __exidx_start = .;
<> 128:9bcdf88f62b0 118 *(.ARM.exidx*)
<> 128:9bcdf88f62b0 119 __exidx_end = .;
<> 128:9bcdf88f62b0 120 } > m_text
<> 128:9bcdf88f62b0 121
<> 128:9bcdf88f62b0 122 .ctors :
<> 128:9bcdf88f62b0 123 {
<> 128:9bcdf88f62b0 124 __CTOR_LIST__ = .;
<> 128:9bcdf88f62b0 125 /* gcc uses crtbegin.o to find the start of
<> 128:9bcdf88f62b0 126 the constructors, so we make sure it is
<> 128:9bcdf88f62b0 127 first. Because this is a wildcard, it
<> 128:9bcdf88f62b0 128 doesn't matter if the user does not
<> 128:9bcdf88f62b0 129 actually link against crtbegin.o; the
<> 128:9bcdf88f62b0 130 linker won't look for a file to match a
<> 128:9bcdf88f62b0 131 wildcard. The wildcard also means that it
<> 128:9bcdf88f62b0 132 doesn't matter which directory crtbegin.o
<> 128:9bcdf88f62b0 133 is in. */
<> 128:9bcdf88f62b0 134 KEEP (*crtbegin.o(.ctors))
<> 128:9bcdf88f62b0 135 KEEP (*crtbegin?.o(.ctors))
<> 128:9bcdf88f62b0 136 /* We don't want to include the .ctor section from
<> 128:9bcdf88f62b0 137 from the crtend.o file until after the sorted ctors.
<> 128:9bcdf88f62b0 138 The .ctor section from the crtend file contains the
<> 128:9bcdf88f62b0 139 end of ctors marker and it must be last */
<> 128:9bcdf88f62b0 140 KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
<> 128:9bcdf88f62b0 141 KEEP (*(SORT(.ctors.*)))
<> 128:9bcdf88f62b0 142 KEEP (*(.ctors))
<> 128:9bcdf88f62b0 143 __CTOR_END__ = .;
<> 128:9bcdf88f62b0 144 } > m_text
<> 128:9bcdf88f62b0 145
<> 128:9bcdf88f62b0 146 .dtors :
<> 128:9bcdf88f62b0 147 {
<> 128:9bcdf88f62b0 148 __DTOR_LIST__ = .;
<> 128:9bcdf88f62b0 149 KEEP (*crtbegin.o(.dtors))
<> 128:9bcdf88f62b0 150 KEEP (*crtbegin?.o(.dtors))
<> 128:9bcdf88f62b0 151 KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
<> 128:9bcdf88f62b0 152 KEEP (*(SORT(.dtors.*)))
<> 128:9bcdf88f62b0 153 KEEP (*(.dtors))
<> 128:9bcdf88f62b0 154 __DTOR_END__ = .;
<> 128:9bcdf88f62b0 155 } > m_text
<> 128:9bcdf88f62b0 156
<> 128:9bcdf88f62b0 157 .preinit_array :
<> 128:9bcdf88f62b0 158 {
<> 128:9bcdf88f62b0 159 PROVIDE_HIDDEN (__preinit_array_start = .);
<> 128:9bcdf88f62b0 160 KEEP (*(.preinit_array*))
<> 128:9bcdf88f62b0 161 PROVIDE_HIDDEN (__preinit_array_end = .);
<> 128:9bcdf88f62b0 162 } > m_text
<> 128:9bcdf88f62b0 163
<> 128:9bcdf88f62b0 164 .init_array :
<> 128:9bcdf88f62b0 165 {
<> 128:9bcdf88f62b0 166 PROVIDE_HIDDEN (__init_array_start = .);
<> 128:9bcdf88f62b0 167 KEEP (*(SORT(.init_array.*)))
<> 128:9bcdf88f62b0 168 KEEP (*(.init_array*))
<> 128:9bcdf88f62b0 169 PROVIDE_HIDDEN (__init_array_end = .);
<> 128:9bcdf88f62b0 170 } > m_text
<> 128:9bcdf88f62b0 171
<> 128:9bcdf88f62b0 172 .fini_array :
<> 128:9bcdf88f62b0 173 {
<> 128:9bcdf88f62b0 174 PROVIDE_HIDDEN (__fini_array_start = .);
<> 128:9bcdf88f62b0 175 KEEP (*(SORT(.fini_array.*)))
<> 128:9bcdf88f62b0 176 KEEP (*(.fini_array*))
<> 128:9bcdf88f62b0 177 PROVIDE_HIDDEN (__fini_array_end = .);
<> 128:9bcdf88f62b0 178 } > m_text
<> 128:9bcdf88f62b0 179
<> 128:9bcdf88f62b0 180 __etext = .; /* define a global symbol at end of code */
<> 128:9bcdf88f62b0 181 __DATA_ROM = .; /* Symbol is used by startup for data initialization */
<> 128:9bcdf88f62b0 182
<> 128:9bcdf88f62b0 183 .interrupts_ram :
<> 128:9bcdf88f62b0 184 {
<> 128:9bcdf88f62b0 185 . = ALIGN(4);
<> 128:9bcdf88f62b0 186 __VECTOR_RAM__ = .;
<> 128:9bcdf88f62b0 187 __interrupts_ram_start__ = .; /* Create a global symbol at data start */
<> 128:9bcdf88f62b0 188 *(.m_interrupts_ram) /* This is a user defined section */
<> 128:9bcdf88f62b0 189 . += M_VECTOR_RAM_SIZE;
<> 128:9bcdf88f62b0 190 . = ALIGN(4);
<> 128:9bcdf88f62b0 191 __interrupts_ram_end__ = .; /* Define a global symbol at data end */
<> 128:9bcdf88f62b0 192 } > m_data
<> 128:9bcdf88f62b0 193
<> 128:9bcdf88f62b0 194 __VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts);
<> 128:9bcdf88f62b0 195 __RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
<> 128:9bcdf88f62b0 196
<> 128:9bcdf88f62b0 197 .data : AT(__DATA_ROM)
<> 128:9bcdf88f62b0 198 {
<> 128:9bcdf88f62b0 199 . = ALIGN(4);
<> 128:9bcdf88f62b0 200 __DATA_RAM = .;
<> 128:9bcdf88f62b0 201 __data_start__ = .; /* create a global symbol at data start */
<> 128:9bcdf88f62b0 202 *(.data) /* .data sections */
<> 128:9bcdf88f62b0 203 *(.data*) /* .data* sections */
<> 128:9bcdf88f62b0 204 KEEP(*(.jcr*))
<> 128:9bcdf88f62b0 205 . = ALIGN(4);
<> 128:9bcdf88f62b0 206 __data_end__ = .; /* define a global symbol at data end */
<> 128:9bcdf88f62b0 207 } > m_data
<> 128:9bcdf88f62b0 208
<> 128:9bcdf88f62b0 209 __DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
<> 128:9bcdf88f62b0 210 text_end = ORIGIN(m_text) + LENGTH(m_text);
<> 128:9bcdf88f62b0 211 ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
<> 128:9bcdf88f62b0 212
<> 128:9bcdf88f62b0 213 USB_RAM_GAP = DEFINED(__usb_ram_size__) ? __usb_ram_size__ : 0x800;
<> 128:9bcdf88f62b0 214 /* Uninitialized data section */
<> 128:9bcdf88f62b0 215 .bss :
<> 128:9bcdf88f62b0 216 {
<> 128:9bcdf88f62b0 217 /* This is used by the startup in order to initialize the .bss section */
<> 128:9bcdf88f62b0 218 . = ALIGN(4);
<> 128:9bcdf88f62b0 219 __START_BSS = .;
<> 128:9bcdf88f62b0 220 __bss_start__ = .;
<> 128:9bcdf88f62b0 221 *(.bss)
<> 128:9bcdf88f62b0 222 *(.bss*)
<> 128:9bcdf88f62b0 223 . = ALIGN(512);
<> 128:9bcdf88f62b0 224 USB_RAM_START = .;
<> 128:9bcdf88f62b0 225 . += USB_RAM_GAP;
<> 128:9bcdf88f62b0 226 *(COMMON)
<> 128:9bcdf88f62b0 227 . = ALIGN(4);
<> 128:9bcdf88f62b0 228 __bss_end__ = .;
<> 128:9bcdf88f62b0 229 __END_BSS = .;
<> 128:9bcdf88f62b0 230 } > m_data
<> 128:9bcdf88f62b0 231
<> 128:9bcdf88f62b0 232 .heap :
<> 128:9bcdf88f62b0 233 {
<> 128:9bcdf88f62b0 234 . = ALIGN(8);
<> 128:9bcdf88f62b0 235 __end__ = .;
<> 128:9bcdf88f62b0 236 PROVIDE(end = .);
<> 128:9bcdf88f62b0 237 __HeapBase = .;
<> 128:9bcdf88f62b0 238 . += HEAP_SIZE;
<> 128:9bcdf88f62b0 239 __HeapLimit = .;
<> 128:9bcdf88f62b0 240 __heap_limit = .; /* Add for _sbrk */
<> 128:9bcdf88f62b0 241 } > m_data_2
<> 128:9bcdf88f62b0 242
<> 128:9bcdf88f62b0 243 .stack :
<> 128:9bcdf88f62b0 244 {
<> 128:9bcdf88f62b0 245 . = ALIGN(8);
<> 128:9bcdf88f62b0 246 . += STACK_SIZE;
<> 128:9bcdf88f62b0 247 } > m_data_2
<> 128:9bcdf88f62b0 248
<> 128:9bcdf88f62b0 249 m_usb_bdt USB_RAM_START (NOLOAD) :
<> 128:9bcdf88f62b0 250 {
<> 128:9bcdf88f62b0 251 *(m_usb_bdt)
<> 128:9bcdf88f62b0 252 USB_RAM_BDT_END = .;
<> 128:9bcdf88f62b0 253 }
<> 128:9bcdf88f62b0 254
<> 128:9bcdf88f62b0 255 m_usb_global USB_RAM_BDT_END (NOLOAD) :
<> 128:9bcdf88f62b0 256 {
<> 128:9bcdf88f62b0 257 *(m_usb_global)
<> 128:9bcdf88f62b0 258 }
<> 128:9bcdf88f62b0 259
<> 128:9bcdf88f62b0 260 /* Initializes stack on the end of block */
<> 128:9bcdf88f62b0 261 __StackTop = ORIGIN(m_data_2) + LENGTH(m_data_2);
<> 128:9bcdf88f62b0 262 __StackLimit = __StackTop - STACK_SIZE;
<> 128:9bcdf88f62b0 263 PROVIDE(__stack = __StackTop);
<> 128:9bcdf88f62b0 264
<> 128:9bcdf88f62b0 265 .ARM.attributes 0 : { *(.ARM.attributes) }
<> 128:9bcdf88f62b0 266
<> 128:9bcdf88f62b0 267 ASSERT(__StackLimit >= __HeapLimit, "region m_data_2 overflowed with stack and heap")
<> 128:9bcdf88f62b0 268 }
<> 128:9bcdf88f62b0 269