ads1115 only

Fork of mbed by mbed official

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

Who changed what in which revision?

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