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