1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-30 19:52:13 +01:00

Merge branch 'platforms-arm' of https://github.com/arduino/ARM into platforms-arm

This commit is contained in:
Thibault RICHARD 2012-05-03 14:34:12 +02:00
commit 56c7e2fdb8
56 changed files with 1160 additions and 481 deletions

View File

@ -28,11 +28,11 @@ class HardwareSerial : public Stream
public:
void begin(unsigned long);
void end();
virtual int available(void);
virtual int peek(void);
virtual int read(void);
virtual void flush(void);
virtual size_t write(uint8_t);
virtual int available(void) = 0;
virtual int peek(void) = 0;
virtual int read(void) = 0;
virtual void flush(void) = 0;
virtual size_t write(uint8_t) = 0;
using Print::write; // pull in write(str) and write(buf, size) from Print
operator bool();
};

View File

@ -20,8 +20,6 @@
#ifndef Printable_h
#define Printable_h
#include <new.h>
class Print;
/** The Printable class provides a way for new classes to allow themselves to be printed.

View File

@ -528,11 +528,6 @@ int String::lastIndexOf(const String &s2, unsigned int fromIndex) const
return found;
}
String String::substring( unsigned int left ) const
{
return substring(left, len);
}
String String::substring(unsigned int left, unsigned int right) const
{
if (left > right) {

View File

@ -156,7 +156,7 @@ public:
int lastIndexOf( char ch, unsigned int fromIndex ) const;
int lastIndexOf( const String &str ) const;
int lastIndexOf( const String &str, unsigned int fromIndex ) const;
String substring( unsigned int beginIndex ) const;
String substring( unsigned int beginIndex ) const { return substring(beginIndex, len); };
String substring( unsigned int beginIndex, unsigned int endIndex ) const;
// modification

View File

@ -1,9 +1,27 @@
#
# Copyright (c) 2012 Arduino. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# 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.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
ifeq ("$(VARIANTS)", "")
VARIANTS = arduino_due_x arduino_due_u sam3x_ek
#VARIANTS = sam3u_ek sam3s_ek
VARIANTS = arduino_due_x sam3x_ek adk2
#VARIANTS = sam3u_ek sam3s_ek arduino_due_u
endif
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables --no-print-directory
#-------------------------------------------------------------------------------
# Rules
@ -13,36 +31,55 @@ all: $(VARIANTS)
.PHONY: sam3s_ek
sam3s_ek:
@echo ------------------------------------------------------------------------------------
@echo --- Making sam3s_ek
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk
@echo ------------------------------------------------------------------------------------
.PHONY: sam3u_ek
sam3u_ek:
@echo ------------------------------------------------------------------------------------
@echo --- Making sam3u_ek
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk
@echo ------------------------------------------------------------------------------------
.PHONY: sam3x_ek
sam3x_ek:
@echo ------------------------------------------------------------------------------------
@echo --- Making sam3x_ek
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3x_ek.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3x_ek.mk
@echo ------------------------------------------------------------------------------------
.PHONY: arduino_due_u
arduino_due_u:
@echo ------------------------------------------------------------------------------------
@echo --- Making arduino_due_u
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_arduino_due_u.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_arduino_due_u.mk
@echo ------------------------------------------------------------------------------------
.PHONY: arduino_due_x
arduino_due_x:
@echo ------------------------------------------------------------------------------------
@echo --- Making arduino_due_x
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_arduino_due_x.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_arduino_due_x.mk
@echo ------------------------------------------------------------------------------------
.PHONY: adk2
adk2:
@echo ------------------------------------------------------------------------------------
@echo --- Making adk2
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_adk2.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_adk2.mk
@echo ------------------------------------------------------------------------------------
.PHONY: clean
clean:
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning sam3s_ek
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk $@
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk $@
@ -63,4 +100,9 @@ clean:
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_arduino_due_x.mk $@
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_arduino_due_x.mk $@
@echo --- Cleaning adk2
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_adk2.mk $@
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_adk2.mk $@
@echo ------------------------------------------------------------------------------------

View File

@ -0,0 +1,183 @@
#
# Copyright (c) 2012 Arduino. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# 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.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Makefile for compiling libArduino
.SUFFIXES: .o .a .c .s
CHIP=__SAM3X8E__
VARIANT=adk2
LIBNAME=libarduino_$(VARIANT)
TOOLCHAIN=gcc
#-------------------------------------------------------------------------------
# Path
#-------------------------------------------------------------------------------
# Output directories
OUTPUT_BIN = ..
# Libraries
PROJECT_BASE_PATH = ..
PROJECT_BASE_PATH_USB = ../USB
SYSTEM_PATH = ../../../system
CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
VARIANT_PATH = ../../../../../google/sam/variants/$(VARIANT)
#-------------------------------------------------------------------------------
# Files
#-------------------------------------------------------------------------------
#vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
VPATH+=$(PROJECT_BASE_PATH)
INCLUDES =
INCLUDES += -I$(PROJECT_BASE_PATH)
INCLUDES += -I$(PROJECT_BASE_PATH_USB)
INCLUDES += -I$(VARIANT_PATH)
INCLUDES += -I$(CMSIS_ARM_PATH)
INCLUDES += -I$(CMSIS_ATMEL_PATH)
INCLUDES += -I$(SYSTEM_PATH)
INCLUDES += -I$(SYSTEM_PATH)/libsam
#-------------------------------------------------------------------------------
ifdef DEBUG
include debug.mk
else
include release.mk
endif
#-------------------------------------------------------------------------------
# Tools
#-------------------------------------------------------------------------------
include $(TOOLCHAIN).mk
CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
#-------------------------------------------------------------------------------
ifdef DEBUG
OUTPUT_OBJ=debug
OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_dbg.a
else
OUTPUT_OBJ=release
OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_rel.a
endif
OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
#-------------------------------------------------------------------------------
# C source files and objects
#-------------------------------------------------------------------------------
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
# during development, remove some files
C_OBJ_FILTER=
C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
#-------------------------------------------------------------------------------
# CPP source files and objects
#-------------------------------------------------------------------------------
CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
# during development, remove some files
CPP_OBJ_FILTER=
CPP_OBJ=$(filter-out $(CPP_OBJ_FILTER), $(CPP_OBJ_TEMP))
#-------------------------------------------------------------------------------
# Assembler source files and objects
#-------------------------------------------------------------------------------
A_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.s)
A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
# during development, remove some files
A_OBJ_FILTER=
A_OBJ=$(filter-out $(A_OBJ_FILTER), $(A_OBJ_TEMP))
#-------------------------------------------------------------------------------
# Rules
#-------------------------------------------------------------------------------
all: $(VARIANT)
$(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo ------------------------------------------------------------------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo ------------------------------------------------------------------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
# @echo *$(C_SRC)
# @echo -------------------------
# @echo *$(C_OBJ)
# @echo -------------------------
# @echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ))
# @echo -------------------------
# @echo *$(CPP_SRC)
# @echo -------------------------
# @echo *$(CPP_OBJ)
# @echo -------------------------
# @echo *$(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ))
# @echo -------------------------
# @echo *$(A_SRC)
# @echo -------------------------
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# "$(CC)" -v -c $(CFLAGS) $< -o $@
@"$(CC)" -c $(CFLAGS) $< -o $@
#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
# "$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# "$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(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))
@echo ------------------------------------------------------------------------------------
@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
@echo ------------------------------------------------------------------------------------
.PHONY: clean
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

View File

@ -29,11 +29,11 @@ TOOLCHAIN=gcc
#-------------------------------------------------------------------------------
# Output directories
#OUTPUT_BIN = ../lib
OUTPUT_BIN = ..
# Libraries
PROJECT_BASE_PATH = ..
PROJECT_BASE_PATH_USB = ../USB
SYSTEM_PATH = ../../../system
CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
@ -45,14 +45,15 @@ VARIANT_PATH = ../../../variants/$(VARIANT)
# Files
#-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH)
#vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
VPATH+=$(PROJECT_BASE_PATH)
INCLUDES =
INCLUDES += -I$(PROJECT_BASE_PATH)
INCLUDES += -I$(PROJECT_BASE_PATH_USB)
INCLUDES += -I$(VARIANT_PATH)
INCLUDES += -I$(CMSIS_ARM_PATH)
INCLUDES += -I$(CMSIS_ATMEL_PATH)
@ -72,6 +73,9 @@ endif
include $(TOOLCHAIN).mk
CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
#-------------------------------------------------------------------------------
ifdef DEBUG
OUTPUT_OBJ=debug
@ -87,6 +91,7 @@ OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
# C source files and objects
#-------------------------------------------------------------------------------
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
#C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
@ -99,6 +104,7 @@ C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
# CPP source files and objects
#-------------------------------------------------------------------------------
CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp)
#CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
@ -128,9 +134,9 @@ $(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo -------------------------
@echo ------------------------------------------------------------------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo -------------------------
@echo ------------------------------------------------------------------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
# @echo *$(C_SRC)
@ -148,24 +154,28 @@ create_output:
# @echo *$(A_SRC)
# @echo -------------------------
# -@mkdir $(subst /,$(SEP),$(OUTPUT_BIN)) 1>NUL 2>&1
-mkdir $(subst /,$(SEP),$(OUTPUT_BIN))
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @"$(CC)" -v -c $(CFLAGS) $< -o $@
# "$(CC)" -v -c $(CFLAGS) $< -o $@
@"$(CC)" -c $(CFLAGS) $< -o $@
#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
# "$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @"$(CC)" -c $(CPPFLAGS) $< -o $@
# "$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(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)/$@" $^
@echo ------------------------------------------------------------------------------------
@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
@echo ------------------------------------------------------------------------------------
.PHONY: clean

View File

@ -29,7 +29,6 @@ TOOLCHAIN=gcc
#-------------------------------------------------------------------------------
# Output directories
#OUTPUT_BIN = ../lib
OUTPUT_BIN = ..
# Libraries
@ -46,9 +45,9 @@ VARIANT_PATH = ../../../variants/$(VARIANT)
# Files
#-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
#vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(PROJECT_BASE_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
VPATH+=$(PROJECT_BASE_PATH)
@ -133,9 +132,9 @@ $(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo -------------------------
@echo ------------------------------------------------------------------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo -------------------------
@echo ------------------------------------------------------------------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
# @echo *$(C_SRC)
@ -153,9 +152,8 @@ create_output:
# @echo *$(A_SRC)
# @echo -------------------------
# -@mkdir $(subst /,$(SEP),$(OUTPUT_BIN)) 1>NUL 2>&1
-mkdir $(subst /,$(SEP),$(OUTPUT_BIN))
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# "$(CC)" -v -c $(CFLAGS) $< -o $@
@ -165,15 +163,17 @@ $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# "$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
# @"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
# "$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(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)/$@" $^
@echo ------------------------------------------------------------------------------------
@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
@echo ------------------------------------------------------------------------------------
.PHONY: clean

View File

@ -29,30 +29,31 @@ TOOLCHAIN=gcc
#-------------------------------------------------------------------------------
# Output directories
#OUTPUT_BIN = ../lib
OUTPUT_BIN = ..
# Libraries
PROJECT_BASE_PATH = ..
PROJECT_BASE_PATH_USB = ../USB
SYSTEM_PATH = ../../../system
CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
VARIANT_PATH = ../../../variants/$(VARIANT)
VARIANT_PATH = ../../../../../atmel/sam/variants/$(VARIANT)
#-------------------------------------------------------------------------------
# Files
#-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH)
#vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
VPATH+=$(PROJECT_BASE_PATH)
INCLUDES =
INCLUDES += -I$(PROJECT_BASE_PATH)
INCLUDES += -I$(PROJECT_BASE_PATH_USB)
INCLUDES += -I$(VARIANT_PATH)
INCLUDES += -I$(CMSIS_ARM_PATH)
INCLUDES += -I$(CMSIS_ATMEL_PATH)
@ -72,6 +73,9 @@ endif
include $(TOOLCHAIN).mk
CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
#-------------------------------------------------------------------------------
ifdef DEBUG
OUTPUT_OBJ=debug
@ -86,7 +90,7 @@ OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
#-------------------------------------------------------------------------------
# C source files and objects
#-------------------------------------------------------------------------------
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
@ -98,7 +102,7 @@ C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
#-------------------------------------------------------------------------------
# CPP source files and objects
#-------------------------------------------------------------------------------
CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp)
CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
@ -128,9 +132,9 @@ $(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo -------------------------
@echo ------------------------------------------------------------------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo -------------------------
@echo ------------------------------------------------------------------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
# @echo *$(C_SRC)
@ -148,24 +152,28 @@ create_output:
# @echo *$(A_SRC)
# @echo -------------------------
# -@mkdir $(subst /,$(SEP),$(OUTPUT_BIN)) 1>NUL 2>&1
-mkdir $(subst /,$(SEP),$(OUTPUT_BIN))
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @"$(CC)" -v -c $(CFLAGS) $< -o $@
# "$(CC)" -v -c $(CFLAGS) $< -o $@
@"$(CC)" -c $(CFLAGS) $< -o $@
#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
# "$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @"$(CC)" -c $(CPPFLAGS) $< -o $@
# "$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(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)/$@" $^
@echo ------------------------------------------------------------------------------------
@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
@echo ------------------------------------------------------------------------------------
.PHONY: clean

View File

@ -29,30 +29,31 @@ TOOLCHAIN=gcc
#-------------------------------------------------------------------------------
# Output directories
#OUTPUT_BIN = ../lib
OUTPUT_BIN = ..
# Libraries
PROJECT_BASE_PATH = ..
PROJECT_BASE_PATH_USB = ../USB
SYSTEM_PATH = ../../../system
CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
VARIANT_PATH = ../../../variants/$(VARIANT)
VARIANT_PATH = ../../../../../atmel/sam/variants/$(VARIANT)
#-------------------------------------------------------------------------------
# Files
#-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH)
vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
VPATH+=$(PROJECT_BASE_PATH)
INCLUDES =
INCLUDES += -I$(PROJECT_BASE_PATH)
INCLUDES += -I$(PROJECT_BASE_PATH_USB)
INCLUDES += -I$(VARIANT_PATH)
INCLUDES += -I$(CMSIS_ARM_PATH)
INCLUDES += -I$(CMSIS_ATMEL_PATH)
@ -72,6 +73,9 @@ endif
include $(TOOLCHAIN).mk
CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
#-------------------------------------------------------------------------------
ifdef DEBUG
OUTPUT_OBJ=debug
@ -86,7 +90,7 @@ OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
#-------------------------------------------------------------------------------
# C source files and objects
#-------------------------------------------------------------------------------
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
@ -98,7 +102,7 @@ C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
#-------------------------------------------------------------------------------
# CPP source files and objects
#-------------------------------------------------------------------------------
CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp)
CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
@ -128,9 +132,9 @@ $(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo -------------------------
@echo ------------------------------------------------------------------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo -------------------------
@echo ------------------------------------------------------------------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
# @echo *$(C_SRC)
@ -149,21 +153,27 @@ create_output:
# @echo -------------------------
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @"$(CC)" -v -c $(CFLAGS) $< -o $@
# "$(CC)" -v -c $(CFLAGS) $< -o $@
@"$(CC)" -c $(CFLAGS) $< -o $@
#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
# "$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @"$(CC)" -c $(CPPFLAGS) $< -o $@
# "$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(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)/$@" $^
@echo ------------------------------------------------------------------------------------
@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
@echo ------------------------------------------------------------------------------------
.PHONY: clean

View File

@ -29,11 +29,11 @@ TOOLCHAIN=gcc
#-------------------------------------------------------------------------------
# Output directories
#OUTPUT_BIN = ../lib
OUTPUT_BIN = ..
# Libraries
PROJECT_BASE_PATH = ..
PROJECT_BASE_PATH_USB = ../USB
SYSTEM_PATH = ../../../system
CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
@ -45,14 +45,15 @@ VARIANT_PATH = ../../../../../atmel/sam/variants/$(VARIANT)
# Files
#-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH)
vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
VPATH+=$(PROJECT_BASE_PATH)
INCLUDES =
INCLUDES += -I$(PROJECT_BASE_PATH)
INCLUDES += -I$(PROJECT_BASE_PATH_USB)
INCLUDES += -I$(VARIANT_PATH)
INCLUDES += -I$(CMSIS_ARM_PATH)
INCLUDES += -I$(CMSIS_ATMEL_PATH)
@ -72,6 +73,9 @@ endif
include $(TOOLCHAIN).mk
CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
#-------------------------------------------------------------------------------
ifdef DEBUG
OUTPUT_OBJ=debug
@ -86,7 +90,7 @@ OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
#-------------------------------------------------------------------------------
# C source files and objects
#-------------------------------------------------------------------------------
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
@ -98,7 +102,7 @@ C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
#-------------------------------------------------------------------------------
# CPP source files and objects
#-------------------------------------------------------------------------------
CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp)
CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
@ -128,9 +132,9 @@ $(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo -------------------------
@echo ------------------------------------------------------------------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo -------------------------
@echo ------------------------------------------------------------------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
# @echo *$(C_SRC)
@ -149,21 +153,27 @@ create_output:
# @echo -------------------------
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @"$(CC)" -v -c $(CFLAGS) $< -o $@
# "$(CC)" -v -c $(CFLAGS) $< -o $@
@"$(CC)" -c $(CFLAGS) $< -o $@
#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
# "$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @"$(CC)" -c $(CPPFLAGS) $< -o $@
# "$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
$(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)/$@" $^
@echo ------------------------------------------------------------------------------------
@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
@echo ------------------------------------------------------------------------------------
.PHONY: clean

View File

@ -1,5 +1,5 @@
/*
Copyright (c) 2011 Arduino. All right reserved.
Copyright (c) 2012 Arduino. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -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
@ -22,42 +22,42 @@
extern "C" {
#endif
extern void NMI_Handler( void )
void NMI_Handler( void )
{
for ( ;; ) ;
}
extern void HardFault_Handler( void )
void HardFault_Handler( void )
{
for ( ;; ) ;
}
extern void MemManage_Handler( void )
void MemManage_Handler( void )
{
for ( ;; ) ;
}
extern void BusFault_Handler( void )
void BusFault_Handler( void )
{
for ( ;; ) ;
}
extern void UsageFault_Handler( void )
void UsageFault_Handler( void )
{
for ( ;; ) ;
}
extern void SVC_Handler( void )
void SVC_Handler( void )
{
for ( ;; ) ;
}
extern void DebugMon_Handler( void )
void DebugMon_Handler( void )
{
for ( ;; ) ;
}
extern void PendSV_Handler( void )
void PendSV_Handler( void )
{
for ( ;; ) ;
}

View File

@ -0,0 +1,388 @@
adc.o:
00000000 T adc_configure_power_save
00000000 T adc_configure_sequence
00000000 T adc_configure_timing
00000000 T adc_configure_trigger
00000000 T adc_disable_all_channel
00000000 T adc_disable_anch
00000000 T adc_disable_channel
00000000 T adc_disable_channel_differential_input
00000000 T adc_disable_channel_input_offset
00000000 T adc_disable_interrupt
00000000 T adc_disable_tag
00000000 T adc_disable_ts
00000000 T adc_enable_all_channel
00000000 T adc_enable_anch
00000000 T adc_enable_channel
00000000 T adc_enable_channel_differential_input
00000000 T adc_enable_channel_input_offset
00000000 T adc_enable_interrupt
00000000 T adc_enable_tag
00000000 T adc_enable_ts
00000000 T adc_get_actual_adc_clock
00000000 T adc_get_channel_status
00000000 T adc_get_channel_value
00000000 T adc_get_comparison_mode
00000000 T adc_get_interrupt_mask
00000000 T adc_get_latest_value
00000000 T adc_get_overrun_status
00000000 T adc_get_pdc_base
00000000 T adc_get_status
00000000 T adc_get_tag
00000000 T adc_get_writeprotect_status
00000000 T adc_init
00000000 T adc_set_bias_current
00000000 T adc_set_channel_input_gain
00000000 T adc_set_comparison_channel
00000000 T adc_set_comparison_mode
00000000 T adc_set_comparison_window
00000000 T adc_set_resolution
00000000 T adc_set_writeprotect
00000000 T adc_start
00000000 T adc_start_sequencer
00000000 T adc_stop
00000000 T adc_stop_sequencer
adc12_sam3u.o:
interrupt_sam_nvic.o:
00000000 D g_interrupt_enabled
pio.o:
00000000 T PIO_Clear
00000000 T PIO_Configure
00000000 T PIO_DisableInterrupt
00000000 T PIO_Get
00000000 T PIO_GetOutputDataStatus
00000000 T PIO_PullUp
00000000 T PIO_Set
00000000 T PIO_SetDebounceFilter
00000000 T PIO_SetInput
00000000 T PIO_SetOutput
00000000 T PIO_SetPeripheral
pmc.o:
00000000 T pmc_clr_fast_startup_input
00000000 T pmc_disable_all_pck
00000000 T pmc_disable_all_periph_clk
00000000 T pmc_disable_interrupt
00000000 T pmc_disable_pck
00000000 T pmc_disable_periph_clk
00000000 T pmc_disable_pllack
00000000 T pmc_disable_udpck
00000000 T pmc_disable_upll_clock
00000000 T pmc_enable_all_pck
00000000 T pmc_enable_all_periph_clk
00000000 T pmc_enable_backupmode
00000000 T pmc_enable_interrupt
00000000 T pmc_enable_pck
00000000 T pmc_enable_periph_clk
00000000 T pmc_enable_pllack
00000000 T pmc_enable_sleepmode
00000000 T pmc_enable_udpck
00000000 T pmc_enable_upll_clock
00000000 T pmc_enable_waitmode
00000000 T pmc_get_interrupt_mask
00000000 T pmc_get_status
00000000 T pmc_get_writeprotect_status
00000000 T pmc_is_locked_pllack
00000000 T pmc_is_locked_upll
00000000 T pmc_is_pck_enabled
00000000 T pmc_is_periph_clk_enabled
00000000 T pmc_mck_set_prescaler
00000000 T pmc_mck_set_source
00000000 T pmc_osc_disable_fastrc
00000000 T pmc_osc_disable_xtal
00000000 T pmc_osc_enable_fastrc
00000000 T pmc_osc_is_ready_32kxtal
00000000 T pmc_osc_is_ready_mainck
00000000 T pmc_pck_set_prescaler
00000000 T pmc_pck_set_source
00000000 T pmc_set_fast_startup_input
00000000 T pmc_set_writeprotect
00000000 T pmc_switch_mainck_to_fastrc
00000000 T pmc_switch_mainck_to_xtal
00000000 T pmc_switch_mck_to_mainck
00000000 T pmc_switch_mck_to_pllack
00000000 T pmc_switch_mck_to_sclk
00000000 T pmc_switch_mck_to_upllck
00000000 T pmc_switch_pck_to_mainck
00000000 T pmc_switch_pck_to_pllack
00000000 T pmc_switch_pck_to_sclk
00000000 T pmc_switch_pck_to_upllck
00000000 T pmc_switch_sclk_to_32kxtal
00000000 T pmc_switch_udpck_to_pllack
00000000 T pmc_switch_udpck_to_upllck
pwmc.o:
00000000 r C.19.7195
00000000 t FindClockConfiguration
00000000 T PWMC_ConfigureChannel
00000000 T PWMC_ConfigureChannelExt
00000000 T PWMC_ConfigureClocks
00000000 T PWMC_ConfigureComparisonUnit
00000000 T PWMC_ConfigureEventLineMode
00000000 T PWMC_ConfigureSyncChannel
00000000 T PWMC_DisableChannel
00000000 T PWMC_DisableChannelIt
00000000 T PWMC_DisableIt
00000000 T PWMC_DisableOverrideOutput
00000000 T PWMC_EnableChannel
00000000 T PWMC_EnableChannelIt
00000000 T PWMC_EnableFaultProtection
00000000 T PWMC_EnableIt
00000000 T PWMC_EnableOverrideOutput
00000000 T PWMC_FaultClear
00000000 T PWMC_SetDeadTime
00000000 T PWMC_SetDutyCycle
00000000 T PWMC_SetFaultMode
00000000 T PWMC_SetFaultProtectionValue
00000000 T PWMC_SetOverrideValue
00000000 T PWMC_SetPeriod
00000000 T PWMC_SetSyncChannelUpdatePeriod
00000000 T PWMC_SetSyncChannelUpdateUnlock
00000000 T PWMC_WriteBuffer
U __assert_func
00000000 r __func__.5848
00000000 r __func__.5859
00000000 r __func__.5874
00000000 r __func__.5885
00000000 r __func__.5896
00000000 r __func__.5903
00000000 r __func__.5987
00000000 r __func__.5993
rtc.o:
00000000 T RTC_ClearSCCR
00000000 T RTC_DisableIt
00000000 T RTC_EnableIt
00000000 T RTC_GetDate
00000000 T RTC_GetHourMode
00000000 T RTC_GetSR
00000000 T RTC_GetTime
00000000 T RTC_SetDate
00000000 T RTC_SetDateAlarm
00000000 T RTC_SetHourMode
00000000 T RTC_SetTime
00000000 T RTC_SetTimeAlarm
U __assert_func
00000000 r __func__.5845
00000000 r __func__.5854
00000000 r __func__.5859
rtt.o:
00000000 T RTT_EnableIT
00000000 T RTT_GetStatus
00000000 T RTT_GetTime
00000000 T RTT_SetAlarm
00000000 T RTT_SetPrescaler
U __assert_func
00000000 r __func__.5852
00000000 r __func__.5860
spi.o:
00000000 T SPI_Configure
00000000 T SPI_ConfigureNPCS
00000000 T SPI_Disable
00000000 T SPI_DisableIt
00000000 T SPI_Enable
00000000 T SPI_EnableIt
00000000 T SPI_GetStatus
00000000 T SPI_IsFinished
00000000 T SPI_Read
00000000 T SPI_Write
U pmc_enable_periph_clk
tc.o:
00000000 T TC_Configure
00000000 T TC_FindMckDivisor
00000000 T TC_Start
00000000 T TC_Stop
U __assert_func
00000000 r __func__.5847
00000000 r __func__.5853
00000000 r __func__.5859
timetick.o:
00000000 T GetTickCount
00000000 t NVIC_SetPriority
00000000 T Sleep
00000000 t SysTick_Config
00000000 T TimeTick_Configure
00000000 T TimeTick_Increment
00000000 T Wait
00000000 b _dwTickCount
twi.o:
00000000 T TWI_ByteReceived
00000000 T TWI_ByteSent
00000000 T TWI_ConfigureMaster
00000000 T TWI_ConfigureSlave
00000000 T TWI_DisableIt
00000000 T TWI_EnableIt
00000000 T TWI_GetMaskedStatus
00000000 T TWI_GetStatus
00000000 T TWI_ReadByte
00000000 T TWI_SendSTOPCondition
00000000 T TWI_StartRead
00000000 T TWI_StartWrite
00000000 T TWI_Stop
00000000 T TWI_TransferComplete
00000000 T TWI_WriteByte
U __assert_func
00000000 r __func__.6229
00000000 r __func__.6244
00000000 r __func__.6248
00000000 r __func__.6255
00000000 r __func__.6259
00000000 r __func__.6264
00000000 r __func__.6272
00000000 r __func__.6286
00000000 r __func__.6291
00000000 r __func__.6295
00000000 r __func__.6300
00000000 r __func__.6304
udp.o:
udphs.o:
uotghs.o:
00000000 t NVIC_EnableIRQ
00000000 t NVIC_SetPriority
00000000 T UDD_Attach
00000000 T UDD_ClearIN
00000000 T UDD_ClearOUT
00000000 T UDD_ClearSetupInt
00000000 T UDD_Detach
00000000 T UDD_FifoByteCount
00000000 T UDD_GetFrameNumber
00000000 T UDD_Init
00000000 T UDD_InitEP
00000000 T UDD_InitEndpoints
00000000 T UDD_ReadWriteAllowed
00000000 T UDD_ReceivedSetupInt
00000000 T UDD_Recv
00000000 T UDD_Recv8
00000000 T UDD_ReleaseRX
00000000 T UDD_ReleaseTX
00000000 T UDD_Send8
00000000 T UDD_SetAddress
00000000 T UDD_SetEP
00000000 T UDD_SetStack
00000000 T UDD_Stall
00000000 T UDD_WaitForINOrOUT
00000000 T UDD_WaitIN
00000000 T UDD_WaitOUT
00000000 T UOTGHS_Handler
00000000 t cpu_irq_is_enabled_flags
00000000 t cpu_irq_restore
00000000 t cpu_irq_save
U g_interrupt_enabled
00000000 b gpf_isr
U iprintf
U pmc_enable_periph_clk
U pmc_enable_udpck
U pmc_enable_upll_clock
U pmc_switch_udpck_to_upllck
U puts
00000000 B ul_ep
00000000 B ul_rcv_index
00000000 B ul_send_index
usart.o:
00000000 T USART_Configure
00000000 T USART_DisableIt
00000000 T USART_EnableIt
00000000 T USART_GetChar
00000000 T USART_GetStatus
00000000 T USART_IsDataAvailable
00000000 T USART_IsRxReady
00000000 T USART_PutChar
00000000 T USART_Read
00000000 T USART_ReadBuffer
00000000 T USART_SetIrdaFilter
00000000 T USART_SetReceiverEnabled
00000000 T USART_SetTransmitterEnabled
00000000 T USART_Write
00000000 T USART_WriteBuffer
U __assert_func
00000000 r __func__.6150
wdt.o:
00000000 T WDT_Disable
00000000 T WDT_Enable
00000000 T WDT_GetPeriod
00000000 T WDT_GetStatus
00000000 T WDT_Restart
system_sam3xa.o:
00000000 D SystemCoreClock
00000000 T SystemCoreClockUpdate
00000000 T SystemInit
00000000 T system_init_flash
startup_sam3xa.o:
00000000 W ADC_Handler
00000000 W BusFault_Handler
00000000 W CAN0_Handler
00000000 W CAN1_Handler
00000000 W DACC_Handler
00000000 W DMAC_Handler
00000000 W DebugMon_Handler
00000000 T Dummy_Handler
00000000 W EFC0_Handler
00000000 W EFC1_Handler
00000000 W EMAC_Handler
00000000 W HSMCI_Handler
00000000 W HardFault_Handler
00000000 W MemManage_Handler
00000000 W NMI_Handler
00000000 W PIOA_Handler
00000000 W PIOB_Handler
00000000 W PIOC_Handler
00000000 W PIOD_Handler
00000000 W PMC_Handler
00000000 W PWM_Handler
00000000 W PendSV_Handler
00000000 W RSTC_Handler
00000000 W RTC_Handler
00000000 W RTT_Handler
00000000 T Reset_Handler
00000000 W SMC_Handler
00000000 W SPI0_Handler
00000000 W SSC_Handler
00000000 W SUPC_Handler
00000000 W SVC_Handler
00000000 W SysTick_Handler
00000000 W TC0_Handler
00000000 W TC1_Handler
00000000 W TC2_Handler
00000000 W TC3_Handler
00000000 W TC4_Handler
00000000 W TC5_Handler
00000000 W TC6_Handler
00000000 W TC7_Handler
00000000 W TC8_Handler
00000000 W TRNG_Handler
00000000 W TWI0_Handler
00000000 W TWI1_Handler
00000000 W UART_Handler
00000000 W UOTGHS_Handler
00000000 W USART0_Handler
00000000 W USART1_Handler
00000000 W USART2_Handler
00000000 W USART3_Handler
00000000 W UsageFault_Handler
00000000 W WDT_Handler
U __libc_init_array
U _erelocate
U _estack
U _etext
U _ezero
U _sfixed
U _srelocate
U _szero
00000000 R exception_table
U main

View File

@ -22,11 +22,13 @@
/*
* Cortex-M3 Systick IT handler
*/
/*
extern void SysTick_Handler( void )
{
// Increment tick count each ms
TimeTick_Increment() ;
}
*/
/*
* \brief Main entry point of Arduino application

View File

@ -1,18 +0,0 @@
#include <new.h>
void * operator new(size_t size)
{
return malloc(size);
}
void operator delete(void * ptr)
{
free(ptr);
}
int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);};
void __cxa_guard_release (__guard *g) {*(char *)g = 1;};
void __cxa_guard_abort (__guard *) {};
void __cxa_pure_virtual(void) {};

View File

@ -1,22 +0,0 @@
/* Header to define new/delete operators as they aren't provided by avr-gcc by default
Taken from http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453
*/
#ifndef NEW_H
#define NEW_H
#include <stdlib.h>
void * operator new(size_t size);
void operator delete(void * ptr);
__extension__ typedef int __guard __attribute__((mode (__DI__)));
extern "C" int __cxa_guard_acquire(__guard *);
extern "C" void __cxa_guard_release (__guard *);
extern "C" void __cxa_guard_abort (__guard *);
extern "C" void __cxa_pure_virtual(void);
#endif

