ads1115 only

Fork of mbed by mbed official

Committer:
kaoshen
Date:
Tue Jan 17 23:27:32 2017 +0000
Revision:
135:fce8a9387ed1
Parent:
109:9296ab0bfc11
333 ADS1115 ADC1

Who changed what in which revision?

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