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 Feb 20 20:53:29 2019 +0000
Revision:
172:65be27845400
Parent:
171:3a7713b1edbc
mbed library release version 165

Who changed what in which revision?

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