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