mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
[sam] adding google adk2 support on whole build system and makefiles
cleanup
This commit is contained in:
@ -1,16 +1,16 @@
|
||||
|
||||
# SAM3 compile variables
|
||||
# ---------------------
|
||||
# ---------------------
|
||||
|
||||
name=Atmel SAM3
|
||||
compiler.path={runtime.ide.path}/hardware/tools/g++_arm_none_eabi/bin/
|
||||
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.flags=-Os -Wl,--gc-sections
|
||||
compiler.S.flags=-c -g -assembler-with-cpp
|
||||
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.flags=rcs
|
||||
compiler.objcopy.cmd=arm-none-eabi-objcopy
|
||||
@ -53,6 +53,7 @@ recipe.size.regex=\.text\s+([0-9]+).*
|
||||
# -------------------
|
||||
|
||||
tools.bossac.cmd=bossac
|
||||
tools.bossac.cmd.windows=bossac.exe
|
||||
tools.bossac.path={runtime.ide.path}/hardware/tools
|
||||
|
||||
tools.bossac.upload.params.verbose=-i -d
|
||||
|
@ -8,7 +8,7 @@
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
@ -17,9 +17,9 @@
|
||||
#
|
||||
|
||||
# Makefile for compiling libboard
|
||||
BOARD =
|
||||
BOARD =
|
||||
|
||||
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
|
||||
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables --no-print-directory
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Rules
|
||||
|
@ -8,7 +8,7 @@
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
@ -17,9 +17,9 @@
|
||||
#
|
||||
|
||||
# Makefile for compiling libboard
|
||||
BOARD =
|
||||
BOARD =
|
||||
|
||||
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
|
||||
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables --no-print-directory
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Rules
|
||||
|
Binary file not shown.
@ -8,7 +8,7 @@
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
@ -16,10 +16,7 @@
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
# Makefile for compiling libboard
|
||||
BOARD =
|
||||
|
||||
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
|
||||
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables --no-print-directory
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Rules
|
||||
@ -39,4 +36,3 @@ clean:
|
||||
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libvariant_sam3x_ek.mk $@
|
||||
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libvariant_sam3x_ek.mk $@
|
||||
|
||||
|
||||
|
@ -48,13 +48,14 @@ VARIANT_PATH = ../../../variants/$(VARIANT)
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
|
||||
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH)
|
||||
vpath %.cpp $(PROJECT_BASE_PATH)
|
||||
|
||||
VPATH+=$(PROJECT_BASE_PATH)
|
||||
|
||||
INCLUDES =
|
||||
#INCLUDES += -I$(PROJECT_BASE_PATH)
|
||||
INCLUDES += -I$(ARDUINO_PATH)
|
||||
INCLUDES += -I$(ARDUINO_PATH)/USB
|
||||
INCLUDES += -I$(SYSTEM_PATH)
|
||||
INCLUDES += -I$(SYSTEM_PATH)/libsam
|
||||
INCLUDES += -I$(VARIANT_BASE_PATH)
|
||||
@ -166,8 +167,8 @@ $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
|
||||
@"$(AS)" -c $(ASFLAGS) $< -o $@
|
||||
|
||||
$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
|
||||
"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
|
||||
"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
|
||||
@"$(AR)" -v -r "$(OUTPUT_BIN)/$@" $^
|
||||
@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
|
||||
|
||||
|
||||
.PHONY: clean
|
||||
@ -175,3 +176,4 @@ clean:
|
||||
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
|
||||
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
|
||||
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
|
||||
|
||||
|
@ -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.
|
||||
*
|
||||
* 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,
|
||||
* 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_ARCH(arm)
|
||||
SEARCH_DIR(.)
|
||||
@ -38,22 +34,20 @@ SEARCH_DIR(.)
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
flash0 (W!RX) : ORIGIN = 0x00080000, LENGTH = 0x00020000 /* Flash0, 128K */
|
||||
flash1 (W!RX) : ORIGIN = 0x00100000, LENGTH = 0x00020000 /* Flash1, 128K */
|
||||
sram0 (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* Sram0, 32K */
|
||||
sram1 (W!RX) : ORIGIN = 0x20080000, LENGTH = 0x00004000 /* Sram1, 16K */
|
||||
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 */
|
||||
rom (rx) : ORIGIN = 0x00080000, LENGTH = 0x00080000 /* Flash, 512K */
|
||||
sram0 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000 /* sram0, 64K */
|
||||
sram1 (rwx) : ORIGIN = 0x20080000, LENGTH = 0x00008000 /* sram1, 32K */
|
||||
ram (rwx) : ORIGIN = 0x20070000, LENGTH = 0x00018000 /* sram, 96K */
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
/* Section Definitions */
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sfixed = .;
|
||||
KEEP(*(.vectors .vectors.*))
|
||||
@ -99,9 +93,9 @@ SECTIONS
|
||||
|
||||
. = ALIGN(4);
|
||||
_efixed = .; /* End of text section */
|
||||
} > sram0
|
||||
} > ram
|
||||
|
||||
. = ALIGN(4);
|
||||
. = ALIGN(4);
|
||||
_etext = .;
|
||||
|
||||
.relocate : AT (_etext)
|
||||
@ -112,11 +106,11 @@ SECTIONS
|
||||
*(.data .data.*);
|
||||
. = ALIGN(4);
|
||||
_erelocate = .;
|
||||
} > sram1
|
||||
} > ram
|
||||
|
||||
/* .bss section which is used for uninitialized data */
|
||||
/* .bss section which is used for uninitialized data */
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sbss = . ;
|
||||
_szero = .;
|
||||
@ -125,26 +119,27 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
_ebss = . ;
|
||||
_ezero = .;
|
||||
} > sram1
|
||||
} > ram
|
||||
|
||||
/* stack section */
|
||||
.stack (NOLOAD):
|
||||
{
|
||||
. = ALIGN(8);
|
||||
_sstack = .;
|
||||
_sstack = .;
|
||||
. = . + STACK_SIZE;
|
||||
. = ALIGN(8);
|
||||
_estack = .;
|
||||
} > sram1
|
||||
} > ram
|
||||
|
||||
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
||||
PROVIDE_HIDDEN (__exidx_start = .);
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > sram1
|
||||
} > ram
|
||||
PROVIDE_HIDDEN (__exidx_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,6 @@ extern void init( void )
|
||||
|
||||
// Initialize analogOutput module
|
||||
analogOutputInit();
|
||||
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -23,6 +23,9 @@
|
||||
* Headers
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
// We have native USB on this variant
|
||||
#define USBCON
|
||||
|
||||
#include "Arduino.h"
|
||||
#ifdef __cplusplus
|
||||
#include "UARTClass.h"
|
||||
@ -49,12 +52,6 @@
|
||||
/** Name of the board */
|
||||
#define VARIANT_NAME "SAM3X-EK"
|
||||
|
||||
/*
|
||||
#define VARIANT_REV_A
|
||||
#define VARIANT_REV_B
|
||||
#define VARIANT_REV_C
|
||||
#define VARIANT_REV_D
|
||||
*/
|
||||
|
||||
/** Frequency of the board main oscillator */
|
||||
#define VARIANT_MAINOSC 12000000
|
||||
@ -108,6 +105,7 @@ static const uint8_t A0 = 10;
|
||||
#define TC_FREQUENCY 1000
|
||||
#define TC_MAX_DUTY_CYCLE 255
|
||||
#define TC_MIN_DUTY_CYCLE 0
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
Reference in New Issue
Block a user