mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F411RE/TOOLCHAIN_GCC_ARM/NUCLEO_F411RE.ld@316:f3b141fe567d, 2014-09-11 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Sep 11 15:30:09 2014 +0100
- Revision:
- 316:f3b141fe567d
Synchronized with git revision 139311546022bc9e5a9769c81ec92b72407a6d99
Full URL: https://github.com/mbedmicro/mbed/commit/139311546022bc9e5a9769c81ec92b72407a6d99/
[Nucleo_F4x1]: 2 extensions for a) toolchain ARM_GCC and b) test DigitalIn DigitalOut
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 316:f3b141fe567d | 1 | /* Linker script for STM32F411 */ |
mbed_official | 316:f3b141fe567d | 2 | |
mbed_official | 316:f3b141fe567d | 3 | /* Linker script to configure memory regions. */ |
mbed_official | 316:f3b141fe567d | 4 | MEMORY |
mbed_official | 316:f3b141fe567d | 5 | { |
mbed_official | 316:f3b141fe567d | 6 | FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K |
mbed_official | 316:f3b141fe567d | 7 | /* CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K */ |
mbed_official | 316:f3b141fe567d | 8 | RAM (rwx) : ORIGIN = 0x20000198, LENGTH = 128k - 0x198 |
mbed_official | 316:f3b141fe567d | 9 | } |
mbed_official | 316:f3b141fe567d | 10 | |
mbed_official | 316:f3b141fe567d | 11 | /* Linker script to place sections and symbol values. Should be used together |
mbed_official | 316:f3b141fe567d | 12 | * with other linker script that defines memory regions FLASH and RAM. |
mbed_official | 316:f3b141fe567d | 13 | * It references following symbols, which must be defined in code: |
mbed_official | 316:f3b141fe567d | 14 | * Reset_Handler : Entry of reset handler |
mbed_official | 316:f3b141fe567d | 15 | * |
mbed_official | 316:f3b141fe567d | 16 | * It defines following symbols, which code can use without definition: |
mbed_official | 316:f3b141fe567d | 17 | * __exidx_start |
mbed_official | 316:f3b141fe567d | 18 | * __exidx_end |
mbed_official | 316:f3b141fe567d | 19 | * __etext |
mbed_official | 316:f3b141fe567d | 20 | * __data_start__ |
mbed_official | 316:f3b141fe567d | 21 | * __preinit_array_start |
mbed_official | 316:f3b141fe567d | 22 | * __preinit_array_end |
mbed_official | 316:f3b141fe567d | 23 | * __init_array_start |
mbed_official | 316:f3b141fe567d | 24 | * __init_array_end |
mbed_official | 316:f3b141fe567d | 25 | * __fini_array_start |
mbed_official | 316:f3b141fe567d | 26 | * __fini_array_end |
mbed_official | 316:f3b141fe567d | 27 | * __data_end__ |
mbed_official | 316:f3b141fe567d | 28 | * __bss_start__ |
mbed_official | 316:f3b141fe567d | 29 | * __bss_end__ |
mbed_official | 316:f3b141fe567d | 30 | * __end__ |
mbed_official | 316:f3b141fe567d | 31 | * end |
mbed_official | 316:f3b141fe567d | 32 | * __HeapLimit |
mbed_official | 316:f3b141fe567d | 33 | * __StackLimit |
mbed_official | 316:f3b141fe567d | 34 | * __StackTop |
mbed_official | 316:f3b141fe567d | 35 | * __stack |
mbed_official | 316:f3b141fe567d | 36 | */ |
mbed_official | 316:f3b141fe567d | 37 | ENTRY(Reset_Handler) |
mbed_official | 316:f3b141fe567d | 38 | |
mbed_official | 316:f3b141fe567d | 39 | SECTIONS |
mbed_official | 316:f3b141fe567d | 40 | { |
mbed_official | 316:f3b141fe567d | 41 | .text : |
mbed_official | 316:f3b141fe567d | 42 | { |
mbed_official | 316:f3b141fe567d | 43 | KEEP(*(.isr_vector)) |
mbed_official | 316:f3b141fe567d | 44 | *(.text*) |
mbed_official | 316:f3b141fe567d | 45 | |
mbed_official | 316:f3b141fe567d | 46 | KEEP(*(.init)) |
mbed_official | 316:f3b141fe567d | 47 | KEEP(*(.fini)) |
mbed_official | 316:f3b141fe567d | 48 | |
mbed_official | 316:f3b141fe567d | 49 | /* .ctors */ |
mbed_official | 316:f3b141fe567d | 50 | *crtbegin.o(.ctors) |
mbed_official | 316:f3b141fe567d | 51 | *crtbegin?.o(.ctors) |
mbed_official | 316:f3b141fe567d | 52 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
mbed_official | 316:f3b141fe567d | 53 | *(SORT(.ctors.*)) |
mbed_official | 316:f3b141fe567d | 54 | *(.ctors) |
mbed_official | 316:f3b141fe567d | 55 | |
mbed_official | 316:f3b141fe567d | 56 | /* .dtors */ |
mbed_official | 316:f3b141fe567d | 57 | *crtbegin.o(.dtors) |
mbed_official | 316:f3b141fe567d | 58 | *crtbegin?.o(.dtors) |
mbed_official | 316:f3b141fe567d | 59 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
mbed_official | 316:f3b141fe567d | 60 | *(SORT(.dtors.*)) |
mbed_official | 316:f3b141fe567d | 61 | *(.dtors) |
mbed_official | 316:f3b141fe567d | 62 | |
mbed_official | 316:f3b141fe567d | 63 | *(.rodata*) |
mbed_official | 316:f3b141fe567d | 64 | |
mbed_official | 316:f3b141fe567d | 65 | KEEP(*(.eh_frame*)) |
mbed_official | 316:f3b141fe567d | 66 | } > FLASH |
mbed_official | 316:f3b141fe567d | 67 | |
mbed_official | 316:f3b141fe567d | 68 | .ARM.extab : |
mbed_official | 316:f3b141fe567d | 69 | { |
mbed_official | 316:f3b141fe567d | 70 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
mbed_official | 316:f3b141fe567d | 71 | } > FLASH |
mbed_official | 316:f3b141fe567d | 72 | |
mbed_official | 316:f3b141fe567d | 73 | __exidx_start = .; |
mbed_official | 316:f3b141fe567d | 74 | .ARM.exidx : |
mbed_official | 316:f3b141fe567d | 75 | { |
mbed_official | 316:f3b141fe567d | 76 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
mbed_official | 316:f3b141fe567d | 77 | } > FLASH |
mbed_official | 316:f3b141fe567d | 78 | __exidx_end = .; |
mbed_official | 316:f3b141fe567d | 79 | |
mbed_official | 316:f3b141fe567d | 80 | __etext = .; |
mbed_official | 316:f3b141fe567d | 81 | |
mbed_official | 316:f3b141fe567d | 82 | .data : AT (__etext) |
mbed_official | 316:f3b141fe567d | 83 | { |
mbed_official | 316:f3b141fe567d | 84 | __data_start__ = .; |
mbed_official | 316:f3b141fe567d | 85 | *(vtable) |
mbed_official | 316:f3b141fe567d | 86 | *(.data*) |
mbed_official | 316:f3b141fe567d | 87 | |
mbed_official | 316:f3b141fe567d | 88 | . = ALIGN(4); |
mbed_official | 316:f3b141fe567d | 89 | /* preinit data */ |
mbed_official | 316:f3b141fe567d | 90 | PROVIDE_HIDDEN (__preinit_array_start = .); |
mbed_official | 316:f3b141fe567d | 91 | KEEP(*(.preinit_array)) |
mbed_official | 316:f3b141fe567d | 92 | PROVIDE_HIDDEN (__preinit_array_end = .); |
mbed_official | 316:f3b141fe567d | 93 | |
mbed_official | 316:f3b141fe567d | 94 | . = ALIGN(4); |
mbed_official | 316:f3b141fe567d | 95 | /* init data */ |
mbed_official | 316:f3b141fe567d | 96 | PROVIDE_HIDDEN (__init_array_start = .); |
mbed_official | 316:f3b141fe567d | 97 | KEEP(*(SORT(.init_array.*))) |
mbed_official | 316:f3b141fe567d | 98 | KEEP(*(.init_array)) |
mbed_official | 316:f3b141fe567d | 99 | PROVIDE_HIDDEN (__init_array_end = .); |
mbed_official | 316:f3b141fe567d | 100 | |
mbed_official | 316:f3b141fe567d | 101 | |
mbed_official | 316:f3b141fe567d | 102 | . = ALIGN(4); |
mbed_official | 316:f3b141fe567d | 103 | /* finit data */ |
mbed_official | 316:f3b141fe567d | 104 | PROVIDE_HIDDEN (__fini_array_start = .); |
mbed_official | 316:f3b141fe567d | 105 | KEEP(*(SORT(.fini_array.*))) |
mbed_official | 316:f3b141fe567d | 106 | KEEP(*(.fini_array)) |
mbed_official | 316:f3b141fe567d | 107 | PROVIDE_HIDDEN (__fini_array_end = .); |
mbed_official | 316:f3b141fe567d | 108 | |
mbed_official | 316:f3b141fe567d | 109 | KEEP(*(.jcr*)) |
mbed_official | 316:f3b141fe567d | 110 | . = ALIGN(4); |
mbed_official | 316:f3b141fe567d | 111 | /* All data end */ |
mbed_official | 316:f3b141fe567d | 112 | __data_end__ = .; |
mbed_official | 316:f3b141fe567d | 113 | |
mbed_official | 316:f3b141fe567d | 114 | } > RAM |
mbed_official | 316:f3b141fe567d | 115 | |
mbed_official | 316:f3b141fe567d | 116 | .bss : |
mbed_official | 316:f3b141fe567d | 117 | { |
mbed_official | 316:f3b141fe567d | 118 | . = ALIGN(4); |
mbed_official | 316:f3b141fe567d | 119 | __bss_start__ = .; |
mbed_official | 316:f3b141fe567d | 120 | *(.bss*) |
mbed_official | 316:f3b141fe567d | 121 | *(COMMON) |
mbed_official | 316:f3b141fe567d | 122 | . = ALIGN(4); |
mbed_official | 316:f3b141fe567d | 123 | __bss_end__ = .; |
mbed_official | 316:f3b141fe567d | 124 | } > RAM |
mbed_official | 316:f3b141fe567d | 125 | |
mbed_official | 316:f3b141fe567d | 126 | .heap (COPY): |
mbed_official | 316:f3b141fe567d | 127 | { |
mbed_official | 316:f3b141fe567d | 128 | __end__ = .; |
mbed_official | 316:f3b141fe567d | 129 | end = __end__; |
mbed_official | 316:f3b141fe567d | 130 | *(.heap*) |
mbed_official | 316:f3b141fe567d | 131 | __HeapLimit = .; |
mbed_official | 316:f3b141fe567d | 132 | } > RAM |
mbed_official | 316:f3b141fe567d | 133 | |
mbed_official | 316:f3b141fe567d | 134 | /* .stack_dummy section doesn't contains any symbols. It is only |
mbed_official | 316:f3b141fe567d | 135 | * used for linker to calculate size of stack sections, and assign |
mbed_official | 316:f3b141fe567d | 136 | * values to stack symbols later */ |
mbed_official | 316:f3b141fe567d | 137 | .stack_dummy (COPY): |
mbed_official | 316:f3b141fe567d | 138 | { |
mbed_official | 316:f3b141fe567d | 139 | *(.stack*) |
mbed_official | 316:f3b141fe567d | 140 | } > RAM |
mbed_official | 316:f3b141fe567d | 141 | |
mbed_official | 316:f3b141fe567d | 142 | /* Set stack top to end of RAM, and stack limit move down by |
mbed_official | 316:f3b141fe567d | 143 | * size of stack_dummy section */ |
mbed_official | 316:f3b141fe567d | 144 | __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
mbed_official | 316:f3b141fe567d | 145 | __StackLimit = __StackTop - SIZEOF(.stack_dummy); |
mbed_official | 316:f3b141fe567d | 146 | PROVIDE(__stack = __StackTop); |
mbed_official | 316:f3b141fe567d | 147 | |
mbed_official | 316:f3b141fe567d | 148 | /* Check if data + heap + stack exceeds RAM limit */ |
mbed_official | 316:f3b141fe567d | 149 | ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
mbed_official | 316:f3b141fe567d | 150 | } |
mbed_official | 316:f3b141fe567d | 151 |