Modified version of the mbed library for use with the Nucleo boards.

Dependents:   EEPROMWrite Full-Project

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Sep 28 10:45:10 2015 +0100
Revision:
630:825f75ca301e
Synchronized with git revision 54fbe4144faf309c37205a5d39fa665daa919f10

Full URL: https://github.com/mbedmicro/mbed/commit/54fbe4144faf309c37205a5d39fa665daa919f10/

NUCLEO_F031K6 : Add new target

Who changed what in which revision?

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