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