ads1115 only

Fork of mbed by mbed official

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

Who changed what in which revision?

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