ads1115 only
Fork of mbed by
TARGET_UBLOX_C027/TOOLCHAIN_GCC_ARM/LPC1768.ld@77:869cf507173a, 2014-02-14 (annotated)
- Committer:
- emilmont
- Date:
- Fri Feb 14 14:36:43 2014 +0000
- Revision:
- 77:869cf507173a
Release 77 of the mbed library
Main changes:
* Add target NUCLEO_F030R8
* Add target NUCLEO_F401RE
* Add target NUCLEO_F103RB
* Add target NUCLEO_L152RE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 77:869cf507173a | 1 | /* Linker script for mbed LPC1768 */ |
emilmont | 77:869cf507173a | 2 | |
emilmont | 77:869cf507173a | 3 | /* Linker script to configure memory regions. */ |
emilmont | 77:869cf507173a | 4 | MEMORY |
emilmont | 77:869cf507173a | 5 | { |
emilmont | 77:869cf507173a | 6 | FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K |
emilmont | 77:869cf507173a | 7 | RAM (rwx) : ORIGIN = 0x100000C8, LENGTH = (32K - 0xC8) |
emilmont | 77:869cf507173a | 8 | |
emilmont | 77:869cf507173a | 9 | USB_RAM(rwx) : ORIGIN = 0x2007C000, LENGTH = 16K |
emilmont | 77:869cf507173a | 10 | ETH_RAM(rwx) : ORIGIN = 0x20080000, LENGTH = 16K |
emilmont | 77:869cf507173a | 11 | } |
emilmont | 77:869cf507173a | 12 | |
emilmont | 77:869cf507173a | 13 | /* Linker script to place sections and symbol values. Should be used together |
emilmont | 77:869cf507173a | 14 | * with other linker script that defines memory regions FLASH and RAM. |
emilmont | 77:869cf507173a | 15 | * It references following symbols, which must be defined in code: |
emilmont | 77:869cf507173a | 16 | * Reset_Handler : Entry of reset handler |
emilmont | 77:869cf507173a | 17 | * |
emilmont | 77:869cf507173a | 18 | * It defines following symbols, which code can use without definition: |
emilmont | 77:869cf507173a | 19 | * __exidx_start |
emilmont | 77:869cf507173a | 20 | * __exidx_end |
emilmont | 77:869cf507173a | 21 | * __etext |
emilmont | 77:869cf507173a | 22 | * __data_start__ |
emilmont | 77:869cf507173a | 23 | * __preinit_array_start |
emilmont | 77:869cf507173a | 24 | * __preinit_array_end |
emilmont | 77:869cf507173a | 25 | * __init_array_start |
emilmont | 77:869cf507173a | 26 | * __init_array_end |
emilmont | 77:869cf507173a | 27 | * __fini_array_start |
emilmont | 77:869cf507173a | 28 | * __fini_array_end |
emilmont | 77:869cf507173a | 29 | * __data_end__ |
emilmont | 77:869cf507173a | 30 | * __bss_start__ |
emilmont | 77:869cf507173a | 31 | * __bss_end__ |
emilmont | 77:869cf507173a | 32 | * __end__ |
emilmont | 77:869cf507173a | 33 | * end |
emilmont | 77:869cf507173a | 34 | * __HeapLimit |
emilmont | 77:869cf507173a | 35 | * __StackLimit |
emilmont | 77:869cf507173a | 36 | * __StackTop |
emilmont | 77:869cf507173a | 37 | * __stack |
emilmont | 77:869cf507173a | 38 | */ |
emilmont | 77:869cf507173a | 39 | ENTRY(Reset_Handler) |
emilmont | 77:869cf507173a | 40 | |
emilmont | 77:869cf507173a | 41 | SECTIONS |
emilmont | 77:869cf507173a | 42 | { |
emilmont | 77:869cf507173a | 43 | .text : |
emilmont | 77:869cf507173a | 44 | { |
emilmont | 77:869cf507173a | 45 | KEEP(*(.isr_vector)) |
emilmont | 77:869cf507173a | 46 | *(.text*) |
emilmont | 77:869cf507173a | 47 | |
emilmont | 77:869cf507173a | 48 | KEEP(*(.init)) |
emilmont | 77:869cf507173a | 49 | KEEP(*(.fini)) |
emilmont | 77:869cf507173a | 50 | |
emilmont | 77:869cf507173a | 51 | /* .ctors */ |
emilmont | 77:869cf507173a | 52 | *crtbegin.o(.ctors) |
emilmont | 77:869cf507173a | 53 | *crtbegin?.o(.ctors) |
emilmont | 77:869cf507173a | 54 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
emilmont | 77:869cf507173a | 55 | *(SORT(.ctors.*)) |
emilmont | 77:869cf507173a | 56 | *(.ctors) |
emilmont | 77:869cf507173a | 57 | |
emilmont | 77:869cf507173a | 58 | /* .dtors */ |
emilmont | 77:869cf507173a | 59 | *crtbegin.o(.dtors) |
emilmont | 77:869cf507173a | 60 | *crtbegin?.o(.dtors) |
emilmont | 77:869cf507173a | 61 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
emilmont | 77:869cf507173a | 62 | *(SORT(.dtors.*)) |
emilmont | 77:869cf507173a | 63 | *(.dtors) |
emilmont | 77:869cf507173a | 64 | |
emilmont | 77:869cf507173a | 65 | *(.rodata*) |
emilmont | 77:869cf507173a | 66 | |
emilmont | 77:869cf507173a | 67 | KEEP(*(.eh_frame*)) |
emilmont | 77:869cf507173a | 68 | } > FLASH |
emilmont | 77:869cf507173a | 69 | |
emilmont | 77:869cf507173a | 70 | .ARM.extab : |
emilmont | 77:869cf507173a | 71 | { |
emilmont | 77:869cf507173a | 72 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
emilmont | 77:869cf507173a | 73 | } > FLASH |
emilmont | 77:869cf507173a | 74 | |
emilmont | 77:869cf507173a | 75 | __exidx_start = .; |
emilmont | 77:869cf507173a | 76 | .ARM.exidx : |
emilmont | 77:869cf507173a | 77 | { |
emilmont | 77:869cf507173a | 78 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
emilmont | 77:869cf507173a | 79 | } > FLASH |
emilmont | 77:869cf507173a | 80 | __exidx_end = .; |
emilmont | 77:869cf507173a | 81 | |
emilmont | 77:869cf507173a | 82 | __etext = .; |
emilmont | 77:869cf507173a | 83 | |
emilmont | 77:869cf507173a | 84 | .data : AT (__etext) |
emilmont | 77:869cf507173a | 85 | { |
emilmont | 77:869cf507173a | 86 | __data_start__ = .; |
emilmont | 77:869cf507173a | 87 | Image$$RW_IRAM1$$Base = .; |
emilmont | 77:869cf507173a | 88 | *(vtable) |
emilmont | 77:869cf507173a | 89 | *(.data*) |
emilmont | 77:869cf507173a | 90 | |
emilmont | 77:869cf507173a | 91 | . = ALIGN(4); |
emilmont | 77:869cf507173a | 92 | /* preinit data */ |
emilmont | 77:869cf507173a | 93 | PROVIDE (__preinit_array_start = .); |
emilmont | 77:869cf507173a | 94 | KEEP(*(.preinit_array)) |
emilmont | 77:869cf507173a | 95 | PROVIDE (__preinit_array_end = .); |
emilmont | 77:869cf507173a | 96 | |
emilmont | 77:869cf507173a | 97 | . = ALIGN(4); |
emilmont | 77:869cf507173a | 98 | /* init data */ |
emilmont | 77:869cf507173a | 99 | PROVIDE (__init_array_start = .); |
emilmont | 77:869cf507173a | 100 | KEEP(*(SORT(.init_array.*))) |
emilmont | 77:869cf507173a | 101 | KEEP(*(.init_array)) |
emilmont | 77:869cf507173a | 102 | PROVIDE (__init_array_end = .); |
emilmont | 77:869cf507173a | 103 | |
emilmont | 77:869cf507173a | 104 | |
emilmont | 77:869cf507173a | 105 | . = ALIGN(4); |
emilmont | 77:869cf507173a | 106 | /* finit data */ |
emilmont | 77:869cf507173a | 107 | PROVIDE (__fini_array_start = .); |
emilmont | 77:869cf507173a | 108 | KEEP(*(SORT(.fini_array.*))) |
emilmont | 77:869cf507173a | 109 | KEEP(*(.fini_array)) |
emilmont | 77:869cf507173a | 110 | PROVIDE (__fini_array_end = .); |
emilmont | 77:869cf507173a | 111 | |
emilmont | 77:869cf507173a | 112 | . = ALIGN(4); |
emilmont | 77:869cf507173a | 113 | /* All data end */ |
emilmont | 77:869cf507173a | 114 | __data_end__ = .; |
emilmont | 77:869cf507173a | 115 | |
emilmont | 77:869cf507173a | 116 | } > RAM |
emilmont | 77:869cf507173a | 117 | |
emilmont | 77:869cf507173a | 118 | |
emilmont | 77:869cf507173a | 119 | .bss : |
emilmont | 77:869cf507173a | 120 | { |
emilmont | 77:869cf507173a | 121 | __bss_start__ = .; |
emilmont | 77:869cf507173a | 122 | *(.bss*) |
emilmont | 77:869cf507173a | 123 | *(COMMON) |
emilmont | 77:869cf507173a | 124 | __bss_end__ = .; |
emilmont | 77:869cf507173a | 125 | Image$$RW_IRAM1$$ZI$$Limit = . ; |
emilmont | 77:869cf507173a | 126 | } > RAM |
emilmont | 77:869cf507173a | 127 | |
emilmont | 77:869cf507173a | 128 | |
emilmont | 77:869cf507173a | 129 | .heap : |
emilmont | 77:869cf507173a | 130 | { |
emilmont | 77:869cf507173a | 131 | __end__ = .; |
emilmont | 77:869cf507173a | 132 | end = __end__; |
emilmont | 77:869cf507173a | 133 | *(.heap*) |
emilmont | 77:869cf507173a | 134 | __HeapLimit = .; |
emilmont | 77:869cf507173a | 135 | } > RAM |
emilmont | 77:869cf507173a | 136 | |
emilmont | 77:869cf507173a | 137 | /* .stack_dummy section doesn't contains any symbols. It is only |
emilmont | 77:869cf507173a | 138 | * used for linker to calculate size of stack sections, and assign |
emilmont | 77:869cf507173a | 139 | * values to stack symbols later */ |
emilmont | 77:869cf507173a | 140 | .stack_dummy : |
emilmont | 77:869cf507173a | 141 | { |
emilmont | 77:869cf507173a | 142 | *(.stack) |
emilmont | 77:869cf507173a | 143 | } > RAM |
emilmont | 77:869cf507173a | 144 | |
emilmont | 77:869cf507173a | 145 | /* Set stack top to end of RAM, and stack limit move down by |
emilmont | 77:869cf507173a | 146 | * size of stack_dummy section */ |
emilmont | 77:869cf507173a | 147 | __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
emilmont | 77:869cf507173a | 148 | __StackLimit = __StackTop - SIZEOF(.stack_dummy); |
emilmont | 77:869cf507173a | 149 | PROVIDE(__stack = __StackTop); |
emilmont | 77:869cf507173a | 150 | |
emilmont | 77:869cf507173a | 151 | /* Check if data + heap + stack exceeds RAM limit */ |
emilmont | 77:869cf507173a | 152 | ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
emilmont | 77:869cf507173a | 153 | |
emilmont | 77:869cf507173a | 154 | |
emilmont | 77:869cf507173a | 155 | /* Code can explicitly ask for data to be |
emilmont | 77:869cf507173a | 156 | placed in these higher RAM banks where |
emilmont | 77:869cf507173a | 157 | they will be left uninitialized. |
emilmont | 77:869cf507173a | 158 | */ |
emilmont | 77:869cf507173a | 159 | .AHBSRAM0 (NOLOAD): |
emilmont | 77:869cf507173a | 160 | { |
emilmont | 77:869cf507173a | 161 | Image$$RW_IRAM2$$Base = . ; |
emilmont | 77:869cf507173a | 162 | *(AHBSRAM0) |
emilmont | 77:869cf507173a | 163 | Image$$RW_IRAM2$$ZI$$Limit = .; |
emilmont | 77:869cf507173a | 164 | } > USB_RAM |
emilmont | 77:869cf507173a | 165 | |
emilmont | 77:869cf507173a | 166 | .AHBSRAM1 (NOLOAD): |
emilmont | 77:869cf507173a | 167 | { |
emilmont | 77:869cf507173a | 168 | Image$$RW_IRAM3$$Base = . ; |
emilmont | 77:869cf507173a | 169 | *(AHBSRAM1) |
emilmont | 77:869cf507173a | 170 | Image$$RW_IRAM3$$ZI$$Limit = .; |
emilmont | 77:869cf507173a | 171 | } > ETH_RAM |
emilmont | 77:869cf507173a | 172 | } |