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:
122:f9eeca106725
Release 143 of the mbed library.

Who changed what in which revision?

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