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:
Kojto
Date:
Wed Sep 16 15:32:31 2015 +0100
Revision:
107:4f6c30876dfa
Child:
108:34e6b704fe68
Release 107  of the mbed library

Changes:
- new platforms - DISCO_F746NG, DISCO_L476VG, NUCLEO_L476RG
- KL43Z - bugfix RTC init function
- K20 - SPI mode fix

Who changed what in which revision?

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