View File

@ -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,7 +16,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables --no-print-directory
#-------------------------------------------------------------------------------
# Rules
@ -24,18 +24,93 @@ SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
all: test
.PHONY: test
test:
test: test_arduino_due_x test_sam3x_ek test_adk2
@echo ------------------------------------------------------------------------------------
@echo --- Making test
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f test.mk
@$(MAKE) DEBUG=1 VARIANT=arduino_due_x $(SUBMAKE_OPTIONS) -f test.mk
# @$(MAKE) DEBUG=1 VARIANT=sam3s_ek $(SUBMAKE_OPTIONS) -f test.mk
# @$(MAKE) DEBUG=1 VARIANT=sam3u_ek $(SUBMAKE_OPTIONS) -f test.mk
@$(MAKE) DEBUG=1 VARIANT=sam3x_ek $(SUBMAKE_OPTIONS) -f test.mk
@$(MAKE) DEBUG=1 VARIANT=adk2 $(SUBMAKE_OPTIONS) -f test.mk
@echo ------------------------------------------------------------------------------------
.PHONY: test_arduino_due_x
test_arduino_due_x:
@echo ------------------------------------------------------------------------------------
@echo --- Making test_arduino_due_x
@$(MAKE) DEBUG=1 VARIANT=arduino_due_x $(SUBMAKE_OPTIONS) -f test.mk
@echo ------------------------------------------------------------------------------------
.PHONY: test_adk2
test_adk2:
@echo ------------------------------------------------------------------------------------
@echo --- Making test_adk2
@$(MAKE) DEBUG=1 VARIANT=adk2 $(SUBMAKE_OPTIONS) -f test.mk
@echo ------------------------------------------------------------------------------------
.PHONY: test_sam3s_ek
test_sam3s_ek:
@echo ------------------------------------------------------------------------------------
@echo --- Making test_sam3s_ek
@$(MAKE) DEBUG=1 VARIANT=sam3s_ek $(SUBMAKE_OPTIONS) -f test.mk
@echo ------------------------------------------------------------------------------------
.PHONY: test_sam3u_ek
test_sam3u_ek:
@echo ------------------------------------------------------------------------------------
@echo --- Making test_sam3u_ek
@$(MAKE) DEBUG=1 VARIANT=sam3u_ek $(SUBMAKE_OPTIONS) -f test.mk
@echo ------------------------------------------------------------------------------------
.PHONY: test_sam3x_ek
test_sam3x_ek:
@echo ------------------------------------------------------------------------------------
@echo --- Making test_sam3x_ek
@$(MAKE) DEBUG=1 VARIANT=sam3x_ek $(SUBMAKE_OPTIONS) -f test.mk
@echo ------------------------------------------------------------------------------------
.PHONY: clean
clean:
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning test
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f test.mk $@
@$(MAKE) DEBUG=1 VARIANT=arduino_due_x $(SUBMAKE_OPTIONS) -f test.mk $@
@$(MAKE) DEBUG=1 VARIANT=adk2 $(SUBMAKE_OPTIONS) -f test.mk $@
@$(MAKE) DEBUG=1 VARIANT=sam3s_ek $(SUBMAKE_OPTIONS) -f test.mk $@
@$(MAKE) DEBUG=1 VARIANT=sam3u_ek $(SUBMAKE_OPTIONS) -f test.mk $@
@$(MAKE) DEBUG=1 VARIANT=sam3x_ek $(SUBMAKE_OPTIONS) -f test.mk $@
@echo ------------------------------------------------------------------------------------
.PHONY: debug
debug:
@echo --- Debugging test
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f test.mk $@
.PHONY: debug_arduino_due_x
debug_arduino_due_x:
@echo ------------------------------------------------------------------------------------
@echo --- Debugging test arduino_due_x
@$(MAKE) DEBUG=1 VARIANT=arduino_due_x $(SUBMAKE_OPTIONS) -f test.mk $@
@echo ------------------------------------------------------------------------------------
.PHONY: debug_adk2
debug_adk2:
@echo ------------------------------------------------------------------------------------
@echo --- Debugging test adk2
@$(MAKE) DEBUG=1 VARIANT=adk2 $(SUBMAKE_OPTIONS) -f test.mk $@
@echo ------------------------------------------------------------------------------------
.PHONY: debug_sam3s_ek
debug_sam3s_ek:
@echo ------------------------------------------------------------------------------------
@echo --- Debugging test sam3s_ek
@$(MAKE) DEBUG=1 VARIANT=sam3s_ek $(SUBMAKE_OPTIONS) -f test.mk $@
@echo ------------------------------------------------------------------------------------
.PHONY: debug_sam3u_ek
debug_sam3u_ek:
@echo ------------------------------------------------------------------------------------
@echo --- Debugging test sam3u_ek
@$(MAKE) DEBUG=1 VARIANT=sam3u_ek $(SUBMAKE_OPTIONS) -f test.mk $@
@echo ------------------------------------------------------------------------------------
.PHONY: debug_sam3x_ek
debug_sam3x_ek:
@echo ------------------------------------------------------------------------------------
@echo --- Debugging test sam3x_ek
@$(MAKE) DEBUG=1 VARIANT=sam3x_ek $(SUBMAKE_OPTIONS) -f test.mk $@
@echo ------------------------------------------------------------------------------------

