ads1115 only

Fork of mbed by mbed official

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

Who changed what in which revision?

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