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