View File

@ -16,14 +16,15 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Makefile for compiling libArduino
.SUFFIXES: .o .a .c .s
# Makefile for compiling validation application
.SUFFIXES: .o .a .c .cpp .s
# putting default variant
ifeq ("$(VARIANT)", "")
#VARIANT=sam3s_ek
#VARIANT=sam3u_ek
VARIANT=sam3x_ek
#VARIANT=sam3x_ek
VARIANT=adk2
#VARIANT=arduino_due_x
endif
@ -42,6 +43,9 @@ VARIANT_PATH = ../../../../variants/$(VARIANT)
else ifeq ("$(VARIANT)", "arduino_due_x")
CHIP=__SAM3X8E__
VARIANT_PATH = ../../../../variants/$(VARIANT)
else ifeq ("$(VARIANT)", "adk2")
CHIP=__SAM3X8E__
VARIANT_PATH = ../../../../../../google/sam/variants/$(VARIANT)
endif
TOOLCHAIN=gcc
@ -51,7 +55,7 @@ TOOLCHAIN=gcc
#-------------------------------------------------------------------------------
# Libraries
PROJECT_BASE_PATH = ./..
PROJECT_BASE_PATH = ..
SYSTEM_PATH = ../../../../system
ifeq ($(CHIP), __SAM3S4C__)
@ -77,8 +81,8 @@ CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
ARDUINO_CORE_PATH=$(PROJECT_BASE_PATH)/..
ARDUINO_USB_PATH=$(PROJECT_BASE_PATH)/../USB
ARDUINO_CORE_PATH=../../../../cores/sam
ARDUINO_USB_PATH=$(ARDUINO_CORE_PATH)/USB
# Output directories
OUTPUT_PATH = debug_$(VARIANT)
@ -87,15 +91,14 @@ OUTPUT_PATH = debug_$(VARIANT)
# Files
#-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH)/.. $(VARIANT_PATH) $(SYSTEM_PATH) $(CMSIS_ARM_PATH)
#vpath %.h $(PROJECT_BASE_PATH)/.. $(PROJECT_BASE_PATH)/../USB $(VARIANT_PATH) $(SYSTEM_PATH) $(CMSIS_ARM_PATH)
vpath %.cpp $(PROJECT_BASE_PATH)
VPATH+=$(PROJECT_BASE_PATH)
#VPATH+=$(PROJECT_BASE_PATH)
INCLUDES = -I$(PROJECT_BASE_PATH)/..
INCLUDES = -I$(ARDUINO_CORE_PATH)
INCLUDES += -I$(ARDUINO_CORE_PATH)/USB
INCLUDES += -I$(VARIANT_PATH)
#INCLUDES += -I$(VARIANT_PATH)/..
#INCLUDES += -I$(SYSTEM_PATH)
INCLUDES += -I$(SYSTEM_PATH)/libsam
INCLUDES += -I$(CMSIS_ARM_PATH)
INCLUDES += -I$(CMSIS_ATMEL_PATH)
@ -154,6 +157,7 @@ test: create_output libsam_$(CHIP_NAME)_$(TOOLCHAIN)_$(LIBS_POSTFIX).a libarduin
.PHONY: create_output
create_output:
@echo ------------------------------------------------------------------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
# @echo -------------------------
# @echo *$(INCLUDES)
@ -174,11 +178,12 @@ create_output:
# @echo -------------------------
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
# @"$(CC)" -c $(CPPFLAGS) $< -o $@
# @"$(CXX)" -c $(CPPFLAGS) $< -o $@
@"$(CXX)" -v -c $(CPPFLAGS) $< -o $@
@echo *** Current folder is $(shell cd)
@"$(CXX)" -c $(CPPFLAGS) $< -o $@
# "$(CXX)" -v -c $(CPPFLAGS) $< -o $@
$(OUTPUT_BIN): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@"$(CC)" $(LIB_PATH) $(LDFLAGS) -T"$(VARIANT_PATH)/linker_scripts/gcc/flash.ld" -Wl,-Map,$(OUTPUT_PATH)/$@.map -o $(OUTPUT_PATH)/$@.elf $^ $(LIBS)
@ -189,8 +194,22 @@ $(OUTPUT_BIN): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)
.PHONY: clean
clean:
@echo --- Cleaning test files
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning test files for $(VARIANT)
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
@echo ------------------------------------------------------------------------------------
@echo Sub-making clean for libsam
@$(MAKE) -C $(SYSTEM_PATH)/libsam/build_gcc -f Makefile clean
@echo ------------------------------------------------------------------------------------
@echo ------------------------------------------------------------------------------------
@echo Sub-making clean for Arduino core
$(MAKE) -C $(ARDUINO_CORE_PATH)/build_gcc -f Makefile clean
@echo ------------------------------------------------------------------------------------
@echo ------------------------------------------------------------------------------------
@echo Sub-making clean for variant $(VARIANT)
$(MAKE) -C $(VARIANT_PATH)/build_gcc -f Makefile clean
@echo ------------------------------------------------------------------------------------
# -$(RM) $(OUTPUT_PATH)/test.o
# -$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).elf
@ -203,14 +222,20 @@ debug: test
# @"$(GDB)" -w -x "$(VARIANT_PATH)/debug_scripts/gcc/$(VARIANT)_sram.gdb" -ex "reset" -readnow -se $(OUTPUT_PATH)/$(OUTPUT_BIN).elf
libsam_$(CHIP_NAME)_$(TOOLCHAIN)_$(LIBS_POSTFIX).a:
@echo Building $@
@echo ------------------------------------------------------------------------------------
@echo Sub-making $@
@$(MAKE) -C $(SYSTEM_PATH)/libsam/build_gcc -f Makefile $@
@echo ------------------------------------------------------------------------------------
libarduino_$(VARIANT)_$(TOOLCHAIN)_$(LIBS_POSTFIX).a:
@echo Building $@
@echo ------------------------------------------------------------------------------------
@echo Sub-making $@
$(MAKE) -C $(ARDUINO_CORE_PATH)/build_gcc -f Makefile $(VARIANT)
@echo ------------------------------------------------------------------------------------
libvariant_$(VARIANT)_$(TOOLCHAIN)_$(LIBS_POSTFIX).a:
@echo Building $@
@echo ------------------------------------------------------------------------------------
@echo Sub-making $@
$(MAKE) -C $(VARIANT_PATH)/build_gcc -f Makefile $(VARIANT)
@echo ------------------------------------------------------------------------------------

