Mouse code for the MacroRat
mbed-dev/targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFR32MG1/device/TOOLCHAIN_GCC_ARM/efr32mg1p.ld@18:6a4db94011d3, 2017-05-14 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sun May 14 23:18:57 2017 +0000
- Revision:
- 18:6a4db94011d3
Publishing again
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /* Linker script for Silicon Labs EFR32MG1P devices */ |
sahilmgandhi | 18:6a4db94011d3 | 2 | /* */ |
sahilmgandhi | 18:6a4db94011d3 | 3 | /* This file is subject to the license terms as defined in ARM's */ |
sahilmgandhi | 18:6a4db94011d3 | 4 | /* CMSIS END USER LICENSE AGREEMENT.pdf, governing the use of */ |
sahilmgandhi | 18:6a4db94011d3 | 5 | /* Example Code. */ |
sahilmgandhi | 18:6a4db94011d3 | 6 | /* */ |
sahilmgandhi | 18:6a4db94011d3 | 7 | /* Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com */ |
sahilmgandhi | 18:6a4db94011d3 | 8 | /* */ |
sahilmgandhi | 18:6a4db94011d3 | 9 | /* Version 4.3.0 */ |
sahilmgandhi | 18:6a4db94011d3 | 10 | /* */ |
sahilmgandhi | 18:6a4db94011d3 | 11 | |
sahilmgandhi | 18:6a4db94011d3 | 12 | MEMORY |
sahilmgandhi | 18:6a4db94011d3 | 13 | { |
sahilmgandhi | 18:6a4db94011d3 | 14 | FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 262144 |
sahilmgandhi | 18:6a4db94011d3 | 15 | RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 31744 |
sahilmgandhi | 18:6a4db94011d3 | 16 | } |
sahilmgandhi | 18:6a4db94011d3 | 17 | |
sahilmgandhi | 18:6a4db94011d3 | 18 | /* MBED: mbed needs to be able to dynamically set the interrupt vector table. |
sahilmgandhi | 18:6a4db94011d3 | 19 | * We make room for the table at the very beginning of RAM, i.e. at |
sahilmgandhi | 18:6a4db94011d3 | 20 | * 0x20000000. We need (16+34) * sizeof(uint32_t) = 200 bytes for EFM32PG */ |
sahilmgandhi | 18:6a4db94011d3 | 21 | __vector_size = 0xC8; |
sahilmgandhi | 18:6a4db94011d3 | 22 | |
sahilmgandhi | 18:6a4db94011d3 | 23 | /* Linker script to place sections and symbol values. Should be used together |
sahilmgandhi | 18:6a4db94011d3 | 24 | * with other linker script that defines memory regions FLASH and RAM. |
sahilmgandhi | 18:6a4db94011d3 | 25 | * It references following symbols, which must be defined in code: |
sahilmgandhi | 18:6a4db94011d3 | 26 | * Reset_Handler : Entry of reset handler |
sahilmgandhi | 18:6a4db94011d3 | 27 | * |
sahilmgandhi | 18:6a4db94011d3 | 28 | * It defines following symbols, which code can use without definition: |
sahilmgandhi | 18:6a4db94011d3 | 29 | * __exidx_start |
sahilmgandhi | 18:6a4db94011d3 | 30 | * __exidx_end |
sahilmgandhi | 18:6a4db94011d3 | 31 | * __copy_table_start__ |
sahilmgandhi | 18:6a4db94011d3 | 32 | * __copy_table_end__ |
sahilmgandhi | 18:6a4db94011d3 | 33 | * __zero_table_start__ |
sahilmgandhi | 18:6a4db94011d3 | 34 | * __zero_table_end__ |
sahilmgandhi | 18:6a4db94011d3 | 35 | * __etext |
sahilmgandhi | 18:6a4db94011d3 | 36 | * __data_start__ |
sahilmgandhi | 18:6a4db94011d3 | 37 | * __preinit_array_start |
sahilmgandhi | 18:6a4db94011d3 | 38 | * __preinit_array_end |
sahilmgandhi | 18:6a4db94011d3 | 39 | * __init_array_start |
sahilmgandhi | 18:6a4db94011d3 | 40 | * __init_array_end |
sahilmgandhi | 18:6a4db94011d3 | 41 | * __fini_array_start |
sahilmgandhi | 18:6a4db94011d3 | 42 | * __fini_array_end |
sahilmgandhi | 18:6a4db94011d3 | 43 | * __data_end__ |
sahilmgandhi | 18:6a4db94011d3 | 44 | * __bss_start__ |
sahilmgandhi | 18:6a4db94011d3 | 45 | * __bss_end__ |
sahilmgandhi | 18:6a4db94011d3 | 46 | * __end__ |
sahilmgandhi | 18:6a4db94011d3 | 47 | * end |
sahilmgandhi | 18:6a4db94011d3 | 48 | * __HeapLimit |
sahilmgandhi | 18:6a4db94011d3 | 49 | * __StackLimit |
sahilmgandhi | 18:6a4db94011d3 | 50 | * __StackTop |
sahilmgandhi | 18:6a4db94011d3 | 51 | * __stack |
sahilmgandhi | 18:6a4db94011d3 | 52 | * __Vectors_End |
sahilmgandhi | 18:6a4db94011d3 | 53 | * __Vectors_Size |
sahilmgandhi | 18:6a4db94011d3 | 54 | */ |
sahilmgandhi | 18:6a4db94011d3 | 55 | ENTRY(Reset_Handler) |
sahilmgandhi | 18:6a4db94011d3 | 56 | |
sahilmgandhi | 18:6a4db94011d3 | 57 | SECTIONS |
sahilmgandhi | 18:6a4db94011d3 | 58 | { |
sahilmgandhi | 18:6a4db94011d3 | 59 | .text : |
sahilmgandhi | 18:6a4db94011d3 | 60 | { |
sahilmgandhi | 18:6a4db94011d3 | 61 | KEEP(*(.vectors)) |
sahilmgandhi | 18:6a4db94011d3 | 62 | __Vectors_End = .; |
sahilmgandhi | 18:6a4db94011d3 | 63 | __Vectors_Size = __Vectors_End - __Vectors; |
sahilmgandhi | 18:6a4db94011d3 | 64 | __end__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 65 | |
sahilmgandhi | 18:6a4db94011d3 | 66 | *(.text*) |
sahilmgandhi | 18:6a4db94011d3 | 67 | |
sahilmgandhi | 18:6a4db94011d3 | 68 | KEEP(*(.init)) |
sahilmgandhi | 18:6a4db94011d3 | 69 | KEEP(*(.fini)) |
sahilmgandhi | 18:6a4db94011d3 | 70 | |
sahilmgandhi | 18:6a4db94011d3 | 71 | /* .ctors */ |
sahilmgandhi | 18:6a4db94011d3 | 72 | *crtbegin.o(.ctors) |
sahilmgandhi | 18:6a4db94011d3 | 73 | *crtbegin?.o(.ctors) |
sahilmgandhi | 18:6a4db94011d3 | 74 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) |
sahilmgandhi | 18:6a4db94011d3 | 75 | *(SORT(.ctors.*)) |
sahilmgandhi | 18:6a4db94011d3 | 76 | *(.ctors) |
sahilmgandhi | 18:6a4db94011d3 | 77 | |
sahilmgandhi | 18:6a4db94011d3 | 78 | /* .dtors */ |
sahilmgandhi | 18:6a4db94011d3 | 79 | *crtbegin.o(.dtors) |
sahilmgandhi | 18:6a4db94011d3 | 80 | *crtbegin?.o(.dtors) |
sahilmgandhi | 18:6a4db94011d3 | 81 | *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) |
sahilmgandhi | 18:6a4db94011d3 | 82 | *(SORT(.dtors.*)) |
sahilmgandhi | 18:6a4db94011d3 | 83 | *(.dtors) |
sahilmgandhi | 18:6a4db94011d3 | 84 | |
sahilmgandhi | 18:6a4db94011d3 | 85 | *(.rodata*) |
sahilmgandhi | 18:6a4db94011d3 | 86 | |
sahilmgandhi | 18:6a4db94011d3 | 87 | KEEP(*(.eh_frame*)) |
sahilmgandhi | 18:6a4db94011d3 | 88 | } > FLASH |
sahilmgandhi | 18:6a4db94011d3 | 89 | |
sahilmgandhi | 18:6a4db94011d3 | 90 | .ARM.extab : |
sahilmgandhi | 18:6a4db94011d3 | 91 | { |
sahilmgandhi | 18:6a4db94011d3 | 92 | *(.ARM.extab* .gnu.linkonce.armextab.*) |
sahilmgandhi | 18:6a4db94011d3 | 93 | } > FLASH |
sahilmgandhi | 18:6a4db94011d3 | 94 | |
sahilmgandhi | 18:6a4db94011d3 | 95 | __exidx_start = .; |
sahilmgandhi | 18:6a4db94011d3 | 96 | .ARM.exidx : |
sahilmgandhi | 18:6a4db94011d3 | 97 | { |
sahilmgandhi | 18:6a4db94011d3 | 98 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) |
sahilmgandhi | 18:6a4db94011d3 | 99 | } > FLASH |
sahilmgandhi | 18:6a4db94011d3 | 100 | __exidx_end = .; |
sahilmgandhi | 18:6a4db94011d3 | 101 | |
sahilmgandhi | 18:6a4db94011d3 | 102 | /* To copy multiple ROM to RAM sections, |
sahilmgandhi | 18:6a4db94011d3 | 103 | * uncomment .copy.table section and, |
sahilmgandhi | 18:6a4db94011d3 | 104 | * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ |
sahilmgandhi | 18:6a4db94011d3 | 105 | /* |
sahilmgandhi | 18:6a4db94011d3 | 106 | .copy.table : |
sahilmgandhi | 18:6a4db94011d3 | 107 | { |
sahilmgandhi | 18:6a4db94011d3 | 108 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 109 | __copy_table_start__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 110 | LONG (__etext) |
sahilmgandhi | 18:6a4db94011d3 | 111 | LONG (__data_start__) |
sahilmgandhi | 18:6a4db94011d3 | 112 | LONG (__data_end__ - __data_start__) |
sahilmgandhi | 18:6a4db94011d3 | 113 | LONG (__etext2) |
sahilmgandhi | 18:6a4db94011d3 | 114 | LONG (__data2_start__) |
sahilmgandhi | 18:6a4db94011d3 | 115 | LONG (__data2_end__ - __data2_start__) |
sahilmgandhi | 18:6a4db94011d3 | 116 | __copy_table_end__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 117 | } > FLASH |
sahilmgandhi | 18:6a4db94011d3 | 118 | */ |
sahilmgandhi | 18:6a4db94011d3 | 119 | |
sahilmgandhi | 18:6a4db94011d3 | 120 | /* To clear multiple BSS sections, |
sahilmgandhi | 18:6a4db94011d3 | 121 | * uncomment .zero.table section and, |
sahilmgandhi | 18:6a4db94011d3 | 122 | * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ |
sahilmgandhi | 18:6a4db94011d3 | 123 | /* |
sahilmgandhi | 18:6a4db94011d3 | 124 | .zero.table : |
sahilmgandhi | 18:6a4db94011d3 | 125 | { |
sahilmgandhi | 18:6a4db94011d3 | 126 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 127 | __zero_table_start__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 128 | LONG (__bss_start__) |
sahilmgandhi | 18:6a4db94011d3 | 129 | LONG (__bss_end__ - __bss_start__) |
sahilmgandhi | 18:6a4db94011d3 | 130 | LONG (__bss2_start__) |
sahilmgandhi | 18:6a4db94011d3 | 131 | LONG (__bss2_end__ - __bss2_start__) |
sahilmgandhi | 18:6a4db94011d3 | 132 | __zero_table_end__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 133 | } > FLASH |
sahilmgandhi | 18:6a4db94011d3 | 134 | */ |
sahilmgandhi | 18:6a4db94011d3 | 135 | |
sahilmgandhi | 18:6a4db94011d3 | 136 | __etext = .; |
sahilmgandhi | 18:6a4db94011d3 | 137 | |
sahilmgandhi | 18:6a4db94011d3 | 138 | .data : AT (__etext) |
sahilmgandhi | 18:6a4db94011d3 | 139 | { |
sahilmgandhi | 18:6a4db94011d3 | 140 | __data_start__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 141 | PROVIDE( __start_vector_table__ = .); |
sahilmgandhi | 18:6a4db94011d3 | 142 | . += __vector_size; |
sahilmgandhi | 18:6a4db94011d3 | 143 | PROVIDE( __end_vector_table__ = .); |
sahilmgandhi | 18:6a4db94011d3 | 144 | *(vtable) |
sahilmgandhi | 18:6a4db94011d3 | 145 | *(.data*) |
sahilmgandhi | 18:6a4db94011d3 | 146 | . = ALIGN (4); |
sahilmgandhi | 18:6a4db94011d3 | 147 | *(.ram) |
sahilmgandhi | 18:6a4db94011d3 | 148 | |
sahilmgandhi | 18:6a4db94011d3 | 149 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 150 | /* preinit data */ |
sahilmgandhi | 18:6a4db94011d3 | 151 | PROVIDE_HIDDEN (__preinit_array_start = .); |
sahilmgandhi | 18:6a4db94011d3 | 152 | KEEP(*(.preinit_array)) |
sahilmgandhi | 18:6a4db94011d3 | 153 | PROVIDE_HIDDEN (__preinit_array_end = .); |
sahilmgandhi | 18:6a4db94011d3 | 154 | |
sahilmgandhi | 18:6a4db94011d3 | 155 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 156 | /* init data */ |
sahilmgandhi | 18:6a4db94011d3 | 157 | PROVIDE_HIDDEN (__init_array_start = .); |
sahilmgandhi | 18:6a4db94011d3 | 158 | KEEP(*(SORT(.init_array.*))) |
sahilmgandhi | 18:6a4db94011d3 | 159 | KEEP(*(.init_array)) |
sahilmgandhi | 18:6a4db94011d3 | 160 | PROVIDE_HIDDEN (__init_array_end = .); |
sahilmgandhi | 18:6a4db94011d3 | 161 | |
sahilmgandhi | 18:6a4db94011d3 | 162 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 163 | /* finit data */ |
sahilmgandhi | 18:6a4db94011d3 | 164 | PROVIDE_HIDDEN (__fini_array_start = .); |
sahilmgandhi | 18:6a4db94011d3 | 165 | KEEP(*(SORT(.fini_array.*))) |
sahilmgandhi | 18:6a4db94011d3 | 166 | KEEP(*(.fini_array)) |
sahilmgandhi | 18:6a4db94011d3 | 167 | PROVIDE_HIDDEN (__fini_array_end = .); |
sahilmgandhi | 18:6a4db94011d3 | 168 | |
sahilmgandhi | 18:6a4db94011d3 | 169 | KEEP(*(.jcr*)) |
sahilmgandhi | 18:6a4db94011d3 | 170 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 171 | /* All data end */ |
sahilmgandhi | 18:6a4db94011d3 | 172 | __data_end__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 173 | |
sahilmgandhi | 18:6a4db94011d3 | 174 | } > RAM |
sahilmgandhi | 18:6a4db94011d3 | 175 | |
sahilmgandhi | 18:6a4db94011d3 | 176 | .bss : |
sahilmgandhi | 18:6a4db94011d3 | 177 | { |
sahilmgandhi | 18:6a4db94011d3 | 178 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 179 | __bss_start__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 180 | *(.bss*) |
sahilmgandhi | 18:6a4db94011d3 | 181 | *(COMMON) |
sahilmgandhi | 18:6a4db94011d3 | 182 | . = ALIGN(4); |
sahilmgandhi | 18:6a4db94011d3 | 183 | __bss_end__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 184 | } > RAM |
sahilmgandhi | 18:6a4db94011d3 | 185 | |
sahilmgandhi | 18:6a4db94011d3 | 186 | .heap (COPY): |
sahilmgandhi | 18:6a4db94011d3 | 187 | { |
sahilmgandhi | 18:6a4db94011d3 | 188 | __HeapBase = .; |
sahilmgandhi | 18:6a4db94011d3 | 189 | __end__ = .; |
sahilmgandhi | 18:6a4db94011d3 | 190 | end = __end__; |
sahilmgandhi | 18:6a4db94011d3 | 191 | _end = __end__; |
sahilmgandhi | 18:6a4db94011d3 | 192 | KEEP(*(.heap*)) |
sahilmgandhi | 18:6a4db94011d3 | 193 | __HeapLimit = .; |
sahilmgandhi | 18:6a4db94011d3 | 194 | } > RAM |
sahilmgandhi | 18:6a4db94011d3 | 195 | |
sahilmgandhi | 18:6a4db94011d3 | 196 | /* .stack_dummy section doesn't contains any symbols. It is only |
sahilmgandhi | 18:6a4db94011d3 | 197 | * used for linker to calculate size of stack sections, and assign |
sahilmgandhi | 18:6a4db94011d3 | 198 | * values to stack symbols later */ |
sahilmgandhi | 18:6a4db94011d3 | 199 | .stack_dummy (COPY): |
sahilmgandhi | 18:6a4db94011d3 | 200 | { |
sahilmgandhi | 18:6a4db94011d3 | 201 | KEEP(*(.stack*)) |
sahilmgandhi | 18:6a4db94011d3 | 202 | } > RAM |
sahilmgandhi | 18:6a4db94011d3 | 203 | |
sahilmgandhi | 18:6a4db94011d3 | 204 | /* Set stack top to end of RAM, and stack limit move down by |
sahilmgandhi | 18:6a4db94011d3 | 205 | * size of stack_dummy section */ |
sahilmgandhi | 18:6a4db94011d3 | 206 | __StackTop = ORIGIN(RAM) + LENGTH(RAM); |
sahilmgandhi | 18:6a4db94011d3 | 207 | __StackLimit = __StackTop - SIZEOF(.stack_dummy); |
sahilmgandhi | 18:6a4db94011d3 | 208 | PROVIDE(__stack = __StackTop); |
sahilmgandhi | 18:6a4db94011d3 | 209 | |
sahilmgandhi | 18:6a4db94011d3 | 210 | /* Check if data + heap + stack exceeds RAM limit */ |
sahilmgandhi | 18:6a4db94011d3 | 211 | ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") |
sahilmgandhi | 18:6a4db94011d3 | 212 | |
sahilmgandhi | 18:6a4db94011d3 | 213 | /* Check if FLASH usage exceeds FLASH size */ |
sahilmgandhi | 18:6a4db94011d3 | 214 | ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !") |
sahilmgandhi | 18:6a4db94011d3 | 215 | } |