ads1115 only

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue May 10 12:23:43 2016 -0500
Revision:
120:7c328cabac7e
Release 120 of the mbed library

Changes:
- ST - STMF3XX/F4XX - directories removal
- STMF3 - pwm range fix
- STMF1 - Cube driver update
- Renesas - RZ_A1H - async i2c, serial and spi addition
- Freescale - KSDK2 update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 120:7c328cabac7e 1 /*
Kojto 120:7c328cabac7e 2 ** ###################################################################
Kojto 120:7c328cabac7e 3 ** Processors: MKL27Z64VDA4
Kojto 120:7c328cabac7e 4 ** MKL27Z64VFM4
Kojto 120:7c328cabac7e 5 ** MKL27Z64VFT4
Kojto 120:7c328cabac7e 6 ** MKL27Z64VLH4
Kojto 120:7c328cabac7e 7 ** MKL27Z64VMP4
Kojto 120:7c328cabac7e 8 **
Kojto 120:7c328cabac7e 9 ** Compiler: GNU C Compiler
Kojto 120:7c328cabac7e 10 ** Reference manual: KL27P64M48SF2RM, Rev. 1, Sep 2014
Kojto 120:7c328cabac7e 11 ** Version: rev. 1.4, 2014-09-22
Kojto 120:7c328cabac7e 12 ** Build: b151217
Kojto 120:7c328cabac7e 13 **
Kojto 120:7c328cabac7e 14 ** Abstract:
Kojto 120:7c328cabac7e 15 ** Linker file for the GNU C Compiler
Kojto 120:7c328cabac7e 16 **
Kojto 120:7c328cabac7e 17 ** Copyright (c) 2015 Freescale Semiconductor, Inc.
Kojto 120:7c328cabac7e 18 ** All rights reserved.
Kojto 120:7c328cabac7e 19 **
Kojto 120:7c328cabac7e 20 ** Redistribution and use in source and binary forms, with or without modification,
Kojto 120:7c328cabac7e 21 ** are permitted provided that the following conditions are met:
Kojto 120:7c328cabac7e 22 **
Kojto 120:7c328cabac7e 23 ** o Redistributions of source code must retain the above copyright notice, this list
Kojto 120:7c328cabac7e 24 ** of conditions and the following disclaimer.
Kojto 120:7c328cabac7e 25 **
Kojto 120:7c328cabac7e 26 ** o Redistributions in binary form must reproduce the above copyright notice, this
Kojto 120:7c328cabac7e 27 ** list of conditions and the following disclaimer in the documentation and/or
Kojto 120:7c328cabac7e 28 ** other materials provided with the distribution.
Kojto 120:7c328cabac7e 29 **
Kojto 120:7c328cabac7e 30 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
Kojto 120:7c328cabac7e 31 ** contributors may be used to endorse or promote products derived from this
Kojto 120:7c328cabac7e 32 ** software without specific prior written permission.
Kojto 120:7c328cabac7e 33 **
Kojto 120:7c328cabac7e 34 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
Kojto 120:7c328cabac7e 35 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Kojto 120:7c328cabac7e 36 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 120:7c328cabac7e 37 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
Kojto 120:7c328cabac7e 38 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
Kojto 120:7c328cabac7e 39 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
Kojto 120:7c328cabac7e 40 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
Kojto 120:7c328cabac7e 41 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Kojto 120:7c328cabac7e 42 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
Kojto 120:7c328cabac7e 43 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 120:7c328cabac7e 44 **
Kojto 120:7c328cabac7e 45 ** http: www.freescale.com
Kojto 120:7c328cabac7e 46 ** mail: support@freescale.com
Kojto 120:7c328cabac7e 47 **
Kojto 120:7c328cabac7e 48 ** ###################################################################
Kojto 120:7c328cabac7e 49 */
Kojto 120:7c328cabac7e 50
Kojto 120:7c328cabac7e 51 /* Entry Point */
Kojto 120:7c328cabac7e 52 ENTRY(Reset_Handler)
Kojto 120:7c328cabac7e 53
Kojto 120:7c328cabac7e 54 __ram_vector_table__ = 1;
Kojto 120:7c328cabac7e 55
Kojto 120:7c328cabac7e 56 /* Heap 1/4 of ram and stack 1/8 */
Kojto 120:7c328cabac7e 57 __stack_size__ = 0x800;
Kojto 120:7c328cabac7e 58 __heap_size__ = 0x1000;
Kojto 120:7c328cabac7e 59
Kojto 120:7c328cabac7e 60 HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
Kojto 120:7c328cabac7e 61 STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
Kojto 120:7c328cabac7e 62 M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0200 : 0x0;
Kojto 120:7c328cabac7e 63
Kojto 120:7c328cabac7e 64 /* Specify the memory areas */
Kojto 120:7c328cabac7e 65 MEMORY
Kojto 120:7c328cabac7e 66 {
Kojto 120:7c328cabac7e 67 m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000200
Kojto 120:7c328cabac7e 68 m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
Kojto 120:7c328cabac7e 69 m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0000FBF0
Kojto 120:7c328cabac7e 70 m_data (RW) : ORIGIN = 0x1FFFF000, LENGTH = 0x00004000
Kojto 120:7c328cabac7e 71 }
Kojto 120:7c328cabac7e 72
Kojto 120:7c328cabac7e 73 /* Define output sections */
Kojto 120:7c328cabac7e 74 SECTIONS
Kojto 120:7c328cabac7e 75 {
Kojto 120:7c328cabac7e 76 /* The startup code goes first into internal flash */
Kojto 120:7c328cabac7e 77 .interrupts :
Kojto 120:7c328cabac7e 78 {
Kojto 120:7c328cabac7e 79 __VECTOR_TABLE = .;
Kojto 120:7c328cabac7e 80 . = ALIGN(4);
Kojto 120:7c328cabac7e 81 KEEP(*(.isr_vector)) /* Startup code */
Kojto 120:7c328cabac7e 82 . = ALIGN(4);
Kojto 120:7c328cabac7e 83 } > m_interrupts
Kojto 120:7c328cabac7e 84
Kojto 120:7c328cabac7e 85 .flash_config :
Kojto 120:7c328cabac7e 86 {
Kojto 120:7c328cabac7e 87 . = ALIGN(4);
Kojto 120:7c328cabac7e 88 KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */
Kojto 120:7c328cabac7e 89 . = ALIGN(4);
Kojto 120:7c328cabac7e 90 } > m_flash_config
Kojto 120:7c328cabac7e 91
Kojto 120:7c328cabac7e 92 /* The program code and other data goes into internal flash */
Kojto 120:7c328cabac7e 93 .text :
Kojto 120:7c328cabac7e 94 {
Kojto 120:7c328cabac7e 95 . = ALIGN(4);
Kojto 120:7c328cabac7e 96 *(.text) /* .text sections (code) */
Kojto 120:7c328cabac7e 97 *(.text*) /* .text* sections (code) */
Kojto 120:7c328cabac7e 98 *(.rodata) /* .rodata sections (constants, strings, etc.) */
Kojto 120:7c328cabac7e 99 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
Kojto 120:7c328cabac7e 100 *(.glue_7) /* glue arm to thumb code */
Kojto 120:7c328cabac7e 101 *(.glue_7t) /* glue thumb to arm code */
Kojto 120:7c328cabac7e 102 *(.eh_frame)
Kojto 120:7c328cabac7e 103 KEEP (*(.init))
Kojto 120:7c328cabac7e 104 KEEP (*(.fini))
Kojto 120:7c328cabac7e 105 . = ALIGN(4);
Kojto 120:7c328cabac7e 106 } > m_text
Kojto 120:7c328cabac7e 107
Kojto 120:7c328cabac7e 108 .ARM.extab :
Kojto 120:7c328cabac7e 109 {
Kojto 120:7c328cabac7e 110 *(.ARM.extab* .gnu.linkonce.armextab.*)
Kojto 120:7c328cabac7e 111 } > m_text
Kojto 120:7c328cabac7e 112
Kojto 120:7c328cabac7e 113 .ARM :
Kojto 120:7c328cabac7e 114 {
Kojto 120:7c328cabac7e 115 __exidx_start = .;
Kojto 120:7c328cabac7e 116 *(.ARM.exidx*)
Kojto 120:7c328cabac7e 117 __exidx_end = .;
Kojto 120:7c328cabac7e 118 } > m_text
Kojto 120:7c328cabac7e 119
Kojto 120:7c328cabac7e 120 .ctors :
Kojto 120:7c328cabac7e 121 {
Kojto 120:7c328cabac7e 122 __CTOR_LIST__ = .;
Kojto 120:7c328cabac7e 123 /* gcc uses crtbegin.o to find the start of
Kojto 120:7c328cabac7e 124 the constructors, so we make sure it is
Kojto 120:7c328cabac7e 125 first. Because this is a wildcard, it
Kojto 120:7c328cabac7e 126 doesn't matter if the user does not
Kojto 120:7c328cabac7e 127 actually link against crtbegin.o; the
Kojto 120:7c328cabac7e 128 linker won't look for a file to match a
Kojto 120:7c328cabac7e 129 wildcard. The wildcard also means that it
Kojto 120:7c328cabac7e 130 doesn't matter which directory crtbegin.o
Kojto 120:7c328cabac7e 131 is in. */
Kojto 120:7c328cabac7e 132 KEEP (*crtbegin.o(.ctors))
Kojto 120:7c328cabac7e 133 KEEP (*crtbegin?.o(.ctors))
Kojto 120:7c328cabac7e 134 /* We don't want to include the .ctor section from
Kojto 120:7c328cabac7e 135 from the crtend.o file until after the sorted ctors.
Kojto 120:7c328cabac7e 136 The .ctor section from the crtend file contains the
Kojto 120:7c328cabac7e 137 end of ctors marker and it must be last */
Kojto 120:7c328cabac7e 138 KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
Kojto 120:7c328cabac7e 139 KEEP (*(SORT(.ctors.*)))
Kojto 120:7c328cabac7e 140 KEEP (*(.ctors))
Kojto 120:7c328cabac7e 141 __CTOR_END__ = .;
Kojto 120:7c328cabac7e 142 } > m_text
Kojto 120:7c328cabac7e 143
Kojto 120:7c328cabac7e 144 .dtors :
Kojto 120:7c328cabac7e 145 {
Kojto 120:7c328cabac7e 146 __DTOR_LIST__ = .;
Kojto 120:7c328cabac7e 147 KEEP (*crtbegin.o(.dtors))
Kojto 120:7c328cabac7e 148 KEEP (*crtbegin?.o(.dtors))
Kojto 120:7c328cabac7e 149 KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
Kojto 120:7c328cabac7e 150 KEEP (*(SORT(.dtors.*)))
Kojto 120:7c328cabac7e 151 KEEP (*(.dtors))
Kojto 120:7c328cabac7e 152 __DTOR_END__ = .;
Kojto 120:7c328cabac7e 153 } > m_text
Kojto 120:7c328cabac7e 154
Kojto 120:7c328cabac7e 155 .preinit_array :
Kojto 120:7c328cabac7e 156 {
Kojto 120:7c328cabac7e 157 PROVIDE_HIDDEN (__preinit_array_start = .);
Kojto 120:7c328cabac7e 158 KEEP (*(.preinit_array*))
Kojto 120:7c328cabac7e 159 PROVIDE_HIDDEN (__preinit_array_end = .);
Kojto 120:7c328cabac7e 160 } > m_text
Kojto 120:7c328cabac7e 161
Kojto 120:7c328cabac7e 162 .init_array :
Kojto 120:7c328cabac7e 163 {
Kojto 120:7c328cabac7e 164 PROVIDE_HIDDEN (__init_array_start = .);
Kojto 120:7c328cabac7e 165 KEEP (*(SORT(.init_array.*)))
Kojto 120:7c328cabac7e 166 KEEP (*(.init_array*))
Kojto 120:7c328cabac7e 167 PROVIDE_HIDDEN (__init_array_end = .);
Kojto 120:7c328cabac7e 168 } > m_text
Kojto 120:7c328cabac7e 169
Kojto 120:7c328cabac7e 170 .fini_array :
Kojto 120:7c328cabac7e 171 {
Kojto 120:7c328cabac7e 172 PROVIDE_HIDDEN (__fini_array_start = .);
Kojto 120:7c328cabac7e 173 KEEP (*(SORT(.fini_array.*)))
Kojto 120:7c328cabac7e 174 KEEP (*(.fini_array*))
Kojto 120:7c328cabac7e 175 PROVIDE_HIDDEN (__fini_array_end = .);
Kojto 120:7c328cabac7e 176 } > m_text
Kojto 120:7c328cabac7e 177
Kojto 120:7c328cabac7e 178 __etext = .; /* define a global symbol at end of code */
Kojto 120:7c328cabac7e 179 __DATA_ROM = .; /* Symbol is used by startup for data initialization */
Kojto 120:7c328cabac7e 180
Kojto 120:7c328cabac7e 181 /* reserve MTB memory at the beginning of m_data */
Kojto 120:7c328cabac7e 182 .mtb : /* MTB buffer address as defined by the hardware */
Kojto 120:7c328cabac7e 183 {
Kojto 120:7c328cabac7e 184 . = ALIGN(8);
Kojto 120:7c328cabac7e 185 _mtb_start = .;
Kojto 120:7c328cabac7e 186 KEEP(*(.mtb_buf)) /* need to KEEP Micro Trace Buffer as not referenced by application */
Kojto 120:7c328cabac7e 187 . = ALIGN(8);
Kojto 120:7c328cabac7e 188 _mtb_end = .;
Kojto 120:7c328cabac7e 189 } > m_data
Kojto 120:7c328cabac7e 190
Kojto 120:7c328cabac7e 191 .interrupts_ram :
Kojto 120:7c328cabac7e 192 {
Kojto 120:7c328cabac7e 193 . = ALIGN(4);
Kojto 120:7c328cabac7e 194 __VECTOR_RAM__ = .;
Kojto 120:7c328cabac7e 195 __interrupts_ram_start__ = .; /* Create a global symbol at data start */
Kojto 120:7c328cabac7e 196 *(.m_interrupts_ram) /* This is a user defined section */
Kojto 120:7c328cabac7e 197 . += M_VECTOR_RAM_SIZE;
Kojto 120:7c328cabac7e 198 . = ALIGN(4);
Kojto 120:7c328cabac7e 199 __interrupts_ram_end__ = .; /* Define a global symbol at data end */
Kojto 120:7c328cabac7e 200 } > m_data
Kojto 120:7c328cabac7e 201
Kojto 120:7c328cabac7e 202 __VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts);
Kojto 120:7c328cabac7e 203 __RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
Kojto 120:7c328cabac7e 204
Kojto 120:7c328cabac7e 205 .data : AT(__DATA_ROM)
Kojto 120:7c328cabac7e 206 {
Kojto 120:7c328cabac7e 207 . = ALIGN(4);
Kojto 120:7c328cabac7e 208 __DATA_RAM = .;
Kojto 120:7c328cabac7e 209 __data_start__ = .; /* create a global symbol at data start */
Kojto 120:7c328cabac7e 210 *(.data) /* .data sections */
Kojto 120:7c328cabac7e 211 *(.data*) /* .data* sections */
Kojto 120:7c328cabac7e 212 KEEP(*(.jcr*))
Kojto 120:7c328cabac7e 213 . = ALIGN(4);
Kojto 120:7c328cabac7e 214 __data_end__ = .; /* define a global symbol at data end */
Kojto 120:7c328cabac7e 215 } > m_data
Kojto 120:7c328cabac7e 216
Kojto 120:7c328cabac7e 217 __DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
Kojto 120:7c328cabac7e 218 text_end = ORIGIN(m_text) + LENGTH(m_text);
Kojto 120:7c328cabac7e 219 ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
Kojto 120:7c328cabac7e 220
Kojto 120:7c328cabac7e 221 USB_RAM_GAP = DEFINED(__usb_ram_size__) ? __usb_ram_size__ : 0x800;
Kojto 120:7c328cabac7e 222 /* Uninitialized data section */
Kojto 120:7c328cabac7e 223 .bss :
Kojto 120:7c328cabac7e 224 {
Kojto 120:7c328cabac7e 225 /* This is used by the startup in order to initialize the .bss section */
Kojto 120:7c328cabac7e 226 . = ALIGN(4);
Kojto 120:7c328cabac7e 227 __START_BSS = .;
Kojto 120:7c328cabac7e 228 __bss_start__ = .;
Kojto 120:7c328cabac7e 229 *(.bss)
Kojto 120:7c328cabac7e 230 *(.bss*)
Kojto 120:7c328cabac7e 231 . = ALIGN(512);
Kojto 120:7c328cabac7e 232 USB_RAM_START = .;
Kojto 120:7c328cabac7e 233 . += USB_RAM_GAP;
Kojto 120:7c328cabac7e 234 *(COMMON)
Kojto 120:7c328cabac7e 235 . = ALIGN(4);
Kojto 120:7c328cabac7e 236 __bss_end__ = .;
Kojto 120:7c328cabac7e 237 __END_BSS = .;
Kojto 120:7c328cabac7e 238 } > m_data
Kojto 120:7c328cabac7e 239
Kojto 120:7c328cabac7e 240 .heap :
Kojto 120:7c328cabac7e 241 {
Kojto 120:7c328cabac7e 242 . = ALIGN(8);
Kojto 120:7c328cabac7e 243 __end__ = .;
Kojto 120:7c328cabac7e 244 PROVIDE(end = .);
Kojto 120:7c328cabac7e 245 __HeapBase = .;
Kojto 120:7c328cabac7e 246 . += HEAP_SIZE;
Kojto 120:7c328cabac7e 247 __HeapLimit = .;
Kojto 120:7c328cabac7e 248 __heap_limit = .; /* Add for _sbrk */
Kojto 120:7c328cabac7e 249 } > m_data
Kojto 120:7c328cabac7e 250
Kojto 120:7c328cabac7e 251 .stack :
Kojto 120:7c328cabac7e 252 {
Kojto 120:7c328cabac7e 253 . = ALIGN(8);
Kojto 120:7c328cabac7e 254 . += STACK_SIZE;
Kojto 120:7c328cabac7e 255 } > m_data
Kojto 120:7c328cabac7e 256
Kojto 120:7c328cabac7e 257 m_usb_bdt USB_RAM_START (NOLOAD) :
Kojto 120:7c328cabac7e 258 {
Kojto 120:7c328cabac7e 259 *(m_usb_bdt)
Kojto 120:7c328cabac7e 260 USB_RAM_BDT_END = .;
Kojto 120:7c328cabac7e 261 }
Kojto 120:7c328cabac7e 262
Kojto 120:7c328cabac7e 263 m_usb_global USB_RAM_BDT_END (NOLOAD) :
Kojto 120:7c328cabac7e 264 {
Kojto 120:7c328cabac7e 265 *(m_usb_global)
Kojto 120:7c328cabac7e 266 }
Kojto 120:7c328cabac7e 267
Kojto 120:7c328cabac7e 268 /* Initializes stack on the end of block */
Kojto 120:7c328cabac7e 269 __StackTop = ORIGIN(m_data) + LENGTH(m_data);
Kojto 120:7c328cabac7e 270 __StackLimit = __StackTop - STACK_SIZE;
Kojto 120:7c328cabac7e 271 PROVIDE(__stack = __StackTop);
Kojto 120:7c328cabac7e 272
Kojto 120:7c328cabac7e 273 .ARM.attributes 0 : { *(.ARM.attributes) }
Kojto 120:7c328cabac7e 274
Kojto 120:7c328cabac7e 275 ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap")
Kojto 120:7c328cabac7e 276 }
Kojto 120:7c328cabac7e 277