View File

@ -16,12 +16,14 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "variant.h"
#include "Arduino.h"
#ifdef _VARIANT_SAM3X_EK_
#define MAX_ANALOG A0
#elif _VARIANT_ARDUINO_DUE_X_
#elif defined _VARIANT_ARDUINO_DUE_X_
#define MAX_ANALOG A10
#elif defined _VARIANT_ADK2_
#define MAX_ANALOG A9
#endif
void setup( void )

View File

@ -57,11 +57,11 @@ void delayMicroseconds( uint32_t dwUs )
/*
* Cortex-M3 Systick IT handler: MOVED TO MAIN DUE TO WEAK SYMBOL ISSUE NOT RESOLVED
*/
/*extern void SysTick_Handler( void )
void SysTick_Handler( void )
{
// Increment tick count each ms
TimeTick_Increment() ;
}*/
}
#if defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */
extern signed int putchar( signed int c ) ;

View File

@ -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
@ -56,8 +56,14 @@ extern "C"{
#undef abs
#endif // abs
#ifndef min
#define min(a,b) ((a)<(b)?(a):(b))
#endif // min
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b))
#endif // max
#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))

View File

@ -3,6 +3,8 @@ export Path
start "libsam" /d"system\libsam\build_gcc" /max "cd"
start "libarduino" /d"cores\sam\build_gcc" /max "cd"
start "libvariant Arduino Due U" /d"variants\arduino_due_u\build_gcc" /max "cd"
rem start "libvariant Arduino Due U" /d"variants\arduino_due_u\build_gcc" /max "cd"
start "libvariant Arduino Due X" /d"variants\arduino_due_x\build_gcc" /max "cd"
start "test" /d"cores\sam\validation\build_gcc" /max "cd"
start "libvariant ADK2" /d"..\..\google\sam\variants\adk2\build_gcc" /max "cd"
start "libvariant SAM3X-EK" /d"..\..\atmel\sam\variants\sam3x_ek\build_gcc" /max "cd"
start "test" /d"cores\sam\validation\build_gcc" /max "cd"

