ads1115 only

Fork of mbed by mbed official

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

Who changed what in which revision?

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