ads1115 only

Fork of mbed by mbed official

Revision:
113:f141b2784e32
Parent:
98:8ab26030e058
diff -r 6f327212ef96 -r f141b2784e32 TARGET_EFM32WG_STK3800/TOOLCHAIN_GCC_ARM/efm32wg.ld
--- a/TARGET_EFM32WG_STK3800/TOOLCHAIN_GCC_ARM/efm32wg.ld	Wed Jan 13 09:48:29 2016 +0000
+++ b/TARGET_EFM32WG_STK3800/TOOLCHAIN_GCC_ARM/efm32wg.ld	Tue Feb 02 14:43:35 2016 +0000
@@ -4,25 +4,34 @@
 /* CMSIS END USER LICENSE AGREEMENT.pdf, governing the use of       */
 /* Example Code.                                                    */
 /*                                                                  */
-/* Silicon Laboratories, Inc. 2014                                  */
+/* Silicon Laboratories, Inc. 2015                                  */
+/*                                                                  */
+/* Version 4.2.0 */
+/*                                                                  */
+
 MEMORY
 {
   FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 262144
   RAM (rwx)  : ORIGIN = 0x20000000, LENGTH = 32768
 }
+
 /* MBED: mbed needs to be able to dynamically set the interrupt vector table.
  * We make room for the table at the very beginning of RAM, i.e. at
- * 0x20000000. We need (16+39) * sizeof(uint32_t) = 220 bytes for EFM32WG */
+ * 0x20000000. We need (16+40) * sizeof(uint32_t) = 224 bytes for EFM32WG */
 __vector_size = 0xE0;
 
 /* Linker script to place sections and symbol values. Should be used together
  * with other linker script that defines memory regions FLASH and RAM.
  * It references following symbols, which must be defined in code:
  *   Reset_Handler : Entry of reset handler
- * 
+ *
  * It defines following symbols, which code can use without definition:
  *   __exidx_start
  *   __exidx_end
+ *   __copy_table_start__
+ *   __copy_table_end__
+ *   __zero_table_start__
+ *   __zero_table_end__
  *   __etext
  *   __data_start__
  *   __preinit_array_start
@@ -40,6 +49,8 @@
  *   __StackLimit
  *   __StackTop
  *   __stack
+ *   __Vectors_End
+ *   __Vectors_Size
  */
 ENTRY(Reset_Handler)
 
@@ -47,7 +58,11 @@
 {
   .text :
   {
-    KEEP(*(.isr_vector))
+    KEEP(*(.vectors))
+    __Vectors_End = .;
+    __Vectors_Size = __Vectors_End - __Vectors;
+    __end__ = .;
+
     *(.text*)
 
     KEEP(*(.init))
@@ -72,7 +87,7 @@
     KEEP(*(.eh_frame*))
   } > FLASH
 
-  .ARM.extab : 
+  .ARM.extab :
   {
     *(.ARM.extab* .gnu.linkonce.armextab.*)
   } > FLASH
@@ -84,15 +99,49 @@
   } > FLASH
   __exidx_end = .;
 
+  /* To copy multiple ROM to RAM sections,
+   * uncomment .copy.table section and,
+   * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
+  /*
+  .copy.table :
+  {
+    . = ALIGN(4);
+    __copy_table_start__ = .;
+    LONG (__etext)
+    LONG (__data_start__)
+    LONG (__data_end__ - __data_start__)
+    LONG (__etext2)
+    LONG (__data2_start__)
+    LONG (__data2_end__ - __data2_start__)
+    __copy_table_end__ = .;
+  } > FLASH
+  */
+
+  /* To clear multiple BSS sections,
+   * uncomment .zero.table section and,
+   * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
+  /*
+  .zero.table :
+  {
+    . = ALIGN(4);
+    __zero_table_start__ = .;
+    LONG (__bss_start__)
+    LONG (__bss_end__ - __bss_start__)
+    LONG (__bss2_start__)
+    LONG (__bss2_end__ - __bss2_start__)
+    __zero_table_end__ = .;
+  } > FLASH
+  */
+
   __etext = .;
-  
+
   .data : AT (__etext)
   {
     __data_start__ = .;
     *("dma")
     PROVIDE( __start_vector_table__ = .);
-  	. += __vector_size;
-  	PROVIDE( __end_vector_table__ = .);
+    . += __vector_size;
+    PROVIDE( __end_vector_table__ = .);
     *(vtable)
     *(.data*)
     . = ALIGN (4);
@@ -118,6 +167,7 @@
     KEEP(*(.fini_array))
     PROVIDE_HIDDEN (__fini_array_end = .);
 
+    KEEP(*(.jcr*))
     . = ALIGN(4);
     /* All data end */
     __data_end__ = .;
@@ -126,27 +176,30 @@
 
   .bss :
   {
+    . = ALIGN(4);
     __bss_start__ = .;
     *(.bss*)
     *(COMMON)
+    . = ALIGN(4);
     __bss_end__ = .;
   } > RAM
 
-  .heap :
+  .heap (COPY):
   {
+    __HeapBase = .;
     __end__ = .;
     end = __end__;
     _end = __end__;
-    *(.heap*)
+    KEEP(*(.heap*))
     __HeapLimit = .;
   } > RAM
 
   /* .stack_dummy section doesn't contains any symbols. It is only
    * used for linker to calculate size of stack sections, and assign
    * values to stack symbols later */
-  .stack_dummy :
+  .stack_dummy (COPY):
   {
-    *(.stack)
+    KEEP(*(.stack*))
   } > RAM
 
   /* Set stack top to end of RAM, and stack limit move down by
@@ -157,4 +210,7 @@
 
   /* Check if data + heap + stack exceeds RAM limit */
   ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
+
+  /* Check if FLASH usage exceeds FLASH size */
+  ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")
 }