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:
Kojto
Date:
Wed Jul 19 16:46:19 2017 +0100
Revision:
147:a97add6d7e64
Parent:
145:64910690c574
Release 147 of the mbed library.

Who changed what in which revision?

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