ads1115 only

Fork of mbed by mbed official

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?

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