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