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:
Anna Bridge
Date:
Fri Jun 22 15:38:59 2018 +0100
Revision:
169:a7c7b631e539
Parent:
146:22da6e220af6
Child:
171:3a7713b1edbc
mbed library. Release version 162

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 146:22da6e220af6 1 /* Linker script to configure memory regions. */
AnnaBridge 146:22da6e220af6 2
AnnaBridge 146:22da6e220af6 3 MEMORY
AnnaBridge 146:22da6e220af6 4 {
AnnaBridge 146:22da6e220af6 5 FLASH (rx) : ORIGIN = 0x0001B000, LENGTH = 0x25000
AnnaBridge 146:22da6e220af6 6 RAM (rwx) : ORIGIN = 0x20002ef8, LENGTH = 0x5108
AnnaBridge 146:22da6e220af6 7 }
AnnaBridge 146:22da6e220af6 8
AnnaBridge 146:22da6e220af6 9 OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
AnnaBridge 146:22da6e220af6 10
AnnaBridge 146:22da6e220af6 11 /* Linker script to place sections and symbol values. Should be used together
AnnaBridge 146:22da6e220af6 12 * with other linker script that defines memory regions FLASH and RAM.
AnnaBridge 146:22da6e220af6 13 * It references following symbols, which must be defined in code:
AnnaBridge 146:22da6e220af6 14 * Reset_Handler : Entry of reset handler
AnnaBridge 146:22da6e220af6 15 *
AnnaBridge 146:22da6e220af6 16 * It defines following symbols, which code can use without definition:
AnnaBridge 146:22da6e220af6 17 * __exidx_start
AnnaBridge 146:22da6e220af6 18 * __exidx_end
AnnaBridge 146:22da6e220af6 19 * __etext
AnnaBridge 146:22da6e220af6 20 * __data_start__
AnnaBridge 146:22da6e220af6 21 * __preinit_array_start
AnnaBridge 146:22da6e220af6 22 * __preinit_array_end
AnnaBridge 146:22da6e220af6 23 * __init_array_start
AnnaBridge 146:22da6e220af6 24 * __init_array_end
AnnaBridge 146:22da6e220af6 25 * __fini_array_start
AnnaBridge 146:22da6e220af6 26 * __fini_array_end
AnnaBridge 146:22da6e220af6 27 * __data_end__
AnnaBridge 146:22da6e220af6 28 * __bss_start__
AnnaBridge 146:22da6e220af6 29 * __bss_end__
AnnaBridge 146:22da6e220af6 30 * __end__
AnnaBridge 146:22da6e220af6 31 * end
AnnaBridge 146:22da6e220af6 32 * __HeapLimit
AnnaBridge 146:22da6e220af6 33 * __StackLimit
AnnaBridge 146:22da6e220af6 34 * __StackTop
AnnaBridge 146:22da6e220af6 35 * __stack
AnnaBridge 146:22da6e220af6 36 */
AnnaBridge 146:22da6e220af6 37 ENTRY(Reset_Handler)
AnnaBridge 146:22da6e220af6 38
AnnaBridge 146:22da6e220af6 39 SECTIONS
AnnaBridge 146:22da6e220af6 40 {
AnnaBridge 146:22da6e220af6 41 .text :
AnnaBridge 146:22da6e220af6 42 {
AnnaBridge 146:22da6e220af6 43 KEEP(*(.Vectors))
AnnaBridge 146:22da6e220af6 44 *(.text*)
AnnaBridge 146:22da6e220af6 45
AnnaBridge 146:22da6e220af6 46 KEEP(*(.init))
AnnaBridge 146:22da6e220af6 47 KEEP(*(.fini))
AnnaBridge 146:22da6e220af6 48
AnnaBridge 146:22da6e220af6 49 /* .ctors */
AnnaBridge 146:22da6e220af6 50 *crtbegin.o(.ctors)
AnnaBridge 146:22da6e220af6 51 *crtbegin?.o(.ctors)
AnnaBridge 146:22da6e220af6 52 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
AnnaBridge 146:22da6e220af6 53 *(SORT(.ctors.*))
AnnaBridge 146:22da6e220af6 54 *(.ctors)
AnnaBridge 146:22da6e220af6 55
AnnaBridge 146:22da6e220af6 56 /* .dtors */
AnnaBridge 146:22da6e220af6 57 *crtbegin.o(.dtors)
AnnaBridge 146:22da6e220af6 58 *crtbegin?.o(.dtors)
AnnaBridge 146:22da6e220af6 59 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
AnnaBridge 146:22da6e220af6 60 *(SORT(.dtors.*))
AnnaBridge 146:22da6e220af6 61 *(.dtors)
AnnaBridge 146:22da6e220af6 62
AnnaBridge 146:22da6e220af6 63 *(.rodata*)
AnnaBridge 146:22da6e220af6 64
AnnaBridge 146:22da6e220af6 65 KEEP(*(.eh_frame*))
AnnaBridge 146:22da6e220af6 66 } > FLASH
AnnaBridge 146:22da6e220af6 67
AnnaBridge 146:22da6e220af6 68
AnnaBridge 146:22da6e220af6 69 .ARM.extab :
AnnaBridge 146:22da6e220af6 70 {
AnnaBridge 146:22da6e220af6 71 *(.ARM.extab* .gnu.linkonce.armextab.*)
AnnaBridge 146:22da6e220af6 72 } > FLASH
AnnaBridge 146:22da6e220af6 73
AnnaBridge 146:22da6e220af6 74 __exidx_start = .;
AnnaBridge 146:22da6e220af6 75 .ARM.exidx :
AnnaBridge 146:22da6e220af6 76 {
AnnaBridge 146:22da6e220af6 77 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
AnnaBridge 146:22da6e220af6 78 } > FLASH
AnnaBridge 146:22da6e220af6 79 __exidx_end = .;
AnnaBridge 146:22da6e220af6 80
AnnaBridge 146:22da6e220af6 81 __etext = .;
AnnaBridge 146:22da6e220af6 82
AnnaBridge 146:22da6e220af6 83 .data : AT (__etext)
AnnaBridge 146:22da6e220af6 84 {
AnnaBridge 146:22da6e220af6 85 __data_start__ = .;
AnnaBridge 146:22da6e220af6 86 *(vtable)
AnnaBridge 146:22da6e220af6 87 *(.data*)
AnnaBridge 146:22da6e220af6 88
AnnaBridge 146:22da6e220af6 89 . = ALIGN(4);
AnnaBridge 146:22da6e220af6 90 /* preinit data */
AnnaBridge 146:22da6e220af6 91 PROVIDE_HIDDEN (__preinit_array_start = .);
AnnaBridge 146:22da6e220af6 92 KEEP(*(.preinit_array))
AnnaBridge 146:22da6e220af6 93 PROVIDE_HIDDEN (__preinit_array_end = .);
AnnaBridge 146:22da6e220af6 94
AnnaBridge 146:22da6e220af6 95 . = ALIGN(4);
AnnaBridge 146:22da6e220af6 96 /* init data */
AnnaBridge 146:22da6e220af6 97 PROVIDE_HIDDEN (__init_array_start = .);
AnnaBridge 146:22da6e220af6 98 KEEP(*(SORT(.init_array.*)))
AnnaBridge 146:22da6e220af6 99 KEEP(*(.init_array))
AnnaBridge 146:22da6e220af6 100 PROVIDE_HIDDEN (__init_array_end = .);
AnnaBridge 146:22da6e220af6 101
AnnaBridge 146:22da6e220af6 102
AnnaBridge 146:22da6e220af6 103 . = ALIGN(4);
AnnaBridge 146:22da6e220af6 104 /* finit data */
AnnaBridge 146:22da6e220af6 105 PROVIDE_HIDDEN (__fini_array_start = .);
AnnaBridge 146:22da6e220af6 106 KEEP(*(SORT(.fini_array.*)))
AnnaBridge 146:22da6e220af6 107 KEEP(*(.fini_array))
AnnaBridge 146:22da6e220af6 108 PROVIDE_HIDDEN (__fini_array_end = .);
AnnaBridge 146:22da6e220af6 109
AnnaBridge 146:22da6e220af6 110 . = ALIGN(4);
AnnaBridge 146:22da6e220af6 111 PROVIDE(__start_fs_data = .);
AnnaBridge 146:22da6e220af6 112 KEEP(*(.fs_data))
AnnaBridge 146:22da6e220af6 113 PROVIDE(__stop_fs_data = .);
AnnaBridge 146:22da6e220af6 114
AnnaBridge 146:22da6e220af6 115 *(.jcr)
AnnaBridge 146:22da6e220af6 116 . = ALIGN(4);
AnnaBridge 146:22da6e220af6 117 /* All data end */
AnnaBridge 146:22da6e220af6 118 __data_end__ = .;
AnnaBridge 146:22da6e220af6 119
AnnaBridge 146:22da6e220af6 120 } > RAM
AnnaBridge 146:22da6e220af6 121
AnnaBridge 146:22da6e220af6 122 __edata = .;
AnnaBridge 146:22da6e220af6 123
AnnaBridge 146:22da6e220af6 124 .noinit :
AnnaBridge 146:22da6e220af6 125 {
AnnaBridge 146:22da6e220af6 126 PROVIDE(__start_noinit = .);
AnnaBridge 146:22da6e220af6 127 KEEP(*(.noinit))
AnnaBridge 146:22da6e220af6 128 PROVIDE(__stop_noinit = .);
AnnaBridge 146:22da6e220af6 129 } > RAM
AnnaBridge 146:22da6e220af6 130
AnnaBridge 146:22da6e220af6 131 .bss :
AnnaBridge 146:22da6e220af6 132 {
AnnaBridge 146:22da6e220af6 133 . = ALIGN(4);
AnnaBridge 146:22da6e220af6 134 __bss_start__ = .;
AnnaBridge 146:22da6e220af6 135 *(.bss*)
AnnaBridge 146:22da6e220af6 136 *(COMMON)
AnnaBridge 146:22da6e220af6 137 . = ALIGN(4);
AnnaBridge 146:22da6e220af6 138 __bss_end__ = .;
AnnaBridge 146:22da6e220af6 139 } > RAM
AnnaBridge 146:22da6e220af6 140
AnnaBridge 146:22da6e220af6 141 .heap (NOLOAD):
AnnaBridge 146:22da6e220af6 142 {
AnnaBridge 146:22da6e220af6 143 __end__ = .;
AnnaBridge 146:22da6e220af6 144 end = __end__;
AnnaBridge 146:22da6e220af6 145 __HeapBase = .;
AnnaBridge 146:22da6e220af6 146 *(.heap*)
AnnaBridge 146:22da6e220af6 147 . = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
AnnaBridge 146:22da6e220af6 148 __HeapLimit = .;
AnnaBridge 146:22da6e220af6 149 } > RAM
AnnaBridge 146:22da6e220af6 150
AnnaBridge 146:22da6e220af6 151 /* .stack_dummy section doesn't contains any symbols. It is only
AnnaBridge 146:22da6e220af6 152 * used for linker to calculate size of stack sections, and assign
AnnaBridge 146:22da6e220af6 153 * values to stack symbols later */
AnnaBridge 146:22da6e220af6 154 .stack_dummy (NOLOAD):
AnnaBridge 146:22da6e220af6 155 {
AnnaBridge 146:22da6e220af6 156 *(.stack*)
AnnaBridge 146:22da6e220af6 157 } > RAM
AnnaBridge 146:22da6e220af6 158
AnnaBridge 146:22da6e220af6 159 /* Set stack top to end of RAM, and stack limit move down by
AnnaBridge 146:22da6e220af6 160 * size of stack_dummy section */
AnnaBridge 146:22da6e220af6 161 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
AnnaBridge 146:22da6e220af6 162 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
AnnaBridge 146:22da6e220af6 163 PROVIDE(__stack = __StackTop);
AnnaBridge 146:22da6e220af6 164
AnnaBridge 146:22da6e220af6 165 /* Check if data + heap + stack exceeds RAM limit */
AnnaBridge 146:22da6e220af6 166 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
AnnaBridge 146:22da6e220af6 167 }