View File

@ -18,7 +18,7 @@
# Makefile for compiling libchip
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables --no-print-directory
#-------------------------------------------------------------------------------
# Rules
@ -28,85 +28,86 @@ SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
all: libsam_sam3s4c_gcc_dbg.a libsam_sam3u4e_gcc_dbg.a libsam_sam3x8e_gcc_dbg.a libsam_sam3x8h_gcc_dbg.a
arduino_due_u:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3U4E__ $(SUBMAKE_OPTIONS) OUTPUT_BIN=../../../variants/arduino_due_u -f sam3.mk
@echo ------------------------------------------------------------------------------------
arduino_due_x:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3X8E__ $(SUBMAKE_OPTIONS) OUTPUT_BIN=../../../variants/arduino_due_x -f sam3.mk
@echo ------------------------------------------------------------------------------------
.PHONY: libsam_sam3s4c_gcc_dbg.a
libsam_sam3s4c_gcc_dbg.a:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3S4C__ DEBUG=1 $(SUBMAKE_OPTIONS) -f sam3.mk
@echo ------------------------------------------------------------------------------------
.PHONY: libsam_sam3s4c_gcc_rel.a
libsam_sam3s4c_gcc_rel.a:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3S4C__ $(SUBMAKE_OPTIONS) -f sam3.mk
@echo ------------------------------------------------------------------------------------
.PHONY: libsam_sam3u4e_gcc_dbg.a
libsam_sam3u4e_gcc_dbg.a:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3U4E__ DEBUG=1 $(SUBMAKE_OPTIONS) -f sam3.mk
@echo ------------------------------------------------------------------------------------
.PHONY: libsam_sam3u4e_gcc_rel.a
libsam_sam3u4e_gcc_rel.a:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3U4E__ $(SUBMAKE_OPTIONS) -f sam3.mk
@echo ------------------------------------------------------------------------------------
.PHONY: libsam_sam3x8e_gcc_dbg.a
libsam_sam3x8e_gcc_dbg.a:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3X8E__ DEBUG=1 $(SUBMAKE_OPTIONS) -f sam3.mk
@echo ------------------------------------------------------------------------------------
.PHONY: libsam_sam3x8e_gcc_rel.a
libsam_sam3x8e_gcc_rel.a:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3X8E__ $(SUBMAKE_OPTIONS) -f sam3.mk
@echo ------------------------------------------------------------------------------------
.PHONY: libsam_sam3x8h_gcc_dbg.a
libsam_sam3x8h_gcc_dbg.a:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3X8H__ DEBUG=1 $(SUBMAKE_OPTIONS) -f sam3.mk
@echo ------------------------------------------------------------------------------------
.PHONY: libsam_sam3x8h_gcc_rel.a
libsam_sam3x8h_gcc_rel.a:
@echo ---
@echo ---
@echo ------------------------------------------------------------------------------------
@echo --- Making $@
@echo ---
@$(MAKE) CHIP=__SAM3X8H__ $(SUBMAKE_OPTIONS) -f sam3.mk
@echo ------------------------------------------------------------------------------------
.PHONY: clean
clean:
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning sam3s4c release and debug
@$(MAKE) CHIP=__SAM3S4C__ $(SUBMAKE_OPTIONS) -f sam3.mk $@
@$(MAKE) CHIP=__SAM3S4C__ DEBUG=1 $(SUBMAKE_OPTIONS) -f sam3.mk $@
@ -122,5 +123,6 @@ clean:
@echo --- Cleaning sam3x8h release and debug
@$(MAKE) CHIP=__SAM3X8H__ $(SUBMAKE_OPTIONS) -f sam3.mk $@
@$(MAKE) CHIP=__SAM3X8H__ DEBUG=1 $(SUBMAKE_OPTIONS) -f sam3.mk $@
@echo ------------------------------------------------------------------------------------

