mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-20 21:01:25 +03:00
[sam] fixing linker files and adding a compiler option
This commit is contained in:
@ -5,12 +5,12 @@
|
|||||||
name=Atmel SAM3
|
name=Atmel SAM3
|
||||||
compiler.path={runtime.ide.path}/hardware/tools/g++_arm_none_eabi/bin/
|
compiler.path={runtime.ide.path}/hardware/tools/g++_arm_none_eabi/bin/
|
||||||
compiler.c.cmd=arm-none-eabi-gcc
|
compiler.c.cmd=arm-none-eabi-gcc
|
||||||
compiler.c.flags=-c -g -Os -w -mlong-calls -ffunction-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf
|
compiler.c.flags=-c -g -Os -w -mlong-calls -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf
|
||||||
compiler.c.elf.cmd=arm-none-eabi-gcc
|
compiler.c.elf.cmd=arm-none-eabi-gcc
|
||||||
compiler.c.elf.flags=-Os -Wl,--gc-sections
|
compiler.c.elf.flags=-Os -Wl,--gc-sections
|
||||||
compiler.S.flags=-c -g -assembler-with-cpp
|
compiler.S.flags=-c -g -assembler-with-cpp
|
||||||
compiler.cpp.cmd=arm-none-eabi-g++
|
compiler.cpp.cmd=arm-none-eabi-g++
|
||||||
compiler.cpp.flags=-c -g -Os -w -mlong-calls -ffunction-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf
|
compiler.cpp.flags=-c -g -Os -w -mlong-calls -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf
|
||||||
compiler.ar.cmd=arm-none-eabi-ar
|
compiler.ar.cmd=arm-none-eabi-ar
|
||||||
compiler.ar.flags=rcs
|
compiler.ar.flags=rcs
|
||||||
compiler.objcopy.cmd=arm-none-eabi-objcopy
|
compiler.objcopy.cmd=arm-none-eabi-objcopy
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
* ATMEL Microcontroller Software Support
|
* SAM Software Package License
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
* Copyright (c) 2009, Atmel Corporation
|
* Copyright (c) 2012, Atmel Corporation
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following condition is met:
|
||||||
*
|
*
|
||||||
* - Redistributions of source code must retain the above copyright notice,
|
* - Redistributions of source code must retain the above copyright notice,
|
||||||
* this list of conditions and the disclaimer below.
|
* this list of conditions and the disclaimer below.
|
||||||
@ -27,10 +27,6 @@
|
|||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Linker script for running in internal FLASH on the SAM3U4
|
|
||||||
*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||||
OUTPUT_ARCH(arm)
|
OUTPUT_ARCH(arm)
|
||||||
SEARCH_DIR(.)
|
SEARCH_DIR(.)
|
||||||
@ -38,22 +34,20 @@ SEARCH_DIR(.)
|
|||||||
/* Memory Spaces Definitions */
|
/* Memory Spaces Definitions */
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
flash0 (W!RX) : ORIGIN = 0x00080000, LENGTH = 0x00020000 /* Flash0, 128K */
|
rom (rx) : ORIGIN = 0x00080000, LENGTH = 0x00080000 /* Flash, 512K */
|
||||||
flash1 (W!RX) : ORIGIN = 0x00100000, LENGTH = 0x00020000 /* Flash1, 128K */
|
sram0 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000 /* sram0, 64K */
|
||||||
sram0 (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* Sram0, 32K */
|
sram1 (rwx) : ORIGIN = 0x20080000, LENGTH = 0x00008000 /* sram1, 32K */
|
||||||
sram1 (W!RX) : ORIGIN = 0x20080000, LENGTH = 0x00004000 /* Sram1, 16K */
|
ram (rwx) : ORIGIN = 0x20070000, LENGTH = 0x00018000 /* sram, 96K */
|
||||||
rom (rx) : ORIGIN = ORIGIN(flash1)-LENGTH(flash0), LENGTH = LENGTH(flash0)+LENGTH(flash1) /* Flash, 256K */
|
|
||||||
ram (rwx) : ORIGIN = ORIGIN( sram1)-LENGTH( sram0), LENGTH = LENGTH( sram0)+LENGTH( sram1) /* sram, 48K */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust */
|
/* The stack size used by the application. NOTE: you need to adjust */
|
||||||
STACK_SIZE = 0x2000;
|
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : 0x2000 ;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_sfixed = .;
|
_sfixed = .;
|
||||||
KEEP(*(.vectors .vectors.*))
|
KEEP(*(.vectors .vectors.*))
|
||||||
@ -99,17 +93,17 @@ SECTIONS
|
|||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_efixed = .; /* End of text section */
|
_efixed = .; /* End of text section */
|
||||||
} > flash0
|
} > rom
|
||||||
|
|
||||||
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
||||||
PROVIDE_HIDDEN (__exidx_start = .);
|
PROVIDE_HIDDEN (__exidx_start = .);
|
||||||
.ARM.exidx :
|
.ARM.exidx :
|
||||||
{
|
{
|
||||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||||
} > flash0
|
} > rom
|
||||||
PROVIDE_HIDDEN (__exidx_end = .);
|
PROVIDE_HIDDEN (__exidx_end = .);
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
||||||
|
|
||||||
.relocate : AT (_etext)
|
.relocate : AT (_etext)
|
||||||
@ -120,11 +114,11 @@ SECTIONS
|
|||||||
*(.data .data.*);
|
*(.data .data.*);
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_erelocate = .;
|
_erelocate = .;
|
||||||
} > sram0
|
} > ram
|
||||||
|
|
||||||
/* .bss section which is used for uninitialized data */
|
/* .bss section which is used for uninitialized data */
|
||||||
.bss (NOLOAD) :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_sbss = . ;
|
_sbss = . ;
|
||||||
_szero = .;
|
_szero = .;
|
||||||
@ -133,18 +127,18 @@ SECTIONS
|
|||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_ebss = . ;
|
_ebss = . ;
|
||||||
_ezero = .;
|
_ezero = .;
|
||||||
} > sram0
|
} > ram
|
||||||
|
|
||||||
/* stack section */
|
/* stack section */
|
||||||
.stack (NOLOAD):
|
.stack (NOLOAD):
|
||||||
{
|
{
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
_sstack = .;
|
_sstack = .;
|
||||||
. = . + STACK_SIZE;
|
. = . + STACK_SIZE;
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
_estack = .;
|
_estack = .;
|
||||||
} > sram1
|
} > ram
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_end = . ;
|
_end = . ;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
* ATMEL Microcontroller Software Support
|
* SAM Software Package License
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
* Copyright (c) 2009, Atmel Corporation
|
* Copyright (c) 2012, Atmel Corporation
|
||||||
*
|
*
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following condition is met:
|
||||||
*
|
*
|
||||||
* - Redistributions of source code must retain the above copyright notice,
|
* - Redistributions of source code must retain the above copyright notice,
|
||||||
* this list of conditions and the disclaimer below.
|
* this list of conditions and the disclaimer below.
|
||||||
@ -27,10 +27,6 @@
|
|||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Linker script for running in internal SRAM on the SAM3U4
|
|
||||||
*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||||
OUTPUT_ARCH(arm)
|
OUTPUT_ARCH(arm)
|
||||||
SEARCH_DIR(.)
|
SEARCH_DIR(.)
|
||||||
@ -38,22 +34,20 @@ SEARCH_DIR(.)
|
|||||||
/* Memory Spaces Definitions */
|
/* Memory Spaces Definitions */
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
flash0 (W!RX) : ORIGIN = 0x00080000, LENGTH = 0x00020000 /* Flash0, 128K */
|
rom (rx) : ORIGIN = 0x00080000, LENGTH = 0x00080000 /* Flash, 512K */
|
||||||
flash1 (W!RX) : ORIGIN = 0x00100000, LENGTH = 0x00020000 /* Flash1, 128K */
|
sram0 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000 /* sram0, 64K */
|
||||||
sram0 (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* Sram0, 32K */
|
sram1 (rwx) : ORIGIN = 0x20080000, LENGTH = 0x00008000 /* sram1, 32K */
|
||||||
sram1 (W!RX) : ORIGIN = 0x20080000, LENGTH = 0x00004000 /* Sram1, 16K */
|
ram (rwx) : ORIGIN = 0x20070000, LENGTH = 0x00018000 /* sram, 96K */
|
||||||
rom (rx) : ORIGIN = ORIGIN(flash1)-LENGTH(flash0), LENGTH = LENGTH(flash0)+LENGTH(flash1) /* Flash, 256K */
|
|
||||||
ram (rwx) : ORIGIN = ORIGIN( sram1)-LENGTH( sram0), LENGTH = LENGTH( sram0)+LENGTH( sram1) /* sram, 48K */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust */
|
/* The stack size used by the application. NOTE: you need to adjust */
|
||||||
STACK_SIZE = 0x800;
|
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : 0x2000 ;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_sfixed = .;
|
_sfixed = .;
|
||||||
KEEP(*(.vectors .vectors.*))
|
KEEP(*(.vectors .vectors.*))
|
||||||
@ -99,9 +93,9 @@ SECTIONS
|
|||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_efixed = .; /* End of text section */
|
_efixed = .; /* End of text section */
|
||||||
} > sram0
|
} > ram
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
||||||
|
|
||||||
.relocate : AT (_etext)
|
.relocate : AT (_etext)
|
||||||
@ -112,11 +106,11 @@ SECTIONS
|
|||||||
*(.data .data.*);
|
*(.data .data.*);
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_erelocate = .;
|
_erelocate = .;
|
||||||
} > sram1
|
} > ram
|
||||||
|
|
||||||
/* .bss section which is used for uninitialized data */
|
/* .bss section which is used for uninitialized data */
|
||||||
.bss (NOLOAD) :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_sbss = . ;
|
_sbss = . ;
|
||||||
_szero = .;
|
_szero = .;
|
||||||
@ -125,26 +119,26 @@ SECTIONS
|
|||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_ebss = . ;
|
_ebss = . ;
|
||||||
_ezero = .;
|
_ezero = .;
|
||||||
} > sram1
|
} > ram
|
||||||
|
|
||||||
/* stack section */
|
/* stack section */
|
||||||
.stack (NOLOAD):
|
.stack (NOLOAD):
|
||||||
{
|
{
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
_sstack = .;
|
_sstack = .;
|
||||||
. = . + STACK_SIZE;
|
. = . + STACK_SIZE;
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
_estack = .;
|
_estack = .;
|
||||||
} > sram1
|
} > ram
|
||||||
|
|
||||||
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
||||||
PROVIDE_HIDDEN (__exidx_start = .);
|
PROVIDE_HIDDEN (__exidx_start = .);
|
||||||
.ARM.exidx :
|
.ARM.exidx :
|
||||||
{
|
{
|
||||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||||
} > sram1
|
} > ram
|
||||||
PROVIDE_HIDDEN (__exidx_end = .);
|
PROVIDE_HIDDEN (__exidx_end = .);
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_end = . ;
|
_end = . ;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user