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:
113:f141b2784e32
Child:
145:64910690c574
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
Kojto 98:8ab26030e058 1 /* Linker script for Silicon Labs EFM32LG devices */
Kojto 98:8ab26030e058 2 /* */
Kojto 98:8ab26030e058 3 /* This file is subject to the license terms as defined in ARM's */
Kojto 98:8ab26030e058 4 /* CMSIS END USER LICENSE AGREEMENT.pdf, governing the use of */
Kojto 98:8ab26030e058 5 /* Example Code. */
Kojto 98:8ab26030e058 6 /* */
Kojto 113:f141b2784e32 7 /* Silicon Laboratories, Inc. 2015 */
Kojto 113:f141b2784e32 8 /* */
Kojto 113:f141b2784e32 9 /* Version 4.2.0 */
Kojto 113:f141b2784e32 10 /* */
Kojto 113:f141b2784e32 11
Kojto 98:8ab26030e058 12 MEMORY
Kojto 98:8ab26030e058 13 {
Kojto 98:8ab26030e058 14 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 262144
Kojto 98:8ab26030e058 15 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 32768
Kojto 98:8ab26030e058 16 }
Kojto 98:8ab26030e058 17 /* MBED: mbed needs to be able to dynamically set the interrupt vector table.
Kojto 98:8ab26030e058 18 * We make room for the table at the very beginning of RAM, i.e. at
Kojto 113:f141b2784e32 19 * 0x20000000. We need (16+40) * sizeof(uint32_t) = 224 bytes for EFM32LG */
Kojto 98:8ab26030e058 20 __vector_size = 0xE0;
Kojto 98:8ab26030e058 21
Kojto 98:8ab26030e058 22 /* Linker script to place sections and symbol values. Should be used together
Kojto 98:8ab26030e058 23 * with other linker script that defines memory regions FLASH and RAM.
Kojto 98:8ab26030e058 24 * It references following symbols, which must be defined in code:
Kojto 98:8ab26030e058 25 * Reset_Handler : Entry of reset handler
Kojto 113:f141b2784e32 26 *
Kojto 98:8ab26030e058 27 * It defines following symbols, which code can use without definition:
Kojto 98:8ab26030e058 28 * __exidx_start
Kojto 98:8ab26030e058 29 * __exidx_end
Kojto 113:f141b2784e32 30 * __copy_table_start__
Kojto 113:f141b2784e32 31 * __copy_table_end__
Kojto 113:f141b2784e32 32 * __zero_table_start__
Kojto 113:f141b2784e32 33 * __zero_table_end__
Kojto 98:8ab26030e058 34 * __etext
Kojto 98:8ab26030e058 35 * __data_start__
Kojto 98:8ab26030e058 36 * __preinit_array_start
Kojto 98:8ab26030e058 37 * __preinit_array_end
Kojto 98:8ab26030e058 38 * __init_array_start
Kojto 98:8ab26030e058 39 * __init_array_end
Kojto 98:8ab26030e058 40 * __fini_array_start
Kojto 98:8ab26030e058 41 * __fini_array_end
Kojto 98:8ab26030e058 42 * __data_end__
Kojto 98:8ab26030e058 43 * __bss_start__
Kojto 98:8ab26030e058 44 * __bss_end__
Kojto 98:8ab26030e058 45 * __end__
Kojto 98:8ab26030e058 46 * end
Kojto 98:8ab26030e058 47 * __HeapLimit
Kojto 98:8ab26030e058 48 * __StackLimit
Kojto 98:8ab26030e058 49 * __StackTop
Kojto 98:8ab26030e058 50 * __stack
Kojto 113:f141b2784e32 51 * __Vectors_End
Kojto 113:f141b2784e32 52 * __Vectors_Size
Kojto 98:8ab26030e058 53 */
Kojto 98:8ab26030e058 54 ENTRY(Reset_Handler)
Kojto 98:8ab26030e058 55
Kojto 98:8ab26030e058 56 SECTIONS
Kojto 98:8ab26030e058 57 {
Kojto 98:8ab26030e058 58 .text :
Kojto 98:8ab26030e058 59 {
Kojto 113:f141b2784e32 60 KEEP(*(.vectors))
Kojto 113:f141b2784e32 61 __Vectors_End = .;
Kojto 113:f141b2784e32 62 __Vectors_Size = __Vectors_End - __Vectors;
Kojto 113:f141b2784e32 63 __end__ = .;
Kojto 113:f141b2784e32 64
Kojto 98:8ab26030e058 65 *(.text*)
Kojto 98:8ab26030e058 66
Kojto 98:8ab26030e058 67 KEEP(*(.init))
Kojto 98:8ab26030e058 68 KEEP(*(.fini))
Kojto 98:8ab26030e058 69
Kojto 98:8ab26030e058 70 /* .ctors */
Kojto 98:8ab26030e058 71 *crtbegin.o(.ctors)
Kojto 98:8ab26030e058 72 *crtbegin?.o(.ctors)
Kojto 98:8ab26030e058 73 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
Kojto 98:8ab26030e058 74 *(SORT(.ctors.*))
Kojto 98:8ab26030e058 75 *(.ctors)
Kojto 98:8ab26030e058 76
Kojto 98:8ab26030e058 77 /* .dtors */
Kojto 98:8ab26030e058 78 *crtbegin.o(.dtors)
Kojto 98:8ab26030e058 79 *crtbegin?.o(.dtors)
Kojto 98:8ab26030e058 80 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
Kojto 98:8ab26030e058 81 *(SORT(.dtors.*))
Kojto 98:8ab26030e058 82 *(.dtors)
Kojto 98:8ab26030e058 83
Kojto 98:8ab26030e058 84 *(.rodata*)
Kojto 98:8ab26030e058 85
Kojto 98:8ab26030e058 86 KEEP(*(.eh_frame*))
Kojto 98:8ab26030e058 87 } > FLASH
Kojto 98:8ab26030e058 88
Kojto 113:f141b2784e32 89 .ARM.extab :
Kojto 98:8ab26030e058 90 {
Kojto 98:8ab26030e058 91 *(.ARM.extab* .gnu.linkonce.armextab.*)
Kojto 98:8ab26030e058 92 } > FLASH
Kojto 98:8ab26030e058 93
Kojto 98:8ab26030e058 94 __exidx_start = .;
Kojto 98:8ab26030e058 95 .ARM.exidx :
Kojto 98:8ab26030e058 96 {
Kojto 98:8ab26030e058 97 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
Kojto 98:8ab26030e058 98 } > FLASH
Kojto 98:8ab26030e058 99 __exidx_end = .;
Kojto 98:8ab26030e058 100
Kojto 113:f141b2784e32 101 /* To copy multiple ROM to RAM sections,
Kojto 113:f141b2784e32 102 * uncomment .copy.table section and,
Kojto 113:f141b2784e32 103 * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
Kojto 113:f141b2784e32 104 /*
Kojto 113:f141b2784e32 105 .copy.table :
Kojto 113:f141b2784e32 106 {
Kojto 113:f141b2784e32 107 . = ALIGN(4);
Kojto 113:f141b2784e32 108 __copy_table_start__ = .;
Kojto 113:f141b2784e32 109 LONG (__etext)
Kojto 113:f141b2784e32 110 LONG (__data_start__)
Kojto 113:f141b2784e32 111 LONG (__data_end__ - __data_start__)
Kojto 113:f141b2784e32 112 LONG (__etext2)
Kojto 113:f141b2784e32 113 LONG (__data2_start__)
Kojto 113:f141b2784e32 114 LONG (__data2_end__ - __data2_start__)
Kojto 113:f141b2784e32 115 __copy_table_end__ = .;
Kojto 113:f141b2784e32 116 } > FLASH
Kojto 113:f141b2784e32 117 */
Kojto 113:f141b2784e32 118
Kojto 113:f141b2784e32 119 /* To clear multiple BSS sections,
Kojto 113:f141b2784e32 120 * uncomment .zero.table section and,
Kojto 113:f141b2784e32 121 * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
Kojto 113:f141b2784e32 122 /*
Kojto 113:f141b2784e32 123 .zero.table :
Kojto 113:f141b2784e32 124 {
Kojto 113:f141b2784e32 125 . = ALIGN(4);
Kojto 113:f141b2784e32 126 __zero_table_start__ = .;
Kojto 113:f141b2784e32 127 LONG (__bss_start__)
Kojto 113:f141b2784e32 128 LONG (__bss_end__ - __bss_start__)
Kojto 113:f141b2784e32 129 LONG (__bss2_start__)
Kojto 113:f141b2784e32 130 LONG (__bss2_end__ - __bss2_start__)
Kojto 113:f141b2784e32 131 __zero_table_end__ = .;
Kojto 113:f141b2784e32 132 } > FLASH
Kojto 113:f141b2784e32 133 */
Kojto 113:f141b2784e32 134
Kojto 98:8ab26030e058 135 __etext = .;
Kojto 113:f141b2784e32 136
Kojto 98:8ab26030e058 137 .data : AT (__etext)
Kojto 98:8ab26030e058 138 {
Kojto 98:8ab26030e058 139 __data_start__ = .;
Kojto 98:8ab26030e058 140 *("dma")
Kojto 98:8ab26030e058 141 PROVIDE( __start_vector_table__ = .);
Kojto 113:f141b2784e32 142 . += __vector_size;
Kojto 113:f141b2784e32 143 PROVIDE( __end_vector_table__ = .);
Kojto 98:8ab26030e058 144 *(vtable)
Kojto 98:8ab26030e058 145 *(.data*)
Kojto 98:8ab26030e058 146 . = ALIGN (4);
Kojto 98:8ab26030e058 147 *(.ram)
Kojto 98:8ab26030e058 148
Kojto 98:8ab26030e058 149 . = ALIGN(4);
Kojto 98:8ab26030e058 150 /* preinit data */
Kojto 98:8ab26030e058 151 PROVIDE_HIDDEN (__preinit_array_start = .);
Kojto 98:8ab26030e058 152 KEEP(*(.preinit_array))
Kojto 98:8ab26030e058 153 PROVIDE_HIDDEN (__preinit_array_end = .);
Kojto 98:8ab26030e058 154
Kojto 98:8ab26030e058 155 . = ALIGN(4);
Kojto 98:8ab26030e058 156 /* init data */
Kojto 98:8ab26030e058 157 PROVIDE_HIDDEN (__init_array_start = .);
Kojto 98:8ab26030e058 158 KEEP(*(SORT(.init_array.*)))
Kojto 98:8ab26030e058 159 KEEP(*(.init_array))
Kojto 98:8ab26030e058 160 PROVIDE_HIDDEN (__init_array_end = .);
Kojto 98:8ab26030e058 161
Kojto 98:8ab26030e058 162 . = ALIGN(4);
Kojto 98:8ab26030e058 163 /* finit data */
Kojto 98:8ab26030e058 164 PROVIDE_HIDDEN (__fini_array_start = .);
Kojto 98:8ab26030e058 165 KEEP(*(SORT(.fini_array.*)))
Kojto 98:8ab26030e058 166 KEEP(*(.fini_array))
Kojto 98:8ab26030e058 167 PROVIDE_HIDDEN (__fini_array_end = .);
Kojto 98:8ab26030e058 168
Kojto 113:f141b2784e32 169 KEEP(*(.jcr*))
Kojto 98:8ab26030e058 170 . = ALIGN(4);
Kojto 98:8ab26030e058 171 /* All data end */
Kojto 98:8ab26030e058 172 __data_end__ = .;
Kojto 98:8ab26030e058 173
Kojto 98:8ab26030e058 174 } > RAM
Kojto 98:8ab26030e058 175
Kojto 98:8ab26030e058 176 .bss :
Kojto 98:8ab26030e058 177 {
Kojto 113:f141b2784e32 178 . = ALIGN(4);
Kojto 98:8ab26030e058 179 __bss_start__ = .;
Kojto 98:8ab26030e058 180 *(.bss*)
Kojto 98:8ab26030e058 181 *(COMMON)
Kojto 113:f141b2784e32 182 . = ALIGN(4);
Kojto 98:8ab26030e058 183 __bss_end__ = .;
Kojto 98:8ab26030e058 184 } > RAM
Kojto 98:8ab26030e058 185
Kojto 113:f141b2784e32 186 .heap (COPY):
Kojto 98:8ab26030e058 187 {
Kojto 113:f141b2784e32 188 __HeapBase = .;
Kojto 98:8ab26030e058 189 __end__ = .;
Kojto 98:8ab26030e058 190 end = __end__;
Kojto 98:8ab26030e058 191 _end = __end__;
Kojto 113:f141b2784e32 192 KEEP(*(.heap*))
Kojto 98:8ab26030e058 193 __HeapLimit = .;
Kojto 98:8ab26030e058 194 } > RAM
Kojto 98:8ab26030e058 195
Kojto 98:8ab26030e058 196 /* .stack_dummy section doesn't contains any symbols. It is only
Kojto 98:8ab26030e058 197 * used for linker to calculate size of stack sections, and assign
Kojto 98:8ab26030e058 198 * values to stack symbols later */
Kojto 113:f141b2784e32 199 .stack_dummy (COPY):
Kojto 98:8ab26030e058 200 {
Kojto 113:f141b2784e32 201 KEEP(*(.stack*))
Kojto 98:8ab26030e058 202 } > RAM
Kojto 98:8ab26030e058 203
Kojto 98:8ab26030e058 204 /* Set stack top to end of RAM, and stack limit move down by
Kojto 98:8ab26030e058 205 * size of stack_dummy section */
Kojto 98:8ab26030e058 206 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
Kojto 98:8ab26030e058 207 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
Kojto 98:8ab26030e058 208 PROVIDE(__stack = __StackTop);
Kojto 98:8ab26030e058 209
Kojto 98:8ab26030e058 210 /* Check if data + heap + stack exceeds RAM limit */
Kojto 98:8ab26030e058 211 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
Kojto 113:f141b2784e32 212
Kojto 113:f141b2784e32 213 /* Check if FLASH usage exceeds FLASH size */
Kojto 113:f141b2784e32 214 ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")
Kojto 98:8ab26030e058 215 }