View File

@ -147,6 +147,7 @@ $(CHIP): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo ------------------------------------------------------------------------------------
@echo --- Preparing $(CHIP) files $(OUTPUT_PATH) to $(OUTPUT_BIN)
# @echo -------------------------
# @echo *$(C_SRC)
@ -160,6 +161,7 @@ create_output:
-@mkdir $(subst /,$(SEP),$(OUTPUT_BIN)) 1>$(DEV_NUL) 2>&1
-@mkdir $(OUTPUT_PATH) 1>$(DEV_NUL) 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# "$(CC)" -v -c $(CFLAGS) -Wa,aln=$(subst .o,.s,$@) $< -o $@
@ -175,10 +177,12 @@ $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)
.PHONY: clean
clean:
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning $(CHIP) files $(OUTPUT_PATH) $(subst /,$(SEP),$(OUTPUT_BIN)/$(OUTPUT_LIB))
-@$(RM) $(OUTPUT_PATH) 1>$(DEV_NUL) 2>&1
-@$(RM) $(subst /,$(SEP),$(OUTPUT_BIN)/$(OUTPUT_LIB)) 1>$(DEV_NUL) 2>&1
-@$(RM) $(subst /,$(SEP),$(OUTPUT_BIN)/$(OUTPUT_LIB)).txt 1>$(DEV_NUL) 2>&1
@echo ------------------------------------------------------------------------------------
# dependencies
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: $(PROJECT_BASE_PATH)/chip.h $(wildcard $(PROJECT_BASE_PATH)/include/*.h) $(wildcard $(CMSIS_BASE_PATH)/*.h)

View File

@ -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
@ -29,14 +26,17 @@ all: arduino_due_u
.PHONY: arduino_due_u
arduino_due_u:
@echo ------------------------------------------------------------------------------------
@echo --- Making arduino_due_u
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libvariant_arduino_due_u.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libvariant_arduino_due.mk
@echo ------------------------------------------------------------------------------------
.PHONY: clean
clean:
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning arduino_due_u
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libvariant_arduino_due_u.mk $@
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libvariant_arduino_due.mk $@
@echo ------------------------------------------------------------------------------------

View File

@ -47,14 +47,15 @@ VARIANT_PATH = ../../../variants/$(VARIANT)
# Files
#-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH)
#vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_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)
@ -132,8 +133,9 @@ $(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo ------------------------------------------------------------------------------------
@echo -------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo --- Preparing variant $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo -------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
@ -153,6 +155,7 @@ create_output:
# @echo -------------------------
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @"$(CC)" -v -c $(CFLAGS) $< -o $@
@ -172,6 +175,9 @@ $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)
.PHONY: clean
clean:
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@"$(RM)" $(OUTPUT_PATH) 1>NUL 2>&1
-@"$(RM)" $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------

View File

@ -110,6 +110,10 @@
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Pins descriptions
*/
@ -261,6 +265,10 @@ extern const PinDescription g_APinDescription[]=
{ NULL, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT, 0, NO_ADC, NO_ADC, NO_PWM, NO_TC }
} ;
#ifdef __cplusplus
}
#endif
/*
* UART objects
*/
@ -308,9 +316,6 @@ void USART2_Handler( void )
extern "C" {
#endif
// Should be made in a better way...
extern void analogOutputInit(void);
/**
*
*/
@ -371,6 +376,7 @@ extern void init( void )
// Initialize analogOutput module
analogOutputInit();
}
#ifdef __cplusplus
}
#endif

