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:
Fri May 26 12:30:20 2017 +0100
Revision:
143:86740a56073b
Parent:
113:f141b2784e32
Child:
145:64910690c574
Release 143 of the mbed library.

Who changed what in which revision?

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