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