View File

@ -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,19 +16,26 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _VARIANT_ARDUINO_DUE_
#define _VARIANT_ARDUINO_DUE_
#ifndef _VARIANT_ARDUINO_DUE_U_
#define _VARIANT_ARDUINO_DUE_U_
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
// We have native USB on this variant
//#define USBCON
#include "Arduino.h"
#ifdef __cplusplus
#include "UARTClass.h"
#include "USARTClass.h"
#endif
#ifdef __cplusplus
extern "C"{
#endif // __cplusplus
/**
* Libc porting layers
*/
@ -42,8 +49,8 @@
/*----------------------------------------------------------------------------*/
#ifndef arduino_due
#define arduino_due
#ifndef arduino_due_u
#define arduino_due_u
#endif
/** Name of the board */
@ -156,6 +163,10 @@ static const uint8_t A13 = 67;
#define TC_MAX_DUTY_CYCLE 255
#define TC_MIN_DUTY_CYCLE 0
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
@ -170,5 +181,5 @@ extern USARTClass Serial4 ;
#endif
#endif /* _VARIANT_ARDUINO_DUE_ */
#endif /* _VARIANT_ARDUINO_DUE_U_ */

View File

@ -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
@ -29,14 +26,17 @@ all: arduino_due_x
.PHONY: arduino_due_x
arduino_due_x:
@echo --- Making arduino_due_x
@echo ------------------------------------------------------------------------------------
@echo --- Making variant arduino_due_x
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libvariant_arduino_due_x.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libvariant_arduino_due.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libvariant_arduino_due_x.mk
@echo ------------------------------------------------------------------------------------
.PHONY: clean
clean:
@echo --- Cleaning arduino_due_x
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning variant arduino_due_x
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libvariant_arduino_due_x.mk $@
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libvariant_arduino_due.mk $@
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libvariant_arduino_due_x.mk $@
@echo ------------------------------------------------------------------------------------

View File

@ -47,8 +47,8 @@ VARIANT_PATH = ../../../variants/$(VARIANT)
# Files
#-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH)
#vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH)
VPATH+=$(PROJECT_BASE_PATH)
@ -133,8 +133,9 @@ $(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo ------------------------------------------------------------------------------------
@echo -------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo --- Preparing variant $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo -------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
@ -154,6 +155,7 @@ create_output:
# @echo -------------------------
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @"$(CC)" -v -c $(CFLAGS) $< -o $@
@ -173,6 +175,9 @@ $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)
.PHONY: clean
clean:
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------

View File

@ -142,3 +142,4 @@ SECTIONS
. = ALIGN(4);
_end = . ;
}

View File

@ -117,6 +117,10 @@
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Pins descriptions
*/
@ -276,6 +280,10 @@ extern const PinDescription g_APinDescription[]=
{ NULL, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT, 0, NO_ADC, NO_ADC, NO_PWM, NO_TC }
} ;
#ifdef __cplusplus
}
#endif
/*
* UART objects
*/
@ -383,8 +391,8 @@ extern void init( void )
// Initialize analogOutput module
analogOutputInit();
}
#ifdef __cplusplus
}
#endif

View File

@ -32,6 +32,10 @@
#include "USARTClass.h"
#endif
#ifdef __cplusplus
extern "C"{
#endif // __cplusplus
/**
* Libc porting layers
*/
@ -52,11 +56,6 @@
/** Name of the board */
#define VARIANT_NAME "ARDUINO_DUE"
/*
#define VARIANT_REV_A
#define VARIANT_REV_B
*/
/** Frequency of the board main oscillator */
#define VARIANT_MAINOSC 12000000
@ -171,6 +170,10 @@ static const uint8_t A15 = 69;
#define TC_MAX_DUTY_CYCLE 255
#define TC_MIN_DUTY_CYCLE 0
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 $@

View File

@ -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

View File

@ -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 = . ;
}

View File

@ -156,7 +156,6 @@ extern void init( void )
// Initialize analogOutput module
analogOutputInit();
}
#ifdef __cplusplus
}

View File

@ -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
*----------------------------------------------------------------------------*/

View File

@ -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

View File

@ -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
@ -29,14 +26,17 @@ all: adk2
.PHONY: adk2
adk2:
@echo --- Making adk2
@echo ------------------------------------------------------------------------------------
@echo --- Making variant adk2
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libvariant_adk2.mk
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libvariant_adk2.mk
@echo ------------------------------------------------------------------------------------
.PHONY: clean
clean:
@echo --- Cleaning adk2
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning variant adk2
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libvariant_adk2.mk $@
# @$(MAKE) $(SUBMAKE_OPTIONS) -f libvariant_adk2.mk $@
@echo ------------------------------------------------------------------------------------

View File

