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:
Thu Sep 06 13:39:34 2018 +0100
Revision:
170:e95d10626187
Parent:
119:aae6fcc7d9bb
Child:
171:3a7713b1edbc
mbed library. Release version 163

Who changed what in which revision?

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