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:
Wed Jun 21 17:31:38 2017 +0100
Revision:
145:64910690c574
Parent:
113:f141b2784e32
Release 145 of the mbed library.

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