@ -1 +0,0 @@
mkdir: cannot create directory `debug_adk2': File exists

View File

@ -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,7 +17,6 @@
#
# Tool suffix when cross-compiling
#CROSS_COMPILE = ../../../../tools/CodeSourcery_arm/bin/arm-none-eabi-
CROSS_COMPILE = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi-
# Compilation tools
@ -25,11 +24,13 @@ AR = $(CROSS_COMPILE)ar
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
AS = $(CROSS_COMPILE)as
#LD = $(CROSS_COMPILE)ld
#SIZE = $(CROSS_COMPILE)size
NM = $(CROSS_COMPILE)nm
#OBJCOPY = $(CROSS_COMPILE)objcopy
ifeq ($(OS),Windows_NT)
RM=cs-rm -Rf
else
RM=rm -Rf
endif
SEP=\\
# ---------------------------------------------------------------------------------------
@ -49,7 +50,7 @@ CFLAGS += -Wcast-align
#CFLAGS += -Wmissing-noreturn
#CFLAGS += -Wconversion
CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fdata-sections -nostdlib
CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fdata-sections -nostdlib -std=c99
CFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D$(VARIANT)
# To reduce application size use only integer printf function.
@ -69,7 +70,7 @@ CPPFLAGS += -Wpacked -Wredundant-decls -Winline -Wlong-long
#CPPFLAGS += -Wmissing-noreturn
#CPPFLAGS += -Wconversion
CPPFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fno-rtti -fdata-sections -fno-exceptions
CPPFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -std=c++98
CPPFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(CHIP)
# To reduce application size use only integer printf function.

View File

@ -29,17 +29,17 @@ TOOLCHAIN=gcc
#-------------------------------------------------------------------------------
# Output directories
OUTPUT_BIN = ../../../cores/sam
OUTPUT_BIN = ../../../../../arduino/sam/cores/sam
# Libraries
PROJECT_BASE_PATH = ..
SYSTEM_PATH = ../../../system
SYSTEM_PATH = ../../../../../arduino/sam/system
CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
#CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
ARDUINO_PATH = ../../../cores/sam
ARDUINO_PATH = ../../../../../arduino/sam/cores/sam
VARIANT_BASE_PATH = ../../../variants
VARIANT_PATH = ../../../variants/$(VARIANT)
@ -47,14 +47,15 @@ VARIANT_PATH = ../../../variants/$(VARIANT)
# Files
#-------------------------------------------------------------------------------
vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH)
#vpath %.h $(PROJECT_BASE_PATH) $(SYSTEM_PATH) $(VARIANT_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)
@ -132,8 +133,9 @@ $(VARIANT): create_output $(OUTPUT_LIB)
.PHONY: create_output
create_output:
@echo ------------------------------------------------------------------------------------
@echo -------------------------
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo --- Preparing variant $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo -------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
@ -153,6 +155,7 @@ create_output:
# @echo -------------------------
-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
# @"$(CC)" -v -c $(CFLAGS) $< -o $@
@ -172,6 +175,9 @@ $(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)
.PHONY: clean
clean:
@echo ------------------------------------------------------------------------------------
@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
@echo ------------------------------------------------------------------------------------

View File

@ -1,44 +0,0 @@
// ---------------------------------------------------------
// ATMEL Microcontroller Software Support - ROUSSET -
// ---------------------------------------------------------
// The software is delivered "AS IS" without warranty or
// condition of any kind, either express, implied or
// statutory. This includes without limitation any warranty
// or condition with respect to merchantability or fitness
// for any particular purpose, or against the infringements of
// intellectual property rights of others.
// ---------------------------------------------------------
// File: at91sam3u-ek-flash.mac
// User setup file for CSPY debugger.
// ---------------------------------------------------------
__var __mac_i;
__var __mac_pt;
/*********************************************************************
*
* execUserReset()
*/
execUserReset()
{
__message "------------------------------ execUserReset ---------------------------------";
__message "-------------------------------Set PC Reset ----------------------------------";
__hwReset(0);
// perpheral reset RSTC_CR
__writeMemory32(0xA5000004,0x400e1200,"Memory");
}
/*********************************************************************
*
* execUserPreload()
*/
execUserPreload()
{
__message "------------------------------ execUserPreload ---------------------------------";
__hwReset(0); //* Hardware Reset: CPU is automatically halted after the reset
// perpheral reset RSTC_CR
__writeMemory32(0xA5000004,0x400e1200,"Memory");
}

View File

@ -1,44 +0,0 @@
// ---------------------------------------------------------
// ATMEL Microcontroller Software Support - ROUSSET -
// ---------------------------------------------------------
// The software is delivered "AS IS" without warranty or
// condition of any kind, either express, implied or
// statutory. This includes without limitation any warranty
// or condition with respect to merchantability or fitness
// for any particular purpose, or against the infringements of
// intellectual property rights of others.
// ---------------------------------------------------------
// File: at91sam3u-ek-sram.mac
// User setup file for CSPY debugger.
// ---------------------------------------------------------
__var __mac_i;
__var __mac_pt;
/*********************************************************************
*
* execUserReset()
*/
execUserReset()
{
__message "------------------------------ execUserReset ---------------------------------";
__message "-------------------------------Set PC Reset ----------------------------------";
//__hwReset(50);
// perpheral reset RSTC_CR
__writeMemory32(0xA5000004,0x400e1200,"Memory");
}
/*********************************************************************
*
* execUserPreload()
*/
execUserPreload()
{
__message "------------------------------ execUserPreload ---------------------------------";
__hwReset(0); //* Hardware Reset: CPU is automatically halted after the reset
// perpheral reset RSTC_CR
__writeMemory32(0xA5000004,0x400e1200,"Memory");
}

View File

@ -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 FLASH 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 = 0x2000;
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : 0x2000 ;
/* Section Definitions */
SECTIONS
{
.text :
{
/* Section Definitions */
SECTIONS
{
.text :
{
. = ALIGN(4);
_sfixed = .;
KEEP(*(.vectors .vectors.*))
@ -99,17 +93,17 @@ SECTIONS
. = ALIGN(4);
_efixed = .; /* End of text section */
} > flash0
} > rom
/* .ARM.exidx is sorted, so has to go in its own output section. */
PROVIDE_HIDDEN (__exidx_start = .);
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > flash0
} > rom
PROVIDE_HIDDEN (__exidx_end = .);
. = ALIGN(4);
. = ALIGN(4);
_etext = .;
.relocate : AT (_etext)
@ -120,11 +114,11 @@ SECTIONS
*(.data .data.*);
. = ALIGN(4);
_erelocate = .;
} > sram0
} > ram
/* .bss section which is used for uninitialized data */
/* .bss section which is used for uninitialized data */
.bss (NOLOAD) :
{
{
. = ALIGN(4);
_sbss = . ;
_szero = .;
@ -133,18 +127,18 @@ SECTIONS
. = ALIGN(4);
_ebss = . ;
_ezero = .;
} > sram0
} > ram
/* stack section */
.stack (NOLOAD):
{
. = ALIGN(8);
_sstack = .;
_sstack = .;
. = . + STACK_SIZE;
. = ALIGN(8);
_estack = .;
} > sram1
} > ram
. = ALIGN(4);
_end = . ;
. = ALIGN(4);
_end = . ;
}

View File

@ -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 = . ;
}

View File

@ -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
@ -102,6 +102,10 @@
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Pins descriptions
*/
@ -236,21 +240,28 @@ extern const PinDescription g_APinDescription[]=
// 74 - USART3 (Serial5) all pins
{ PIOD, PIO_PD5B_RXD3|PIO_PD4B_TXD3, ID_PIOD, PIO_PERIPH_B, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NO_PWM, NO_TC },
// 75 - USB
{ PIOB, PIO_PB11A_UOTGID|PIO_PB10A_UOTGVBOF, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL,NO_ADC, NO_ADC, NO_PWM, NO_TC }, // ID - VBOF
// END
{ NULL, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT, 0, NO_ADC, NO_ADC, NO_PWM, NO_TC }
} ;
#ifdef __cplusplus
}
#endif
/*
* UART objects
*/
RingBuffer rx_buffer1 ;
UARTClass Serial( UART, UART_IRQn, ID_UART, &rx_buffer1 ) ;
UARTClass Serial1( UART, UART_IRQn, ID_UART, &rx_buffer1 ) ;
// IT handlers
void UART_IrqHandler(void)
void UART_Handler(void)
{
Serial.IrqHandler() ;
Serial1.IrqHandler() ;
}
// ----------------------------------------------------------------------------
@ -268,22 +279,22 @@ USARTClass Serial4( USART2, USART2_IRQn, ID_USART2, &rx_buffer4 ) ;
USARTClass Serial5( USART3, USART3_IRQn, ID_USART3, &rx_buffer5 ) ;
// IT handlers
void USART0_IrqHandler( void )
void USART0_Handler( void )
{
Serial2.IrqHandler() ;
}
void USART1_IrqHandler( void )
void USART1_Handler( void )
{
Serial3.IrqHandler() ;
}
void USART2_IrqHandler( void )
void USART2_Handler( void )
{
Serial4.IrqHandler() ;
}
void USART3_IrqHandler( void )
void USART3_Handler( void )
{
Serial5.IrqHandler() ;
}
@ -294,9 +305,6 @@ void USART3_IrqHandler( void )
extern "C" {
#endif
// Should be made in a better way...
extern void analogOutputInit(void);
/**
*
*/
@ -343,27 +351,25 @@ extern void init( void )
g_APinDescription[PINS_USART3].ulPin,
g_APinDescription[PINS_USART3].ulPinConfiguration);
// Initialize USB
PIO_Configure(
g_APinDescription[PINS_USB].pPort,
g_APinDescription[PINS_USB].ulPinType,
g_APinDescription[PINS_USB].ulPin,
g_APinDescription[PINS_USB].ulPinConfiguration);
// Initialize 10bit Analog Controller
PMC_EnablePeripheral( ID_ADC ) ;
adc_init( ADC, SystemCoreClock, ADC_FREQ_MAX, ADC_STARTUP ) ;
adc_configure_timing( ADC, 15, ADC_SETTLING_TIME_0, 15 ) ; // FIXME: Last two parameters (settling time and transfer time) need to be corrected!
adc_configure_trigger( ADC, ADC_TRIG_SW, ADC_MR_FREERUN_OFF ) ;
adc_disable_interrupt( ADC, 0xFFFFFFFF ) ; /* Disable all adc interrupt. */
adc_disable_channel( ADC, ADC_ALL_CHANNEL ) ;
// Initialize 12bit Analog Controller
// PMC_EnablePeripheral( ID_ADC12B ) ;
// adc12_init( ADC12B, SystemCoreClock, ADC12_FREQ_MAX, ADC12_STARTUP_FAST, 1 ) ;
// adc12_configure_timing( ADC12B, 15 ) ;
// adc12_configure_trigger( ADC12B, ADC_TRIG_SW ) ;
// adc12_disable_interrupt( ADC12B, 0xFFFFFFFF ) ; /* Disable all adc interrupt. */
// adc12_disable_channel( ADC12B, ADC_ALL_CHANNEL ) ;
pmc_enable_periph_clk( ID_ADC ) ;
adc_init( ADC, SystemCoreClock, ADC_FREQ_MAX, ADC_STARTUP_FAST ) ;
adc_configure_timing(ADC, 0, ADC_SETTLING_TIME_3, 1);
adc_configure_trigger(ADC, ADC_TRIG_SW, 0); // Disable hardware trigger.
adc_disable_interrupt( ADC, 0xFFFFFFFF ) ; // Disable all ADC interrupts.
adc_disable_all_channel( ADC ) ;
// Initialize analogOutput module
analogOutputInit();
}
#ifdef __cplusplus
}
#endif

View File

@ -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
@ -23,12 +23,19 @@
* Headers
*----------------------------------------------------------------------------*/
// We have native USB on this variant
#define USBCON
#include "Arduino.h"
#ifdef __cplusplus
#include "UARTClass.h"
#include "USARTClass.h"
#endif
#ifdef __cplusplus
extern "C"{
#endif // __cplusplus
/**
* Libc porting layers
*/
@ -49,16 +56,11 @@
/** Name of the board */
#define VARIANT_NAME "ADK2"
/*
#define VARIANT_REV_A
#define VARIANT_REV_B
*/
/** Frequency of the board main oscillator */
#define VARIANT_MAINOSC 12000000
/** Master clock frequency */
#define VARIANT_MCK 96000000
#define VARIANT_MCK 84000000
/*----------------------------------------------------------------------------
* Pins
@ -119,6 +121,12 @@ static const uint8_t SCK = 52 ;
#define PINS_USART2 (73u)
#define PINS_USART3 (74u)
/*
* USB Interfaces
*/
#define PINS_USB (75u)
/*
* Analog pins
*/
@ -157,13 +165,17 @@ static const uint8_t A9 = 63;
#define TC_MAX_DUTY_CYCLE 255
#define TC_MIN_DUTY_CYCLE 0
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#ifdef __cplusplus
extern UARTClass Serial ;
extern UARTClass Serial1 ;
extern USARTClass Serial2 ;
extern USARTClass Serial3 ;