mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
Remove the configs/ directory
This commit is contained in:
@@ -10630,4 +10630,7 @@
|
||||
* Removed the Documentation/ directory. Replaced with a GIT submodule
|
||||
that will bring in the new standalone Documentation directory
|
||||
(2015-06-29).
|
||||
and misc/sims (2015-06-27).
|
||||
* Removed the configs/ directory. Replaced with a GIT submodule
|
||||
that will bring in the new standalone boards directory (2015-06-29).
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
/Make.dep
|
||||
/.depend
|
||||
/*.asm
|
||||
/*.obj
|
||||
/*.rel
|
||||
/*.lst
|
||||
/*.sym
|
||||
/*.adb
|
||||
/*.lib
|
||||
/*.src
|
||||
-1690
File diff suppressed because it is too large
Load Diff
@@ -1,87 +0,0 @@
|
||||
############################################################################
|
||||
# configs/Makefile
|
||||
#
|
||||
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
# Basic
|
||||
|
||||
CONFIG_ASRCS =
|
||||
CONFIG_CSRCS =
|
||||
|
||||
# boardctl support
|
||||
|
||||
ifeq ($(CONFIG_LIB_BOARDCTL),y)
|
||||
CONFIG_CSRCS += boardctl.c
|
||||
endif
|
||||
|
||||
ASRCS = $(CONFIG_ASRCS)
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
|
||||
CSRCS = $(CONFIG_CSRCS)
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
|
||||
BIN = libconfigs$(LIBEXT)
|
||||
|
||||
all: $(BIN)
|
||||
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS): %$(OBJEXT): %.c
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
$(call ARCHIVE, $@, $(OBJS))
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
ifneq ($(SRCS),)
|
||||
$(Q) $(MKDEP) --dep-path . "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
endif
|
||||
$(Q) touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
$(call DELFILE, $(BIN))
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
$(call DELFILE, Make.dep)
|
||||
$(call DELFILE, .depend)
|
||||
|
||||
-include Make.dep
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +0,0 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,98 +0,0 @@
|
||||
############################################################################
|
||||
# configs/amber/hello/Make.defs
|
||||
#
|
||||
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include ${TOPDIR}/.config
|
||||
include ${TOPDIR}/tools/Config.mk
|
||||
include ${TOPDIR}/arch/avr/src/avr/Toolchain.defs
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
||||
ARCHXXINCLUDES = $(ARCHINCLUDES) "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/hello/ld.script}"
|
||||
else
|
||||
# Linux/Cygwin-native toolchain
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
ARCHINCLUDES = -I. -isystem "$(TOPDIR)/include"
|
||||
ARCHXXINCLUDES = $(ARCHINCLUDES) -isystem "$(TOPDIR)/include/cxx"
|
||||
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/hello/ld.script
|
||||
endif
|
||||
|
||||
CC = $(CROSSDEV)gcc
|
||||
CXX = $(CROSSDEV)g++
|
||||
CPP = $(CROSSDEV)gcc -E
|
||||
LD = $(CROSSDEV)ld
|
||||
AR = $(CROSSDEV)ar rcs
|
||||
NM = $(CROSSDEV)nm
|
||||
OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
ARCHOPTIMIZATION = -g
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||
ARCHWARNINGSXX = -Wall -Wshadow
|
||||
ARCHDEFINES =
|
||||
|
||||
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
||||
|
||||
NXFLATLDFLAGS1 = -r -d -warn-common
|
||||
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
LDNXFLATFLAGS = -e main -s 2048
|
||||
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
EXEEXT =
|
||||
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,211 +0,0 @@
|
||||
/**************************************************************************************
|
||||
* configs/amber/hello/ld.script
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
/* Memory Regions *********************************************************************/
|
||||
/* -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- ---
|
||||
* FLASH | REGISTERS I/O EXT I/O ISRAM | EEPROM
|
||||
* | REGISTERS REGISTERS |
|
||||
* -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- ---
|
||||
* ATMEGA128* 0x0000 128Kb | 0x0000 32 0x0020 64 0x0060 160 0x0100 4Kb | 0x0000 4Kb
|
||||
* -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- ---
|
||||
* *Memory configuration A
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rx) : ORIGIN = 0, LENGTH = 128K
|
||||
sram (rw!x) : ORIGIN = 0x800100, LENGTH = 4K
|
||||
eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 4K
|
||||
}
|
||||
|
||||
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
|
||||
OUTPUT_ARCH(avr:5)
|
||||
ENTRY(__start)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* Read-only sections, merged into text segment: */
|
||||
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.gnu.version : { *(.gnu.version) }
|
||||
.gnu.version_d : { *(.gnu.version_d) }
|
||||
.gnu.version_r : { *(.gnu.version_r) }
|
||||
.rel.init : { *(.rel.init) }
|
||||
.rela.init : { *(.rela.init) }
|
||||
|
||||
.rel.text :
|
||||
{
|
||||
*(.rel.text)
|
||||
*(.rel.text.*)
|
||||
*(.rel.gnu.linkonce.t*)
|
||||
}
|
||||
|
||||
.rela.text :
|
||||
{
|
||||
*(.rela.text)
|
||||
*(.rela.text.*)
|
||||
*(.rela.gnu.linkonce.t*)
|
||||
}
|
||||
|
||||
.rel.fini : { *(.rel.fini) }
|
||||
.rela.fini : { *(.rela.fini) }
|
||||
|
||||
.rel.rodata :
|
||||
{
|
||||
*(.rel.rodata)
|
||||
*(.rel.rodata.*)
|
||||
*(.rel.gnu.linkonce.r*)
|
||||
}
|
||||
|
||||
.rela.rodata :
|
||||
{
|
||||
*(.rela.rodata)
|
||||
*(.rela.rodata.*)
|
||||
*(.rela.gnu.linkonce.r*)
|
||||
}
|
||||
|
||||
.rel.data :
|
||||
{
|
||||
*(.rel.data)
|
||||
*(.rel.data.*)
|
||||
*(.rel.gnu.linkonce.d*)
|
||||
}
|
||||
|
||||
.rela.data :
|
||||
{
|
||||
*(.rela.data)
|
||||
*(.rela.data.*)
|
||||
*(.rela.gnu.linkonce.d*)
|
||||
}
|
||||
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rel.bss : { *(.rel.bss) }
|
||||
.rela.bss : { *(.rela.bss) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
|
||||
.text :
|
||||
{
|
||||
_stext = . ;
|
||||
*(.vectors)
|
||||
*(.init)
|
||||
*(.handlers)
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
_etext = . ;
|
||||
} > flash
|
||||
|
||||
_eronly = ABSOLUTE(.);
|
||||
|
||||
.data :
|
||||
{
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > sram AT > flash
|
||||
|
||||
.bss :
|
||||
{
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > sram
|
||||
|
||||
/* Global data not cleared after reset. */
|
||||
|
||||
.noinit :
|
||||
{
|
||||
_snoinit = ABSOLUTE(.);
|
||||
*(.noinit*)
|
||||
_enoinit = ABSOLUTE(.);
|
||||
} > sram
|
||||
|
||||
.eeprom :
|
||||
{
|
||||
_seeprom = ABSOLUTE(.);
|
||||
*(.eeprom*)
|
||||
_eeeprom = ABSOLUTE(.);
|
||||
} > eeprom
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to the beginning
|
||||
of the section so we begin them at 0. */
|
||||
|
||||
/* DWARF 1 */
|
||||
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
|
||||
/* GNU DWARF 1 extensions */
|
||||
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
|
||||
/* DWARF 2 */
|
||||
|
||||
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
# configs/amber/hello/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if [ "$_" = "$0" ] ; then
|
||||
echo "You must source this script, not run it!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WD=`pwd`
|
||||
if [ ! -x "setenv.sh" ]; then
|
||||
echo "This script must be executed from the top-level NuttX build directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${PATH_ORIG}" ]; then
|
||||
export PATH_ORIG="${PATH}"
|
||||
fi
|
||||
|
||||
# This is the Cygwin path to the location where I installed the WinAVR
|
||||
# toolchain under windows. This is *not* the default install
|
||||
# location so you will probably have to edit this. You will also have
|
||||
# to edit this if you install the Linux AVR toolchain as well
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/WinAVR/bin"
|
||||
|
||||
# This is the Cygwin path to the location where I build the buildroot
|
||||
# toolchain.
|
||||
export TOOLCHAIN_BIN="${WD}/../buildroot/build_avr/staging_dir/bin"
|
||||
|
||||
# Add the path to the toolchain to the PATH varialble
|
||||
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
|
||||
echo "PATH : ${PATH}"
|
||||
@@ -1,100 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/amber/include/board.h
|
||||
* include/arch/board/board.h
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __CONFIGS_AMBER_INCLUDE_BOARD_H
|
||||
#define __CONFIGS_AMBER_INCLUDE_BOARD_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Clocking *****************************************************************/
|
||||
/* Assume default CLKDIV8 fuse setting is overridden to CLKDIV1 */
|
||||
|
||||
#define BOARD_XTAL_FREQ 14745600 /* 14.7456MHz crystal */
|
||||
#define BOARD_CPU_CLOCK BOARD_XTAL_FREQ /* F_CPU = 14.7456MHz */
|
||||
#define BOARD_TOSCK_CLOCK 32768 /* TOSC = 32.768KHz */
|
||||
|
||||
/* LED definitions **********************************************************/
|
||||
/* The Amber Web Server has a reset switch and four LEDs. The LEDs indicate
|
||||
* the status of power, programming state, Ethernet link status and reset
|
||||
* status (Active). None are available for software use.
|
||||
*/
|
||||
|
||||
#define LED_STARTED 0
|
||||
#define LED_HEAPALLOCATE 1
|
||||
#define LED_IRQSENABLED 2
|
||||
#define LED_STACKCREATED 3
|
||||
#define LED_INIRQ 4
|
||||
#define LED_SIGNAL 5
|
||||
#define LED_ASSERTION 6
|
||||
#define LED_PANIC 7
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_AMBER_INCLUDE_BOARD_H */
|
||||
@@ -1,2 +0,0 @@
|
||||
/.depend
|
||||
/Make.dep
|
||||
@@ -1,96 +0,0 @@
|
||||
############################################################################
|
||||
# configs/amber/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
ASRCS =
|
||||
CSRCS = atmega_boot.c
|
||||
|
||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
||||
CSRCS += atmega_leds.c
|
||||
endif
|
||||
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
|
||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||
ifeq ($(CONFIG_ARCH_FAMILY_AVR32),y)
|
||||
ARCH_SUBDIR = avr32
|
||||
endif
|
||||
ifeq ($(CONFIG_ARCH_FAMILY_AVR),y)
|
||||
ARCH_SUBDIR = avr
|
||||
endif
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
CFLAGS += -I "${shell cygpath -w $(TOPDIR)/sched}"
|
||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}"
|
||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/common}"
|
||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/$(ARCH_SUBDIR)}"
|
||||
else
|
||||
CFLAGS += -I "$(TOPDIR)/sched"
|
||||
CFLAGS += -I "$(ARCH_SRCDIR)/chip"
|
||||
CFLAGS += -I "$(ARCH_SRCDIR)/common"
|
||||
CFLAGS += -I "$(ARCH_SRCDIR)/$(ARCH_SUBDIR)"
|
||||
endif
|
||||
|
||||
all: libboard$(LIBEXT)
|
||||
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
libboard$(LIBEXT): $(OBJS)
|
||||
$(call ARCHIVE, $@, $(OBJS))
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
$(Q) touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
$(call DELFILE, libboard$(LIBEXT))
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
$(call DELFILE, Make.dep)
|
||||
$(call DELFILE, .depend)
|
||||
|
||||
-include Make.dep
|
||||
@@ -1,102 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/amber/src/amber-internal.h
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __CONFIGS_AMBER_SRC_AMBER_INTERNAL_H
|
||||
#define __CONFIGS_AMBER_SRC_AMBER_INTERNAL_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: atmega_spiinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the Amber Web Server.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
|
||||
void weak_function atmega_spiinitialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: atmega_ledinit
|
||||
*
|
||||
* Description:
|
||||
* Configure on-board LEDs if LED support has been selected.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
void atmega_ledinit(void);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_AMBER_SRC_AMBER_INTERNAL_H */
|
||||
@@ -1,92 +0,0 @@
|
||||
/************************************************************************************
|
||||
* configs/amber/src/atmega_boot.c
|
||||
*
|
||||
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
#include "atmega_internal.h"
|
||||
#include "amber_internal.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: atmega_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All ATMega architectures must provide the following entry point. This entry
|
||||
* point is called early in the initialization -- after all memory has been
|
||||
* configured and mapped but before any devices have been initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void atmega_boardinitialize(void)
|
||||
{
|
||||
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak
|
||||
* function atmega_spiinitialize() has been brought into the link.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
|
||||
if (atmega_spiinitialize)
|
||||
{
|
||||
atmega_spiinitialize();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Configure on-board LEDs if LED support has been selected. */
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
atmega_ledinit();
|
||||
#endif
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
if ARCH_BOARD_ARDUINO_DUE
|
||||
|
||||
config ADRUINO_DUE_REV3
|
||||
bool "Rev 3"
|
||||
default n
|
||||
---help---
|
||||
This port was performed on the Aduino Due Rev 2 board. Differences
|
||||
with the Arduino Due Rev 3 board have been reported. This selection
|
||||
will enable work arounds specifically for the Rev 3 board.
|
||||
|
||||
config ARDUINO_ITHEAD_TFT
|
||||
bool "ITEAD 2.4 inch TFT w/Touch"
|
||||
default n
|
||||
---help---
|
||||
Select this option if you have the ITEAD 2.4" TFT module installed.
|
||||
This will enable support for the peripherals on that module
|
||||
including the SD card, TFT LCD, and touchscreen controller.
|
||||
|
||||
endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,278 +0,0 @@
|
||||
/************************************************************************************
|
||||
* configs/arduino-due/include/board.h
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __CONFIGS_ARDUINO_DUE_INCLUDE_BOARD_H
|
||||
#define __CONFIGS_ARDUINO_DUE_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
# include <stdbool.h>
|
||||
# ifdef CONFIG_SAM34_GPIO_IRQ
|
||||
# include <arch/irq.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* Clocking *************************************************************************/
|
||||
/* After power-on reset, the SAM3X device is running on a 4MHz internal RC. These
|
||||
* definitions will configure clocking
|
||||
*
|
||||
* MAINOSC: Frequency = 12MHz (crysta)
|
||||
* PLLA: PLL Divider = 1, Multiplier = 14 to generate PLLACK = 168MHz
|
||||
* Master Clock (MCK): Source = PLLACK, Prescalar = 1 to generate MCK = 84MHz
|
||||
* CPU clock: 84MHz
|
||||
*/
|
||||
|
||||
#define BOARD_32KOSC_FREQUENCY (32768)
|
||||
#define BOARD_SCLK_FREQUENCY (BOARD_32KOSC_FREQUENCY)
|
||||
#define BOARD_MAINOSC_FREQUENCY (12000000) /* MAINOSC: 12MHz crystal on-board */
|
||||
|
||||
/* Main oscillator register settings.
|
||||
*
|
||||
* The start up time should be should be:
|
||||
* Start Up Time = 8 * MOSCXTST / SLCK = 56 Slow Clock Cycles.
|
||||
*/
|
||||
|
||||
#define BOARD_CKGR_MOR_MOSCXTST (62 << PMC_CKGR_MOR_MOSCXTST_SHIFT) /* Start-up Time */
|
||||
|
||||
/* PLLA configuration.
|
||||
*
|
||||
* Divider = 1
|
||||
* Multipler = 14
|
||||
*/
|
||||
|
||||
#define BOARD_CKGR_PLLAR_MUL (13 << PMC_CKGR_PLLAR_MUL_SHIFT)
|
||||
#define BOARD_CKGR_PLLAR_COUNT (63 << PMC_CKGR_PLLAR_COUNT_SHIFT)
|
||||
#define BOARD_CKGR_PLLAR_DIV PMC_CKGR_PLLAR_DIV_BYPASS
|
||||
|
||||
/* PMC master clock register settings.
|
||||
*
|
||||
* Source = PLLA
|
||||
* Divider = 2
|
||||
*/
|
||||
|
||||
#define BOARD_PMC_MCKR_CSS PMC_MCKR_CSS_PLLA
|
||||
#define BOARD_PMC_MCKR_PRES PMC_MCKR_PRES_DIV2
|
||||
|
||||
/* USB UTMI PLL start-up time */
|
||||
|
||||
#define BOARD_CKGR_UCKR_UPLLCOUNT (3 << PMC_CKGR_UCKR_UPLLCOUNT_SHIFT)
|
||||
|
||||
/* Resulting frequencies */
|
||||
|
||||
#define BOARD_PLLA_FREQUENCY (168000000) /* PLLACK: 14 * 12Mhz / 1 */
|
||||
#define BOARD_MCK_FREQUENCY (84000000) /* MCK: PLLACK / 2 */
|
||||
#define BOARD_CPU_FREQUENCY (84000000) /* CPU: MCK */
|
||||
|
||||
/* HSMCI clocking
|
||||
*
|
||||
* Multimedia Card Interface clock (MCCK or MCI_CK) is Master Clock (MCK)
|
||||
* divided by (2*(CLKDIV+1)).
|
||||
*
|
||||
* MCI_SPEED = MCCK / (2*(CLKDIV+1))
|
||||
* CLKDIV = MCCK / MCI_SPEED / 2 - 1
|
||||
*
|
||||
* Where CLKDIV has a range of 0-255.
|
||||
*/
|
||||
|
||||
/* MCK = 84MHz, CLKDIV = 104, MCI_SPEED = 84MHz / 2 * (104+1) = 400 KHz */
|
||||
|
||||
#define HSMCI_INIT_CLKDIV (104 << HSMCI_MR_CLKDIV_SHIFT)
|
||||
|
||||
/* MCK = 84MHz, CLKDIV = 2, MCI_SPEED = 84MHz / 2 * (2+1) = 14 MHz */
|
||||
|
||||
#define HSMCI_MMCXFR_CLKDIV (1 << HSMCI_MR_CLKDIV_SHIFT)
|
||||
|
||||
/* MCK = 84MHz, CLKDIV = 1, MCI_SPEED = 84MHz / 2 * (1+1) = 21 MHz */
|
||||
|
||||
#define HSMCI_SDXFR_CLKDIV (1 << HSMCI_MR_CLKDIV_SHIFT)
|
||||
#define HSMCI_SDWIDEXFR_CLKDIV HSMCI_SDXFR_CLKDIV
|
||||
|
||||
/* FLASH wait states
|
||||
*
|
||||
* FWS MAX FREQUENCY
|
||||
* 1.62V 1.8V
|
||||
* --- ----- ------
|
||||
* 0 17MHz 19MHz
|
||||
* 1 45MHz 50MHz
|
||||
* 2 58MHz 64MHz
|
||||
* 3 70MHz 80MHz
|
||||
* 4 78MHz 90MHz
|
||||
*/
|
||||
|
||||
#define BOARD_FWS 4
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* There are three user-controllable LEDs on board the Arduino Due board:
|
||||
*
|
||||
* LED GPIO
|
||||
* ---------------- -----
|
||||
* L Amber LED PB27
|
||||
* TX Yellow LED PA21
|
||||
* RX Yellow LED PC30
|
||||
*
|
||||
* LED L is connected to ground and can be illuminated by driving the PB27
|
||||
* output high. The TX and RX LEDs are pulled high and can be illuminated by
|
||||
* driving the corresponding
|
||||
* GPIO output to low.
|
||||
*/
|
||||
|
||||
/* LED index values for use with sam_setled() */
|
||||
|
||||
#define BOARD_LED_L 0
|
||||
#define BOARD_LED_RX 1
|
||||
#define BOARD_LED_TX 2
|
||||
#define BOARD_NLEDS 3
|
||||
|
||||
/* LED bits for use with sam_setleds() */
|
||||
|
||||
#define BOARD_LED_L_BIT (1 << BOARD_LED_L)
|
||||
#define BOARD_LED_RX_BIT (1 << BOARD_LED_RX)
|
||||
#define BOARD_LED_TX_BIT (1 << BOARD_LED_TX)
|
||||
|
||||
/* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
|
||||
* defined. In that case, the usage by the board port is defined in
|
||||
* include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
|
||||
* events as follows:
|
||||
*
|
||||
* SYMBOL MEANING LED STATE
|
||||
* L TX RX
|
||||
* ----------------------- -------------------------- -------- -------- -------- */
|
||||
#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */
|
||||
#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF OFF OFF */
|
||||
#define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF OFF */
|
||||
#define LED_STACKCREATED 1 /* Idle stack created ON OFF OFF */
|
||||
#define LED_INIRQ 2 /* In an interrupt N/C GLOW OFF */
|
||||
#define LED_SIGNAL 2 /* In a signal handler N/C GLOW OFF */
|
||||
#define LED_ASSERTION 2 /* An assertion failed N/C GLOW OFF */
|
||||
#define LED_PANIC 3 /* The system has crashed N/C N/C Blinking */
|
||||
#define LED_PANIC 3 /* MCU is is sleep mode ------ Not used -------- */
|
||||
|
||||
/* Thus if LED L is statically on, NuttX has successfully booted and is,
|
||||
* apparently, running normmally. If LED RX is glowing, then NuttX is
|
||||
* handling interrupts (and also signals and assertions). If TX is flashing
|
||||
* at approximately 2Hz, then a fatal error has been detected and the system
|
||||
*/
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* There are no buttons on the Arduino Due board. */
|
||||
|
||||
/* GPIO pin configurations **********************************************************/
|
||||
|
||||
#if 1 /* #ifdef CONFIG_ARDUINO_DUE_REV3 works with REV2 as well */
|
||||
/* This port was performed on the Arduino Due Rev 2 board. A NuttX user reported
|
||||
* issues with the serial port on his Aduino Due Rev 3 board. That problem was
|
||||
* resolved as follows:
|
||||
*
|
||||
* "... The issue was in my hardware. I found the difference between Arduino
|
||||
* Due shematics (revision R2) and actual PCB layout of my Arduino (revision
|
||||
* R3). On a schematics which I download from arduino.cc was shown that 2nd
|
||||
* pin of IC10 is connected to the ground, but on my Arduino the 2nd pin
|
||||
* of IC10 was connected to its 1st pin instead of ground and in my case
|
||||
* IC10 works in open-drain mode, but RX0 pin on SAM3x doesn't have pull-up
|
||||
* and thus TX signal from AtMega16U2 can't reach the SAM3x input pin, on
|
||||
* this pin always '0'.
|
||||
*
|
||||
* "My solution is to enable internal pull-up in SAM3x. ...
|
||||
* Now shell console on UART0 (via USB programming connector) of Arduino Due
|
||||
* Due works as expected."
|
||||
*/
|
||||
|
||||
# undef GPIO_UART0_RXD
|
||||
# define GPIO_UART0_RXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | GPIO_PORT_PIOA | \
|
||||
GPIO_PIN8 | GPIO_CFG_PULLUP)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
/************************************************************************************
|
||||
* Name: sam_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All SAM3X architectures must provide the following entry point. This entry point
|
||||
* is called early in the intitialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void sam_boardinitialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_ledinit, sam_setled, and sam_setleds
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board LEDs. If
|
||||
* CONFIG_ARCH_LEDS is not defined, then the following interfacesare available to
|
||||
* control the LEDs from user applications.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef CONFIG_ARCH_LEDS
|
||||
void sam_ledinit(void);
|
||||
void sam_setled(int led, bool ledon);
|
||||
void sam_setleds(uint8_t ledset);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_ARDUINO_DUE_INCLUDE_BOARD_H */
|
||||
@@ -1,108 +0,0 @@
|
||||
############################################################################
|
||||
# configs/arduino-due/nsh/Make.defs
|
||||
#
|
||||
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include ${TOPDIR}/.config
|
||||
include ${TOPDIR}/tools/Config.mk
|
||||
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
||||
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
|
||||
else
|
||||
# Linux/Cygwin-native toolchain
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
||||
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
||||
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
|
||||
endif
|
||||
|
||||
CC = $(CROSSDEV)gcc
|
||||
CXX = $(CROSSDEV)g++
|
||||
CPP = $(CROSSDEV)gcc -E
|
||||
LD = $(CROSSDEV)ld
|
||||
AR = $(CROSSDEV)ar rcs
|
||||
NM = $(CROSSDEV)nm
|
||||
OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
|
||||
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
ARCHOPTIMIZATION = -g
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||
ARCHWARNINGSXX = -Wall -Wshadow
|
||||
ARCHDEFINES =
|
||||
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
|
||||
|
||||
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
||||
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
||||
|
||||
NXFLATLDFLAGS1 = -r -d -warn-common
|
||||
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
LDNXFLATFLAGS = -e main -s 2048
|
||||
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
EXEEXT =
|
||||
|
||||
ifneq ($(CROSSDEV),arm-nuttx-elf-)
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
endif
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,78 +0,0 @@
|
||||
#!/bin/bash
|
||||
# configs/arduino-due/nsh/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if [ "$_" = "$0" ] ; then
|
||||
echo "You must source this script, not run it!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WD=`pwd`
|
||||
if [ ! -x "setenv.sh" ]; then
|
||||
echo "This script must be executed from the top-level NuttX build directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${PATH_ORIG}" ]; then
|
||||
export PATH_ORIG="${PATH}"
|
||||
fi
|
||||
|
||||
# This is the Cygwin path to the location where I installed the Atmel GCC
|
||||
# toolchain under Windows. You will also have to edit this if you install
|
||||
# this toolchain in any other location
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atmel/Atmel Toolchain/ARM GCC/Native/4.7.3.99/arm-gnu-toolchain/bin"
|
||||
|
||||
# This is the Cygwin path to the location where I installed the CodeSourcery
|
||||
# toolchain under windows. You will also have to edit this if you install
|
||||
# the CodeSourcery toolchain in any other location
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin"
|
||||
|
||||
# These are the Cygwin paths to the locations where I installed the Atollic
|
||||
# toolchain under windows. You will also have to edit this if you install
|
||||
# the Atollic toolchain in any other location. /usr/bin is added before
|
||||
# the Atollic bin path because there is are binaries named gcc.exe and g++.exe
|
||||
# at those locations as well.
|
||||
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin"
|
||||
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin"
|
||||
|
||||
# This is the Cygwin path to the location where I build the buildroot
|
||||
# toolchain.
|
||||
export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
|
||||
|
||||
# This is the Cygwin path to the location where I have the Arduino BOSSA program
|
||||
export BOSSA_BIN="/cygdrive/c/Program Files (x86)/Arduino/arduino-1.5.2/hardware/tools"
|
||||
|
||||
# Add the path to the toolchain to the PATH varialble
|
||||
export PATH="${TOOLCHAIN_BIN}:${BOSSA_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
|
||||
echo "PATH : ${PATH}"
|
||||
@@ -1,123 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/arduino-due/scripts/ld.script
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The ATSAM3X8E has 512KB of FLASH beginning at address 0x0008:0000 and
|
||||
* up to 100KB SRAM in three memory regions.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rx) : ORIGIN = 0x00080000, LENGTH = 1024K
|
||||
sram0 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
sram1 (rwx) : ORIGIN = 0x20080000, LENGTH = 32K
|
||||
nfcram (rwx) : ORIGIN = 0x20100000, LENGTH = 4K
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_stext)
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
_stext = ABSOLUTE(.);
|
||||
*(.vectors)
|
||||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.got)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.r.*)
|
||||
_etext = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
.init_section : {
|
||||
_sinit = ABSOLUTE(.);
|
||||
*(.init_array .init_array.*)
|
||||
_einit = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} >flash
|
||||
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx*)
|
||||
} >flash
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > sram0 AT > flash
|
||||
|
||||
_eronly = LOADADDR(.data);
|
||||
|
||||
.ramfunc ALIGN(4): {
|
||||
_sramfuncs = ABSOLUTE(.);
|
||||
*(.ramfunc .ramfunc.*)
|
||||
_eramfuncs = ABSOLUTE(.);
|
||||
} > sram0 AT > flash
|
||||
|
||||
_framfuncs = LOADADDR(.ramfunc);
|
||||
|
||||
.bss : {
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > sram0
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
############################################################################
|
||||
# configs/arduino-due/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
CFLAGS += -I$(TOPDIR)/sched
|
||||
|
||||
ASRCS =
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
|
||||
CSRCS = sam_boot.c
|
||||
|
||||
ifeq ($(CONFIG_HAVE_CXX),y)
|
||||
CSRCS += sam_cxxinitialize.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
||||
CSRCS += sam_autoleds.c
|
||||
else
|
||||
CSRCS += sam_userleds.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARDUINO_ITHEAD_TFT),y)
|
||||
|
||||
ifeq ($(CONFIG_SPI_BITBANG),y)
|
||||
ifeq ($(CONFIG_MMCSD_SPI),y)
|
||||
CSRCS += sam_mmcsd.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_ADS7843E),y)
|
||||
CSRCS += sam_touchscreen.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD),y)
|
||||
CSRCS += sam_lcd.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NSH_ARCHINIT),y)
|
||||
CSRCS += sam_nsh.c
|
||||
endif
|
||||
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
|
||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||
ifeq ($(WINTOOL),y)
|
||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}"
|
||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/common}"
|
||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}"
|
||||
else
|
||||
CFLAGS += -I$(ARCH_SRCDIR)/chip
|
||||
CFLAGS += -I$(ARCH_SRCDIR)/common
|
||||
CFLAGS += -I$(ARCH_SRCDIR)/armv7-m
|
||||
endif
|
||||
|
||||
all: libboard$(LIBEXT)
|
||||
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
libboard$(LIBEXT): $(OBJS)
|
||||
$(call ARCHIVE, $@, $(OBJS))
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
$(Q) touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
$(call DELFILE, libboard$(LIBEXT))
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
$(call DELFILE, Make.dep)
|
||||
$(call DELFILE, .depend)
|
||||
|
||||
-include Make.dep
|
||||
@@ -1,339 +0,0 @@
|
||||
/************************************************************************************
|
||||
* configs/arduino-due/src/arduino-due.h
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __CONFIGS_ARDUINO_DUE_SRC_ARDUNO_DUE_H
|
||||
#define __CONFIGS_ARDUINO_DUE_SRC_ARDUNO_DUE_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include "chip/sam_pinmap.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
/* There are three user-controllable LEDs on board the Arduino Due board:
|
||||
*
|
||||
* LED GPIO
|
||||
* ---------------- -----
|
||||
* L Amber LED PB27
|
||||
* TX Yellow LED PA21
|
||||
* RX Yellow LED PC30
|
||||
*
|
||||
* LED L is connected to ground and can be illuminated by driving the PB27
|
||||
* output high. The TX and RX LEDs are pulled high and can be illuminated by
|
||||
* driving the corresponding
|
||||
* GPIO output to low.
|
||||
*
|
||||
* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
|
||||
* defined. In that case, the usage by the board port is defined in
|
||||
* include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
|
||||
* events as follows:
|
||||
*
|
||||
* SYMBOL MEANING LED STATE
|
||||
* L TX RX
|
||||
* ------------------- ----------------------- -------- -------- --------
|
||||
* LED_STARTED NuttX has been started OFF OFF OFF
|
||||
* LED_HEAPALLOCATE Heap has been allocated OFF OFF OFF
|
||||
* LED_IRQSENABLED Interrupts enabled OFF OFF OFF
|
||||
* LED_STACKCREATED Idle stack created ON OFF OFF
|
||||
* LED_INIRQ In an interrupt N/C GLOW OFF
|
||||
* LED_SIGNAL In a signal handler N/C GLOW OFF
|
||||
* LED_ASSERTION An assertion failed N/C GLOW OFF
|
||||
* LED_PANIC The system has crashed N/C N/C Blinking
|
||||
* LED_IDLE MCU is is sleep mode ------ Not used --------
|
||||
*
|
||||
* Thus if LED L is statically on, NuttX has successfully booted and is,
|
||||
* apparently, running normmally. If LED RX is glowing, then NuttX is
|
||||
* handling interrupts (and also signals and assertions). If TX is flashing
|
||||
* at approximately 2Hz, then a fatal error has been detected and the system
|
||||
*/
|
||||
|
||||
#define GPIO_LED_L (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOB | GPIO_PIN27)
|
||||
#define GPIO_LED_RX (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
|
||||
GPIO_PORT_PIOC | GPIO_PIN30)
|
||||
#define GPIO_LED_TX (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN21)
|
||||
|
||||
/* ITEAD 2.4" TFT with Touch
|
||||
*
|
||||
* The Arduino 2.4" TFT Touch Shield is designed for all the Arduino
|
||||
* compatible boards. It works in 3.3V voltage level. It can be directly
|
||||
* plugged on the Arduino and other compatible boards. It will offer
|
||||
* display, touch and storage functions for the Arduino board
|
||||
*
|
||||
* Features:
|
||||
*
|
||||
* 1. Compatible with 3.3/5V operation voltage level
|
||||
* 2. Compatible with UTFT library
|
||||
* 3. With SD Card Socket
|
||||
*
|
||||
* The Arduino 2.4" TFT Touch shield uses the S6D1121 controller , it
|
||||
* supports 8-bit data interface. The touch IC is TSC2046.
|
||||
*
|
||||
* ---------- --------------------------- ----------- --------------------------- ------------------
|
||||
* Arduino ATSAM3X Due ITHEAD
|
||||
* Due PIN GPIO FUNCTION SIGNAL PIN SIGNAL NOTES
|
||||
* ---------- ---- ---------------------- ----------- ---------------- ---------- ------------------
|
||||
* PWMH
|
||||
* 10 SCL1 PA18 TWCK0/A20/WKUP9 SCL1 --- --- --- SCL not available
|
||||
* 9 SDA1 PA17 TWD0SPCK0 SDA1 --- --- --- SDA not available
|
||||
* 8 Aref --- --- AREF J2 pin 8 Vref N/C ---
|
||||
* 7 GND --- --- GND J2 pin 7 GND --- ---
|
||||
* 6 PWM13 PB27 SPI0_SPCK/A20/WKUP10 PWM13 J2 pin 6 D13 SD_SCK SCK, also LED "L", Pulled low
|
||||
* 5 PWM12 PD8 A21/NANDALE/TIOB8 PWM12 J2 pin 5 D12 SD_MISO MISO not available
|
||||
* 4 PWM11 PD7 A17/BA1/TIOA8 PWM11 J2 pin 4 D11 SD_MOSI MOSI not available, Pulled low
|
||||
* 3 PWM10 PA28 SPI0_NPCS0/PCK2/WKUP11 SS0/PWM10 J2 pin 3 D10 SD_CS Pulled low on-board
|
||||
* 2 PWM9 PC21 A0/NBS0/PWML4 PWM9 J2 pin 2 D9 Touch_Dout ---
|
||||
* 1 PWM8 PC22 A1/PWML5 PWM8 J2 pin 1 D8 Touch_IRQ ---
|
||||
*
|
||||
* PWML
|
||||
* 8 PWM7 PC23 A2/PWML6 PWM7 J3 pin 8 D7 DB15 ---
|
||||
* 7 PWM6 PC24 A3/PWML7 PWM6 J3 pin 7 D6 DB14 ---
|
||||
* 6 PWM5 PC25 A4/TIOA6 PWM5 J3 pin 6 D5 DB13 ---
|
||||
* 5 PWM4 PC26 A5/TIOB6 SS1/PWM4 J3 pin 5 D4 DB12 ---
|
||||
* 4 PWM3 PC28 A7/TIOA7 PWM3 J3 pin 4 D3 DB11 ---
|
||||
* 3 PWM2 PB25 RTS0/TIOA0 PWM2 J3 pin 3 D2 DB10 ---
|
||||
* 2 PWM1 PA9 UTXD/PWMH3 TX J3 pin 2 D1 DB9 UART0 TX
|
||||
* 1 PWM0 PA8 URXD/PWMH0/WKUP4 RX J3 pin 1 D0 DB8 UART0 RX
|
||||
* ---------- ---- ---------------------- ----------- ---------------- ---------- ------------------
|
||||
* POWER
|
||||
* 1 --- --- --- --- --- --- --- ---
|
||||
* 2 IOref --- --- IOREF +3V3 --- --- --- ---
|
||||
* 3 RESET --- --- MASTER_RESET J4 pin 1 RST --- ---
|
||||
* 5 5V --- --- +5V J4 pin 2 3.3V --- ---
|
||||
* 4 3.3V --- --- +3V3 J4 pin 3 5V --- ---
|
||||
* 6 GND --- --- GND J4 pin 4 GND --- ---
|
||||
* 7 GND --- --- GND J4 pin 5 GND --- ---
|
||||
* 8 Vin --- --- VIN J4 pin 6 Vin --- ---
|
||||
* ADCL
|
||||
* 1 A0 PA16 SPCK1/TD/AD7 AD0 J1 pin 1 A0/D14 Touch_Din ---
|
||||
* 2 A1 PA24 MCDA3/PCK1/AD6 AD1 J1 pin 1 A1/D15 Touch_CLK ---
|
||||
* 3 A2 PA23 MCDA2/TCLK4/AD5 AD2 J1 pin 1 A2/D16 --- ---
|
||||
* 4 A3 PA22 MCDA1/TCLK3/AD4 AD3 J1 pin 1 A3/D17 TFT_CS ---
|
||||
* 5 A4 PA6 TIOB2/NCS0/AD3 AD4 J1 pin 1 A4/D18 TFT_WR ---
|
||||
* 6 A5 PA4 TCLK1/NWAIT/AD2 AD5 J1 pin 1 A5/D19 TFT_RS ---
|
||||
* 7 A6 PA3 TIOB1/PWMFI1/AD1/WKUP1 AD6 --- --- --- ---
|
||||
* 8 A7 PA2 TIOA1/NANDRDY/AD0 AD7 --- --- --- ---
|
||||
* ---------- ---- ---------------------- ----------- ---------------- ---------- ------------------
|
||||
*
|
||||
* NOTES:
|
||||
*
|
||||
* 1. It is not possible to use any of the SPI devices on the Shield unless
|
||||
* a bit-bang SPI interface is used. This includes the touch controller
|
||||
* and the SD card.
|
||||
* 2. UART0 cannot be used. USARTs on the COMM connector should be available.
|
||||
* 3. Parallel data is not contiguous in the PIO register
|
||||
* 4. Touchcontroller /CS pin is connected to ground (always selected).
|
||||
* 5. Either PA28 or PC29 may drive PWM10
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARDUINO_ITHEAD_TFT
|
||||
/* In order to use the SD card on the ITEAD shield, you must enable the
|
||||
* SPI bit-bang driver as well as support for SPI-based MMC/SD cards.
|
||||
*/
|
||||
|
||||
# if defined(CONFIG_SPI_BITBANG) && defined(CONFIG_MMCSD_SPI)
|
||||
|
||||
/* SD Interface:
|
||||
*
|
||||
* ------------ ------------------ ------- ------------- ------------------ -------
|
||||
* SD CONNECTOR ARDUINO CONNECTORS AT91SAM SD CONNECTOR ARDUINO CONNECTORS AT91SAM
|
||||
* PIN SIGNAL PIN SIGNAL GPIO PIN SIGNAL PIN SIGNAL GPIO
|
||||
* --- -------- -------- --------- -------- ---- -------- -------- --------- -------
|
||||
* 1 /CS J2 pin 3 D10 PA28 2 DI J2 pin 4 D11 PD7
|
||||
* 3 GND --- --- --- 4 VCC --- --- ---
|
||||
* 5 CLK J2 pin 6 D13 PB27 6 GND --- --- ---
|
||||
* 7 DO J2 pin 5 D12 PD8 8 IRQ N/C --- ---
|
||||
* 9 N/C --- --- --- 10 SW N/C --- ---
|
||||
* 11 WP N/C --- --- 12 CD N/C --- ---
|
||||
* 13 CD N/C --- --- 14 GND --- --- ---
|
||||
* 15 GND --- --- --- 16 GND --- --- ---
|
||||
* --- -------- -------- --------- -------- ---- -------- -------- --------- -------
|
||||
*
|
||||
* NOTES:
|
||||
* - The SD slot shares the pin with LED "L" so LED support must be disabled
|
||||
* to use the MMC/SD card on the ITEAD shield.
|
||||
* - Either PA28 or PC29 may drive D10
|
||||
*/
|
||||
|
||||
# ifdef CONFIG_ARCH_LEDs
|
||||
# error LEDs may not be used with the ITEAD SD card
|
||||
# endif
|
||||
|
||||
# define GPIO_SD_SCK (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOB | GPIO_PIN27)
|
||||
# define GPIO_SD_MISO (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_PORT_PIOD | \
|
||||
GPIO_PIN8)
|
||||
# define GPIO_SD_MOSI (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOD | GPIO_PIN7)
|
||||
|
||||
# define GPIO_SD_CS (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN28)
|
||||
# endif
|
||||
|
||||
/* In order to use the touchscreen on the ITEAD shield, you must enable the
|
||||
* SPI bit-bang driver and ADS7843E/XPT2046 device support.
|
||||
*/
|
||||
|
||||
# if defined(CONFIG_SPI_BITBANG) && defined(CONFIG_INPUT_ADS7843E)
|
||||
|
||||
/* Touch Controller Interface:
|
||||
*
|
||||
* ----------- ------------------ -------- ------------- ------------------ -------
|
||||
* XPT2046 ARDUINO CONNECTORS AT91SAM XPT2046 ARDUINO CONNECTORS AT91SAM
|
||||
* PIN SIGNAL PIN SIGNAL GPIO PIN SIGNAL PIN SIGNAL GPIO
|
||||
* --- ------- -------- --------- -------- ---- -------- -------- --------- -------
|
||||
* 1 VCC --- --- --- 2 X+ --- --- ---
|
||||
* 3 Y+ --- --- --- 4 X- --- --- ---
|
||||
* 5 Y- --- --- --- 6 GND --- --- ---
|
||||
* 7 IN3 N/C --- --- 8 IN4 N/C --- ---
|
||||
* 9 VREF --- --- --- 10 VCC --- --- ---
|
||||
* 11 IRQ J2 pin 2 D9 PC21 12 DOUT J2 pin 1 D8 PC22
|
||||
* 13 BUSY N/C --- --- 14 DIN J1 pin 1 A0/D14 PA16
|
||||
* 15 /CS --- --- --- 16 DCLK J1 pin 2 A1/D15 PA24
|
||||
* --- ------- -------- --------- -------- ---- -------- -------- --------- -------
|
||||
*
|
||||
* NOTE: /CS is connected to ground (XPT2046 is always selected)
|
||||
*/
|
||||
|
||||
# define GPIO_TSC_SCK (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN24)
|
||||
# define GPIO_TSC_MISO (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_PORT_PIOC | \
|
||||
GPIO_PIN22)
|
||||
# define GPIO_TSC_MOSI (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN16)
|
||||
|
||||
# define GPIO_TSC_IRQ (GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_INT_BOTHEDGES | \
|
||||
GPIO_PORT_PIOC | GPIO_PIN21)
|
||||
# define SAM_TSC_IRQ SAM_IRQ_PC21
|
||||
# endif
|
||||
|
||||
/* Only CONFIG_LCD is expected to enable the TFT LCD */
|
||||
|
||||
# ifdef CONFIG_LCD
|
||||
|
||||
/* UART0 cannot be used with the LCD because the UART0 pins are used
|
||||
* by the LCD.
|
||||
*/
|
||||
|
||||
# ifdef CONFIG_SAM34_UART0
|
||||
# error "UART0 cannot be used with the ITEAD LCD"
|
||||
# endif
|
||||
|
||||
/* Data pins are initially configured but may be switched dynamically to
|
||||
* either inputs or outputs as needed.
|
||||
*/
|
||||
|
||||
# define GPIO_LCD_D0IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN8)
|
||||
# define GPIO_LCD_D1IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN9)
|
||||
# define GPIO_LCD_D2IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOB | GPIO_PIN25)
|
||||
# define GPIO_LCD_D3IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOC | GPIO_PIN28)
|
||||
# define GPIO_LCD_D4IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOC | GPIO_PIN26)
|
||||
# define GPIO_LCD_D5IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOC | GPIO_PIN25)
|
||||
# define GPIO_LCD_D6IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOC | GPIO_PIN24)
|
||||
# define GPIO_LCD_D7IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOC | GPIO_PIN23)
|
||||
# define GPIO_LCD_D7IN (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOC | GPIO_PIN23)
|
||||
# define GPIO_LCD_CS (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN22)
|
||||
# define GPIO_LCD_WR (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN6)
|
||||
# define GPIO_LCD_RS (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN4)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public data
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_sram_initialize
|
||||
*
|
||||
* Description:
|
||||
* Configure and enable SRAM on board the SAM4S Xplained
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SAM34_EXTSRAM0
|
||||
void sam_sram_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_sdinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the SPI-based SD card.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_MMCSD_SPI)
|
||||
int sam_sdinitialize(int minor);
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_ARDUINO_DUE_SRC_ARDUNO_DUE_H */
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/arduino-due/src/sam_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "sam_gpio.h"
|
||||
#include "arduino-due.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* There are three user-controllable LEDs on board the Arduino Due board:
|
||||
*
|
||||
* LED GPIO
|
||||
* ---------------- -----
|
||||
* L Amber LED PB27
|
||||
* TX Yellow LED PA21
|
||||
* RX Yellow LED PC30
|
||||
*
|
||||
* LED L is connected to ground and can be illuminated by driving the PB27
|
||||
* output high. The TX and RX LEDs are pulled high and can be illuminated by
|
||||
* driving the corresponding
|
||||
* GPIO output to low.
|
||||
*
|
||||
* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
|
||||
* defined. In that case, the usage by the board port is defined in
|
||||
* include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
|
||||
* events as follows:
|
||||
*
|
||||
* SYMBOL MEANING LED STATE
|
||||
* L TX RX
|
||||
* ------------------- ----------------------- -------- -------- --------
|
||||
* LED_STARTED NuttX has been started OFF OFF OFF
|
||||
* LED_HEAPALLOCATE Heap has been allocated OFF OFF OFF
|
||||
* LED_IRQSENABLED Interrupts enabled OFF OFF OFF
|
||||
* LED_STACKCREATED Idle stack created ON OFF OFF
|
||||
* LED_INIRQ In an interrupt N/C GLOW OFF
|
||||
* LED_SIGNAL In a signal handler N/C GLOW OFF
|
||||
* LED_ASSERTION An assertion failed N/C GLOW OFF
|
||||
* LED_PANIC The system has crashed N/C N/C Blinking
|
||||
* LED_IDLE MCU is is sleep mode ------ Not used --------
|
||||
*
|
||||
* Thus if LED L is statically on, NuttX has successfully booted and is,
|
||||
* apparently, running normmally. If LED RX is glowing, then NuttX is
|
||||
* handling interrupts (and also signals and assertions). If TX is flashing
|
||||
* at approximately 2Hz, then a fatal error has been detected and the system
|
||||
*/
|
||||
|
||||
/* CONFIG_DEBUG_LEDS enables debug output from this file (needs CONFIG_DEBUG
|
||||
* with CONFIG_DEBUG_VERBOSE too)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_DEBUG_LEDS
|
||||
# define leddbg lldbg
|
||||
# define ledvdbg llvdbg
|
||||
#else
|
||||
# define leddbg(x...)
|
||||
# define ledvdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_led_initialize
|
||||
****************************************************************************/
|
||||
|
||||
void board_led_initialize(void)
|
||||
{
|
||||
/* Configure RX and TX LED GPIOs for output */
|
||||
|
||||
sam_configgpio(GPIO_LED_L);
|
||||
sam_configgpio(GPIO_LED_RX);
|
||||
sam_configgpio(GPIO_LED_TX);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_led_on
|
||||
****************************************************************************/
|
||||
|
||||
void board_led_on(int led)
|
||||
{
|
||||
switch (led)
|
||||
{
|
||||
/* 0: LED_STARTED, LED_HEAPALLOCATE, LED_IRQSENABLED: L=OFF TX=OFF
|
||||
* RX=OFF
|
||||
*
|
||||
* Since the LEDs were initially all OFF and since this state only
|
||||
* occurs one time, nothing need be done.
|
||||
*/
|
||||
|
||||
default:
|
||||
case 0:
|
||||
break;
|
||||
|
||||
/* 1: LED_STACKCREATED: L=ON TX=OFF RX=OFF
|
||||
*
|
||||
* This case will also occur only once. Note that unlike the other
|
||||
* LEDs, LED L is active high.
|
||||
*/
|
||||
|
||||
case 1:
|
||||
sam_gpiowrite(GPIO_LED_L, true);
|
||||
break;
|
||||
|
||||
/* 2: LED_INIRQ, LED_SIGNAL, LED_ASSERTION: L=N/C TX=ON RX=N/C
|
||||
*
|
||||
* This case will occur many times. LED TX is active low.
|
||||
*/
|
||||
|
||||
case 2:
|
||||
sam_gpiowrite(GPIO_LED_TX, false);
|
||||
break;
|
||||
|
||||
/* 3: LED_PANIC: L=N/X TX=N/C RX=ON
|
||||
*
|
||||
* This case will also occur many times. LED RX is active low.
|
||||
*/
|
||||
|
||||
case 3:
|
||||
sam_gpiowrite(GPIO_LED_RX, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_led_off
|
||||
****************************************************************************/
|
||||
|
||||
void board_led_off(int led)
|
||||
{
|
||||
switch (led)
|
||||
{
|
||||
/* 0: LED_STARTED, LED_HEAPALLOCATE, LED_IRQSENABLED: L=OFF TX=OFF
|
||||
* RX=OFF
|
||||
* 1: LED_STACKCREATED: L=ON TX=OFF RX=OFF
|
||||
*
|
||||
* These cases should never happen.
|
||||
*/
|
||||
|
||||
default:
|
||||
case 1:
|
||||
case 0:
|
||||
break;
|
||||
|
||||
/* 2: LED_INIRQ, LED_SIGNAL, LED_ASSERTION: L=N/C TX=OFF RX=N/C
|
||||
*
|
||||
* This case will occur many times. LED TX is active low.
|
||||
*/
|
||||
|
||||
case 2:
|
||||
sam_gpiowrite(GPIO_LED_TX, true);
|
||||
break;
|
||||
|
||||
/* 3: LED_PANIC: L=N/X TX=N/C RX=OFF
|
||||
*
|
||||
* This case will also occur many times. LED RX is active low.
|
||||
*/
|
||||
|
||||
case 3:
|
||||
sam_gpiowrite(GPIO_LED_RX, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
||||
@@ -1,77 +0,0 @@
|
||||
/************************************************************************************
|
||||
* configs/arduino-due/src/sam_boot.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include "arduino-due.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All SAM3X architectures must provide the following entry point. This entry point
|
||||
* is called early in the intitialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void sam_boardinitialize(void)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
/* Configure on-board LEDs if LED support has been selected. */
|
||||
|
||||
board_led_initialize();
|
||||
#endif
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
/************************************************************************************
|
||||
* configs/arduino-due/src/sam_cxxinitialize.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include <arch/sam34/chip.h>
|
||||
#include "chip.h"
|
||||
|
||||
#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
/* Debug ****************************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing the static constructors */
|
||||
|
||||
#ifndef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_CXX
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_CXX
|
||||
# define cxxdbg dbg
|
||||
# define cxxlldbg lldbg
|
||||
# ifdef CONFIG_DEBUG_VERBOSE
|
||||
# define cxxvdbg vdbg
|
||||
# define cxxllvdbg llvdbg
|
||||
# else
|
||||
# define cxxvdbg(x...)
|
||||
# define cxxllvdbg(x...)
|
||||
# endif
|
||||
#else
|
||||
# define cxxdbg(x...)
|
||||
# define cxxlldbg(x...)
|
||||
# define cxxvdbg(x...)
|
||||
# define cxxllvdbg(x...)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Private Types
|
||||
************************************************************************************/
|
||||
/* This type defines one entry in initialization array */
|
||||
|
||||
typedef void (*initializer_t)(void);
|
||||
|
||||
/************************************************************************************
|
||||
* External references
|
||||
************************************************************************************/
|
||||
/* _sinit and _einit are symbols exported by the linker script that mark the
|
||||
* beginning and the end of the C++ initialization section.
|
||||
*/
|
||||
|
||||
extern initializer_t _sinit;
|
||||
extern initializer_t _einit;
|
||||
|
||||
/* _stext and _etext are symbols exported by the linker script that mark the
|
||||
* beginning and the end of text.
|
||||
*/
|
||||
|
||||
extern uint32_t _stext;
|
||||
extern uint32_t _etext;
|
||||
|
||||
/************************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_cxxinitialize
|
||||
*
|
||||
* Description:
|
||||
* If C++ and C++ static constructors are supported, then this function
|
||||
* must be provided by board-specific logic in order to perform
|
||||
* initialization of the static C++ class instances.
|
||||
*
|
||||
* This function should then be called in the application-specific
|
||||
* user_start logic in order to perform the C++ initialization. NOTE
|
||||
* that no component of the core NuttX RTOS logic is involved; This
|
||||
* function defintion only provides the 'contract' between application
|
||||
* specific C++ code and platform-specific toolchain support
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
void up_cxxinitialize(void)
|
||||
{
|
||||
initializer_t *initp;
|
||||
|
||||
cxxdbg("_sinit: %p _einit: %p _stext: %p _etext: %p\n",
|
||||
&_sinit, &_einit, &_stext, &_etext);
|
||||
|
||||
/* Visit each entry in the initialzation table */
|
||||
|
||||
for (initp = &_sinit; initp != &_einit; initp++)
|
||||
{
|
||||
initializer_t initializer = *initp;
|
||||
cxxdbg("initp: %p initializer: %p\n", initp, initializer);
|
||||
|
||||
/* Make sure that the address is non-NULL and lies in the text region
|
||||
* defined by the linker script. Some toolchains may put NULL values
|
||||
* or counts in the initialization table
|
||||
*/
|
||||
|
||||
if ((void*)initializer > (void*)&_stext && (void*)initializer < (void*)&_etext)
|
||||
{
|
||||
cxxdbg("Calling %p\n", initializer);
|
||||
initializer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HAVE_CXX && CONFIG_HAVE_CXXINITIALIZE */
|
||||
|
||||
@@ -1,287 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/sam3u-ek/src/up_mmcsd.c
|
||||
*
|
||||
* Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/mmcsd.h>
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/spi/spi_bitbang.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "sam_gpio.h"
|
||||
#include "chip/sam3u_pio.h"
|
||||
|
||||
#include "arduino-due.h"
|
||||
|
||||
/* In order to use the SD card on the ITEAD shield, you must enable the SPI bit-bang
|
||||
* driver as well as support for SPI-based MMC/SD cards.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_MMCSD_SPI)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifdef CONFIG_DISABLE_MOUNTPOINT
|
||||
# error Mountpoints are disabled (CONFIG_DISABLE_MOUNTPOINT=y)
|
||||
#endif
|
||||
|
||||
/* Definitions for include/nuttx/spi/spi_bitbang.c. */
|
||||
|
||||
#define SPI_SETSCK putreg32(1 << 27, SAM_PIOB_SODR)
|
||||
#define SPI_CLRSCK putreg32(1 << 27, SAM_PIOB_CODR)
|
||||
#define SPI_SETMOSI putreg32(1 << 7, SAM_PIOD_SODR)
|
||||
#define SPI_CLRMOSI putreg32(1 << 7, SAM_PIOD_CODR)
|
||||
#define SPI_GETMISO ((getreg32(SAM_PIOD_PDSR) >> 8) & 1)
|
||||
#define SPI_SETCS putreg32(1 << 28, SAM_PIOA_SODR)
|
||||
#define SPI_CLRCS putreg32(1 << 28, SAM_PIOA_CODR)
|
||||
|
||||
/* Only mode 0 */
|
||||
|
||||
#undef SPI_BITBANG_DISABLEMODE0
|
||||
#define SPI_BITBANG_DISABLEMODE1 1
|
||||
#define SPI_BITBANG_DISABLEMODE2 1
|
||||
#define SPI_BITBANG_DISABLEMODE3 1
|
||||
|
||||
/* Only 8-bit data width */
|
||||
|
||||
#undef SPI_BITBANG_VARWIDTH
|
||||
|
||||
/* Calibration value for timing loop */
|
||||
|
||||
#define SPI_BITBAND_LOOPSPERMSEC CONFIG_BOARD_LOOPSPERMSEC
|
||||
|
||||
/* SPI_PERBIT_NSEC is the minimum time to transfer one bit. This determines
|
||||
* the maximum frequency and is also used to calculate delays to achieve
|
||||
* other SPI frequencies.
|
||||
*/
|
||||
|
||||
#define SPI_PERBIT_NSEC 100
|
||||
|
||||
/* Misc definitions */
|
||||
|
||||
#define SAM34_MMCSDSLOTNO 0 /* There is only one slot */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_select(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid,
|
||||
bool selected);
|
||||
static uint8_t spi_status(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
static int spi_cmddata(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid,
|
||||
bool cmd);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
/****************************************************************************
|
||||
* Include the bit-band skeleton logic
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/spi/spi_bitbang.c>
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_select
|
||||
*
|
||||
* Description:
|
||||
* Select or de-selected the SPI device specified by 'devid'
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - An instance of the bit-bang driver structure
|
||||
* devid - The device to select or de-select
|
||||
* selected - True:select false:de-select
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_select(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid,
|
||||
bool selected)
|
||||
{
|
||||
if (devid == SPIDEV_MMCSD)
|
||||
{
|
||||
if (selected)
|
||||
{
|
||||
SPI_CLRCS;
|
||||
}
|
||||
else
|
||||
{
|
||||
SPI_SETCS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_status
|
||||
*
|
||||
* Description:
|
||||
* Return status of the SPI device specified by 'devid'
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - An instance of the bit-bang driver structure
|
||||
* devid - The device to select or de-select
|
||||
*
|
||||
* Returned Value:
|
||||
* An 8-bit, bit-encoded status byte
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint8_t spi_status(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid)
|
||||
{
|
||||
if (devid == SPIDEV_MMCSD)
|
||||
{
|
||||
return SPI_STATUS_PRESENT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_cmddata
|
||||
*
|
||||
* Description:
|
||||
* If there were was a CMD/DATA line, this function would manage it
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - An instance of the bit-bang driver structure
|
||||
* devid - The device to use
|
||||
* cmd - True=MCD false=DATA
|
||||
*
|
||||
* Returned Value:
|
||||
* OK
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
static int spi_cmddata(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid,
|
||||
bool cmd)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_mmcsd_spiinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the SPI bit-bang driver
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* A non-NULL reference to the SPI driver on success
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct spi_dev_s *sam_mmcsd_spiinitialize(void)
|
||||
{
|
||||
/* Initialize GPIOs */
|
||||
|
||||
sam_configgpio(GPIO_SD_SCK);
|
||||
sam_configgpio(GPIO_SD_MISO);
|
||||
sam_configgpio(GPIO_SD_MOSI);
|
||||
sam_configgpio(GPIO_SD_CS);
|
||||
|
||||
/* Create the SPI driver instance */
|
||||
|
||||
return spi_create_bitbang(&g_spiops);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_sdinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the SPI-based SD card.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
int sam_sdinitialize(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
int ret;
|
||||
|
||||
/* Get the SPI driver instance for the SD chip select */
|
||||
|
||||
fvdbg("Initializing bit bang SPI for the MMC/SD slot\n");
|
||||
|
||||
spi = sam_mmcsd_spiinitialize();
|
||||
if (!spi)
|
||||
{
|
||||
fdbg("Failed to bit bang SPI for the MMC/SD slot\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
fvdbg("Successfully initialized bit bang SPI for the MMC/SD slot\n");
|
||||
|
||||
/* Bind the SPI device for the chip select to the slot */
|
||||
|
||||
fvdbg("Binding bit bang SPI device to MMC/SD slot %d\n",
|
||||
SAM34_MMCSDSLOTNO);
|
||||
|
||||
ret = mmcsd_spislotinitialize(minor, SAM34_MMCSDSLOTNO, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
fdbg("Failed to bind bit bang SPI device to MMC/SD slot %d: %d\n",
|
||||
SAM34_MMCSDSLOTNO, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
fvdbg("Successfuly bound bit bang SPI device to MMC/SD slot %d\n",
|
||||
SAM34_MMCSDSLOTNO);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARDUINO_ITHEAD_TFT && CONFIG_SPI_BITBANG && CONFIG_MMC_SPI */
|
||||
@@ -1,102 +0,0 @@
|
||||
/****************************************************************************
|
||||
* config/arduino-due/src/sam_nsh.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include "arduino-due.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_MMCSD_SPI)
|
||||
/* Support for the SD card slot on the ITEAD TFT shield */
|
||||
/* Verify NSH PORT and SLOT settings */
|
||||
|
||||
# define SAM34_MMCSDSLOTNO 0 /* There is only one slot */
|
||||
|
||||
# if defined(CONFIG_NSH_MMCSDSLOTNO) && CONFIG_NSH_MMCSDSLOTNO != SAM34_MMCSDSLOTNO
|
||||
# error Only one MMC/SD slot: Slot 0 (CONFIG_NSH_MMCSDSLOTNO)
|
||||
# endif
|
||||
|
||||
/* Default MMC/SD minor number */
|
||||
|
||||
# ifndef CONFIG_NSH_MMCSDMINOR
|
||||
# define CONFIG_NSH_MMCSDMINOR 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_app_initialize
|
||||
*
|
||||
* Description:
|
||||
* Perform architecture specific initialization
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_app_initialize(void)
|
||||
{
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_MMCSD_SPI)
|
||||
/* Initialize the SPI-based MMC/SD slot */
|
||||
|
||||
{
|
||||
int ret = sam_sdinitialize(CONFIG_NSH_MMCSDMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR,
|
||||
"board_app_initialize: Failed to initialize MMC/SD slot: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -1,431 +0,0 @@
|
||||
/************************************************************************************
|
||||
* configs/sam3u-ek/src/up_touchscreen.c
|
||||
*
|
||||
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/spi/spi_bitbang.h>
|
||||
#include <nuttx/input/touchscreen.h>
|
||||
#include <nuttx/input/ads7843e.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "sam_gpio.h"
|
||||
#include "chip/sam3u_pio.h"
|
||||
|
||||
#include "arduino-due.h"
|
||||
|
||||
/* In order to use the SD card on the ITEAD shield, you must enable the SPI
|
||||
* bit-bang driver as well as support for SPI-based ADS7843E/XPT2046
|
||||
* touchscreen controller.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_INPUT_ADS7843E)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_SAM34_GPIOC_IRQ
|
||||
# error "Touchscreen support requires CONFIG_SAM34_GPIOC_IRQ"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ADS7843E_FREQUENCY
|
||||
# define CONFIG_ADS7843E_FREQUENCY 500000
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ADS7843E_SPIDEV
|
||||
# define CONFIG_ADS7843E_SPIDEV 0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_ADS7843E_DEVMINOR
|
||||
# define CONFIG_ADS7843E_DEVMINOR 0
|
||||
#endif
|
||||
|
||||
/* Definitions for include/nuttx/spi/spi_bitbang.c. */
|
||||
|
||||
#define SPI_SETSCK putreg32(1 << 24, SAM_PIOA_SODR)
|
||||
#define SPI_CLRSCK putreg32(1 << 24, SAM_PIOA_CODR)
|
||||
#define SPI_SETMOSI putreg32(1 << 16, SAM_PIOA_SODR)
|
||||
#define SPI_CLRMOSI putreg32(1 << 16, SAM_PIOA_CODR)
|
||||
#define SPI_GETMISO ((getreg32(SAM_PIOC_PDSR) >> 22) & 1)
|
||||
|
||||
/* Only mode 0 */
|
||||
|
||||
#undef SPI_BITBANG_DISABLEMODE0
|
||||
#define SPI_BITBANG_DISABLEMODE1 1
|
||||
#define SPI_BITBANG_DISABLEMODE2 1
|
||||
#define SPI_BITBANG_DISABLEMODE3 1
|
||||
|
||||
/* Only 8-bit data width */
|
||||
|
||||
#undef SPI_BITBANG_VARWIDTH
|
||||
|
||||
/* Calibration value for timing loop */
|
||||
|
||||
#define SPI_BITBAND_LOOPSPERMSEC CONFIG_BOARD_LOOPSPERMSEC
|
||||
|
||||
/* SPI_PERBIT_NSEC is the minimum time to transfer one bit. This determines
|
||||
* the maximum frequency and is also used to calculate delays to achieve
|
||||
* other SPI frequencies.
|
||||
*/
|
||||
|
||||
#define SPI_PERBIT_NSEC 100
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
/* Lower-half SPI */
|
||||
|
||||
static void spi_select(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid,
|
||||
bool selected);
|
||||
static uint8_t spi_status(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid);
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
static int spi_cmddata(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid,
|
||||
bool cmd);
|
||||
#endif
|
||||
|
||||
/* IRQ/GPIO access callbacks. These operations all hidden behind
|
||||
* callbacks to isolate the XPT2046 driver from differences in GPIO
|
||||
* interrupt handling by varying boards and MCUs. If possible,
|
||||
* interrupts should be configured on both rising and falling edges
|
||||
* so that contact and loss-of-contact events can be detected.
|
||||
*
|
||||
* attach - Attach the XPT2046 interrupt handler to the GPIO interrupt
|
||||
* enable - Enable or disable the GPIO interrupt
|
||||
* clear - Acknowledge/clear any pending GPIO interrupt
|
||||
* pendown - Return the state of the pen down GPIO input
|
||||
*/
|
||||
|
||||
static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr);
|
||||
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable);
|
||||
static void tsc_clear(FAR struct ads7843e_config_s *state);
|
||||
static bool tsc_busy(FAR struct ads7843e_config_s *state);
|
||||
static bool tsc_pendown(FAR struct ads7843e_config_s *state);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/* A reference to a structure of this type must be passed to the XPT2046
|
||||
* driver. This structure provides information about the configuration
|
||||
* of the XPT2046 and provides some board-specific hooks.
|
||||
*
|
||||
* Memory for this structure is provided by the caller. It is not copied
|
||||
* by the driver and is presumed to persist while the driver is active. The
|
||||
* memory must be writable because, under certain circumstances, the driver
|
||||
* may modify frequency or X plate resistance values.
|
||||
*/
|
||||
|
||||
static struct ads7843e_config_s g_tscinfo =
|
||||
{
|
||||
.frequency = CONFIG_ADS7843E_FREQUENCY,
|
||||
|
||||
.attach = tsc_attach,
|
||||
.enable = tsc_enable,
|
||||
.clear = tsc_clear,
|
||||
.busy = tsc_busy,
|
||||
.pendown = tsc_pendown,
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Include the bit-band skeleton logic
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/spi/spi_bitbang.c>
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_select
|
||||
*
|
||||
* Description:
|
||||
* Select or de-selected the SPI device specified by 'devid'
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - An instance of the bit-bang driver structure
|
||||
* devid - The device to select or de-select
|
||||
* selected - True:select false:de-select
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void spi_select(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid,
|
||||
bool selected)
|
||||
{
|
||||
/* The touchscreen controller is always selected */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_status
|
||||
*
|
||||
* Description:
|
||||
* Return status of the SPI device specified by 'devid'
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - An instance of the bit-bang driver structure
|
||||
* devid - The device to select or de-select
|
||||
*
|
||||
* Returned Value:
|
||||
* An 8-bit, bit-encoded status byte
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint8_t spi_status(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_cmddata
|
||||
*
|
||||
* Description:
|
||||
* If there were was a CMD/DATA line, this function would manage it
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - An instance of the bit-bang driver structure
|
||||
* devid - The device to use
|
||||
* cmd - True=MCD false=DATA
|
||||
*
|
||||
* Returned Value:
|
||||
* OK
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
static int spi_cmddata(FAR struct spi_bitbang_s *priv, enum spi_dev_e devid,
|
||||
bool cmd)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* IRQ/GPIO access callbacks. These operations all hidden behind
|
||||
* callbacks to isolate the XPT2046 driver from differences in GPIO
|
||||
* interrupt handling by varying boards and MCUs. If possible,
|
||||
* interrupts should be configured on both rising and falling edges
|
||||
* so that contact and loss-of-contact events can be detected.
|
||||
*
|
||||
* attach - Attach the XPT2046 interrupt handler to the GPIO interrupt
|
||||
* enable - Enable or disable the GPIO interrupt
|
||||
* clear - Acknowledge/clear any pending GPIO interrupt
|
||||
* pendown - Return the state of the pen down GPIO input
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int tsc_attach(FAR struct ads7843e_config_s *state, xcpt_t isr)
|
||||
{
|
||||
/* Attach the XPT2046 interrupt */
|
||||
|
||||
ivdbg("Attaching %p to IRQ %d\n", isr, SAM_TSC_IRQ);
|
||||
return irq_attach(SAM_TSC_IRQ, isr);
|
||||
}
|
||||
|
||||
static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
|
||||
{
|
||||
/* Attach and enable, or detach and disable */
|
||||
|
||||
ivdbg("IRQ:%d enable:%d\n", SAM_TSC_IRQ, enable);
|
||||
if (enable)
|
||||
{
|
||||
sam_gpioirqenable(SAM_TSC_IRQ);
|
||||
}
|
||||
else
|
||||
{
|
||||
sam_gpioirqdisable(SAM_TSC_IRQ);
|
||||
}
|
||||
}
|
||||
|
||||
static void tsc_clear(FAR struct ads7843e_config_s *state)
|
||||
{
|
||||
/* Does nothing */
|
||||
}
|
||||
|
||||
static bool tsc_busy(FAR struct ads7843e_config_s *state)
|
||||
{
|
||||
return false; /* The BUSY signal is not connected */
|
||||
}
|
||||
|
||||
static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
{
|
||||
/* The /PENIRQ value is active low */
|
||||
|
||||
bool pendown = !sam_gpioread(GPIO_TSC_IRQ);
|
||||
ivdbg("pendown:%d\n", pendown);
|
||||
return pendown;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_tsc_spiinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the SPI bit-bang driver
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* A non-NULL reference to the SPI driver on success
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static FAR struct spi_dev_s *sam_tsc_spiinitialize(void)
|
||||
{
|
||||
/* Configure the SPI bit-bang pins */
|
||||
|
||||
sam_configgpio(GPIO_TSC_SCK);
|
||||
sam_configgpio(GPIO_TSC_MISO);
|
||||
sam_configgpio(GPIO_TSC_MOSI);
|
||||
|
||||
/* Create the SPI driver instance */
|
||||
|
||||
return spi_create_bitbang(&g_spiops);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the touchscreen device. This function will register the driver
|
||||
* as /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
* returned to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
static bool initialized = false;
|
||||
int ret;
|
||||
|
||||
idbg("minor %d\n", minor);
|
||||
DEBUGASSERT(minor == 0);
|
||||
|
||||
/* Have we already initialized? Since we never uninitialize we must prevent
|
||||
* multiple initializations. This is necessary, for example, when the
|
||||
* touchscreen example is used as a built-in application in NSH and can be
|
||||
* called numerous time. It will attempt to initialize each time.
|
||||
*/
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
/* Configure and enable the XPT2046 interrupt pin as an input */
|
||||
|
||||
(void)sam_configgpio(GPIO_TSC_IRQ);
|
||||
|
||||
/* Configure the PIO interrupt */
|
||||
|
||||
sam_gpioirq(SAM_TSC_IRQ);
|
||||
|
||||
/* Get an instance of the SPI interface for the touchscreen chip select */
|
||||
|
||||
dev = sam_tsc_spiinitialize();
|
||||
if (!dev)
|
||||
{
|
||||
idbg("Failed to initialize bit bang SPI\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Initialize and register the SPI touschscreen device */
|
||||
|
||||
ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
idbg("Failed to register touchscreen device\n");
|
||||
/* up_spiuninitialize(dev); */
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now we are initialized */
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* No support for un-initializing the touchscreen XPT2046 device. It will
|
||||
* continue to run and process touch interrupts in the background.
|
||||
*/
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARDUINO_ITHEAD_TFT && CONFIG_SPI_BITBANG && CONFIG_INPUT_ADS7843E */
|
||||
@@ -1,151 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/arduino-due/src/sam_userleds.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "sam_gpio.h"
|
||||
#include "arduino-due.h"
|
||||
|
||||
#ifndef CONFIG_ARCH_LEDS
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* CONFIG_DEBUG_LEDS enables debug output from this file (needs CONFIG_DEBUG
|
||||
* with CONFIG_DEBUG_VERBOSE too)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_DEBUG_LEDS
|
||||
# define leddbg lldbg
|
||||
# define ledvdbg llvdbg
|
||||
#else
|
||||
# define leddbg(x...)
|
||||
# define ledvdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Protototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_ledinit
|
||||
****************************************************************************/
|
||||
|
||||
void sam_ledinit(void)
|
||||
{
|
||||
/* Configure LED1-2 GPIOs for output */
|
||||
|
||||
sam_configgpio(GPIO_LED_L);
|
||||
sam_configgpio(GPIO_LED_RX);
|
||||
sam_configgpio(GPIO_LED_TX);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_setled
|
||||
****************************************************************************/
|
||||
|
||||
void sam_setled(int led, bool ledon)
|
||||
{
|
||||
uint32_t ledcfg;
|
||||
|
||||
if (led == BOARD_LED_L)
|
||||
{
|
||||
ledcfg = GPIO_LED_RX;
|
||||
}
|
||||
else if (led == BOARD_LED_RX)
|
||||
{
|
||||
ledcfg = GPIO_LED_RX;
|
||||
ledon = !ledon;
|
||||
}
|
||||
else if (led == BOARD_LED_TX)
|
||||
{
|
||||
ledcfg = GPIO_LED_TX;
|
||||
ledon = !ledon;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sam_gpiowrite(ledcfg, ledon);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_setleds
|
||||
****************************************************************************/
|
||||
|
||||
void sam_setleds(uint8_t ledset)
|
||||
{
|
||||
bool ledon;
|
||||
|
||||
ledon = ((ledset & BOARD_LED_L_BIT) != 0);
|
||||
sam_gpiowrite(GPIO_LED_L, ledon);
|
||||
|
||||
ledon = ((ledset & BOARD_LED_RX_BIT) != 0);
|
||||
sam_gpiowrite(GPIO_LED_RX, ledon);
|
||||
|
||||
ledon = ((ledset & BOARD_LED_TX_BIT) != 0);
|
||||
sam_gpiowrite(GPIO_LED_TX, ledon);
|
||||
}
|
||||
|
||||
#endif /* !CONFIG_ARCH_LEDS */
|
||||
@@ -1,8 +0,0 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
if ARCH_BOARD_AVR32DEV1
|
||||
endif
|
||||
|
||||
@@ -1,477 +0,0 @@
|
||||
README
|
||||
^^^^^^
|
||||
|
||||
This is the README file for the NuttX port to the Atmel AVR32DEV1 board.
|
||||
|
||||
Contents
|
||||
^^^^^^^^
|
||||
|
||||
* GPIO Pin Configuration
|
||||
* Serial Connection
|
||||
* Toolchains
|
||||
* Development Environment
|
||||
* GNU Toolchains
|
||||
* IDEs
|
||||
- Makefile Build
|
||||
- Native Build
|
||||
* AVR32 Bootloader
|
||||
- Boot Sequence
|
||||
- Link Address
|
||||
- Entering the ISP
|
||||
- BatchISP
|
||||
* Reset
|
||||
* Make Tip
|
||||
* AVR32DEV1 Configuration Options
|
||||
* Configurations
|
||||
|
||||
GPIO Pin Configuration
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The only GPIO pin usage is for LEDs (2) and Buttons (2):
|
||||
|
||||
PIN 13 PA7 LED1
|
||||
PIN 14 PA8 LED2
|
||||
PIN 24 PB2 KEY1
|
||||
PIN 25 PB3 KEY2
|
||||
|
||||
(See configs/avr32dev/src/avr32dev_internal.h). And also for
|
||||
crystals (4), JTAG (1), and USB (1):
|
||||
|
||||
PIN 30 PA11 XIN32
|
||||
PIN 31 PA12 XOUT32
|
||||
PIN 35 PA15 EVTO (JTAG)
|
||||
PIN 39 PA18 X1IN
|
||||
PIN 40 PA19 X1OUT
|
||||
PIN 61 PA26 ID (USB)
|
||||
|
||||
All GPIO pins are brought out through connectors J1 (PINS 33-64)
|
||||
and J2 (PINS 1-32).
|
||||
|
||||
NOTE: There seems to be some difference in labeling for OSC0 and
|
||||
OSC1 between MCUZone.com and Atmel:
|
||||
|
||||
Oscillator pinout
|
||||
-------------------------- --------------------
|
||||
QFP48 QFP64 Pad Oscillator AVR32DEV1
|
||||
PIN PIN PIN LABEL
|
||||
----- ----- ---- --------- --------------------
|
||||
30 39 PA18 XIN0 X1IN (12MHz)
|
||||
41 PA28 XIN1 PA28 (no crystal)
|
||||
22 30 PA11 XIN32 XIN32 (32KHz)
|
||||
31 40 PA19 XOUT0 X1OUT (12Mhz)
|
||||
42 PA29 XOUT1 PA29 (no crystal)
|
||||
23 31 PA12 XOUT32 XOUT32 (32 Khz)
|
||||
----- ----- ---- --------- --------------------
|
||||
|
||||
NOTE 1: These crystal inputs/outputs are analog signals and my
|
||||
assumption is that they need no pin multiplexing setting to
|
||||
enable them for the external crystal function.
|
||||
|
||||
NOTE 2: There is no support for OSC1.
|
||||
|
||||
NOTE 3: There are solder pads for the 32KHz OSC32, but the
|
||||
crystal is not populated on my board. Therefore, the RTC will
|
||||
have to run from the (uncalibrated) RCOSC.
|
||||
|
||||
Serial Connection
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
USART1 is the default USART1 used in the configuration files to
|
||||
provide a serial console (of course, that can be easily changed
|
||||
by editting the configuration file). The AVR32DEV1 board has no
|
||||
RS-232 drivers or connectors on board. I use an off-board MAX232
|
||||
module that I got on eBay (search for MAX232 if you want to find
|
||||
one). I connect the MAX232 board as follows:
|
||||
|
||||
In configs/avr32dev/include/board.h:
|
||||
|
||||
#define PINMUX_USART1_RXD PINMUX_USART1_RXD_1
|
||||
#define PINMUX_USART1_TXD PINMUX_USART1_TXD_1
|
||||
|
||||
In arch/avr/src/at32uc3/at32uc3b_pinmux.h:
|
||||
|
||||
#define PINMUX_USART1_RXD_1 (GPIO_PERIPH | GPIO_FUNCD | GPIO_PORTA | 17)
|
||||
#define PINMUX_USART1_TXD_1 (GPIO_PERIPH | GPIO_FUNCA | GPIO_PORTA | 23)
|
||||
|
||||
PA17 and PA23 are avaiable from the AVR32DEV1:
|
||||
|
||||
FUNC GPIO PIN Header 16X2 (J1) MX232 Board
|
||||
---- ----- ----- ---------------- ------------
|
||||
RXD PA17 PIN37 Pin 5 PIN4 RXD (5V TTL/CMOS)
|
||||
TXD PA23 PIN47 Pin 15 PIN3 TXD (5V TTL/CMOS)
|
||||
PIN2 GND
|
||||
PIN1 VCC (5V)
|
||||
|
||||
Voltage on GPIO Pins with respect to Ground for TCK, RESET_N, PA03-PA08,
|
||||
PA11-PA12, PA18-PA19, PA28-PA31............................-0.3 to 3.6V
|
||||
Other Pins ............................................... -0.3 to 5.5V
|
||||
|
||||
I get the 5V from another USB port (using the 5V power cable that normally
|
||||
provides the extra current needed by my USB IDE drive).
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Linux, Mac OS X or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchains
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
Atmel Toolchain:
|
||||
|
||||
The build logic in these directories assume that you are using the GNU
|
||||
toolchain with the Atmel patches. The patch file, pre-patched tool
|
||||
sources,and pre-built binaries are available from the Atmel website.
|
||||
|
||||
CONFIG_AVR32_AVRTOOLSW=y # Use the windows version
|
||||
CONFIG_AVR32_AVRTOOLSL=y # Ue the Linux version
|
||||
|
||||
NOTE: The NuttX builtroot cannot be used to build the AVR32 toolchain.
|
||||
This is because the Atmel patches that add support for the AVR32 are not
|
||||
included in the NuttX buildroot.
|
||||
|
||||
WinAVR:
|
||||
|
||||
Another option for use under Windows is WinAVR:
|
||||
http://sourceforge.net/projects/winavr/files/. WinAVR includes the
|
||||
AVR32 toolchain as well as the AVR toolchain and various support
|
||||
libraries and header files.
|
||||
|
||||
AVR32 Toolchain Builder:
|
||||
|
||||
A third option is to build the toolchain yourself. For OS X and Linux systems,
|
||||
this Makefile will build a complete gcc-4.4.3 toolchain:
|
||||
|
||||
https://github.com/jsnyder/avr32-toolchain
|
||||
|
||||
By default the toolchain installs into ${HOME}/avr-32-tools-<somedate> and
|
||||
the bin subdirectory must be added to your path before compiling.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
Makefile Build
|
||||
--------------
|
||||
Under Eclipse, it is pretty easy to set up an "empty makefile project" and
|
||||
simply use the NuttX makefile to build the system. That is almost for free
|
||||
under Linux. Under Windows, you will need to set up the "Cygwin GCC" empty
|
||||
makefile project in order to work with Windows (Google for "Eclipse Cygwin" -
|
||||
there is a lot of help on the internet).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
Here are a few tips before you start that effort:
|
||||
|
||||
1) Select the toolchain that you will be using in your .config file
|
||||
2) Start the NuttX build at least one time from the Cygwin command line
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/avr/src/at32uc3,
|
||||
arch/avr/src/common, arch/arm/src/avr, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/avr/src/avr3/up_nommuhead.S.
|
||||
|
||||
AVR32 Bootloader
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Boot Sequence
|
||||
-------------
|
||||
|
||||
"An AVR UC3 part having the bootloader programmed resets as any other
|
||||
part at 80000000h. Bootloader execution begins here. The bootloader
|
||||
first performs the boot process to know whether it should start the
|
||||
USB DFU ISP or the application. If the tested conditions indicate
|
||||
that the USB DFU ISP should be started, then execution continues in
|
||||
the bootloader area, i.e. between 80000000h and 80002000h, else
|
||||
the bootloader launches the application at 80002000h."
|
||||
|
||||
Link Address
|
||||
------------
|
||||
|
||||
The linker scripts (ld.script) assume that you are using the DFU
|
||||
bootloader. The bootloader resides at 0x8000:0000 and so the ld.script
|
||||
files link the application to execute after the bootloader at
|
||||
0x8000:2000. To link so that NuttX boots directly without using the
|
||||
bootloader, change the flash definition from:
|
||||
|
||||
flash (rxai!w) : ORIGIN = 0x80002000, LENGTH = 256K - 8K
|
||||
|
||||
to:
|
||||
flash (rxai!w) : ORIGIN = 0x80000000, LENGTH = 256K
|
||||
|
||||
Or to use the MSC bootloader:
|
||||
|
||||
flash (rxai!w) : ORIGIN = 0x80008000, LENGTH = 256K - 32K
|
||||
|
||||
Entering the ISP
|
||||
----------------
|
||||
|
||||
In order to use the USB port to download the FLASH(ISP), you need to
|
||||
use the S3(PA13) to make CPU return to boot status. In this mode, the
|
||||
on chip bootloader will run, making the ISP possible.
|
||||
|
||||
BatchISP
|
||||
--------
|
||||
|
||||
Unlike other Atmel parts, the AVR32 will not work with the FLIP GUI
|
||||
program. Instead, you must use the command-line loader call BatchISP.
|
||||
If need to download FLIP from the atmel.com website, install the USB
|
||||
driver in the FLIP usb directory. Then in the bin directory where
|
||||
you installed FLIP, you will also find batchisp.exe.
|
||||
|
||||
NOTE: The AVR32DEV1 setenv.sh files will add the path to the BatchISP
|
||||
bin directory to the Cygwin PATH variable. If you use a different
|
||||
version of FLIP or if you install FLIP in a different location, you
|
||||
will need to modify the setenv.sh files.
|
||||
|
||||
Notes from "AVR32 UC3 USB DFU Bootloader" (doc7745.pdf)
|
||||
|
||||
"To launch BatchISP, open a command prompt. Windows or Cygwin command
|
||||
prompt can be used provided that the bin folder of the FLIP installation
|
||||
directory is in the PATH (Windows’ or Cygwin’s) environment variable.
|
||||
When running BatchISP on AT32UC3xxxxx, the target part has to be specified
|
||||
with -device at32uc3xxxxx and the communication port with -hardware usb.
|
||||
Commands can then be placed after -operation. These commands are executed
|
||||
in order. BatchISP options can be placed in a text file invoked using
|
||||
-cmdfile rather than on the command line.
|
||||
|
||||
"BatchISP works with an internal ISP buffer per target memory. These ISP
|
||||
buffers can be filled from several sources. All target operations (program,
|
||||
verify, read) are performed using these buffers."
|
||||
|
||||
The following BatchISP command line will erase FLASH, write the nuttx binary
|
||||
into FLASH, and reset the AVR32. This command line is available in the
|
||||
script config/avr32dev1/tools/doisp.sh:
|
||||
|
||||
batchisp -device at32uc3b0256 -hardware usb -operation erase f memory flash \
|
||||
blankcheck loadbuffer nuttx.elf program verify start reset 0
|
||||
|
||||
"BatchISP main commands available on AT32UC3xxxxx are:
|
||||
|
||||
- ASSERT { PASS | FAIL } changes the displayed results of the following
|
||||
operations according to the expected behavior.
|
||||
- ONFAIL { ASK | ABORT | RETRY | IGNORE } changes the interactive behavior
|
||||
of BatchISP in case of failure.
|
||||
- WAIT <Nsec> inserts a pause between two ISP operations.
|
||||
- ECHO <comment> displays a message.
|
||||
- ERASE F erases internal flash contents, except the bootloader.
|
||||
- MEMORY { FLASH | SECURITY | CONFIGURATION | BOOTLOADER | SIGNATURE | USER }
|
||||
selects a target memory on which to apply the following operations.
|
||||
- ADDRANGE <addrMin> <addrMax> selects in the current target memory an
|
||||
address range on which to apply the following operations.
|
||||
- BLANKCHECK checks that the selected address range is erased.
|
||||
- FILLBUFFER <data> fills the ISP buffer with a byte value.
|
||||
- LOADBUFFER { <in_elffile> | <in_hexfile> } loads the ISP buffer from an
|
||||
input file.
|
||||
- PROGRAM programs the selected address range with the ISP buffer.
|
||||
- VERIFY verifies that the selected address range has the same contents
|
||||
as the ISP buffer.
|
||||
- READ reads the selected address range to the ISP buffer.
|
||||
- SAVEBUFFER <out_hexfile> { HEX386 | HEX86 } saves the ISP buffer to an
|
||||
output file.
|
||||
- START { RESET | NORESET } 0 starts the execution of the programmed
|
||||
application with an optional hardware reset of the target.
|
||||
|
||||
"The AT32UC3xxxxx memories made available by BatchISP are:
|
||||
|
||||
- FLASH: This memory is the internal flash array of the target, including the
|
||||
bootloader protected area. E.g. on AT32UC3A0512 (512-kB internal flash),
|
||||
addresses from 0 to 0x7FFFF can be accessed in this memory.
|
||||
- SECURITY: This memory contains only one byte. The least significant bit
|
||||
of this byte reflects the value of the target Security bit which can only
|
||||
be set to 1. Once set, the only accepted commands will be ERASE and START.
|
||||
After an ERASE command, all commands are accepted until the end of the
|
||||
non-volatile ISP session, even if the Security bit is set.
|
||||
- CONFIGURATION: This memory contains one byte per target general-purpose
|
||||
fuse bit. The least significant bit of each byte reflects the value of
|
||||
the corresponding GP fuse bit.
|
||||
- BOOTLOADER: This memory contains three bytes concerning the ISP: the ISP
|
||||
version in BCD format without the major version number (always 1), the
|
||||
ISP ID0 and the ISP ID1.
|
||||
- SIGNATURE: This memory contains four bytes concerning the part: the product
|
||||
manufacturer ID, the product family ID, the product ID and the product
|
||||
revision.
|
||||
- USER: This memory is the internal flash User page of the target, with
|
||||
addresses from 0 to 0x1FF.
|
||||
|
||||
"For further details about BatchISP commands, launch batchisp -h or see the
|
||||
help files installed with FLIP ..."
|
||||
|
||||
Reset
|
||||
^^^^^
|
||||
|
||||
I don't trust the reset button -- if you reset and something weird happens,
|
||||
try a full power cycle.
|
||||
|
||||
Make Tip
|
||||
^^^^^^^^
|
||||
|
||||
Because this build uses a native Windows toolchain and the native Windows
|
||||
tools do not understand Cygwin's symbolic links, the NuttX make system does
|
||||
something weird: It copies the configuration directories instead of linking
|
||||
to them (it could, perhaps, use the NTFS 'mklink' command, but it doesn't).
|
||||
|
||||
A consequence of this is that you can easily get confused when you edit
|
||||
a file in one of the "linked" directories, re-build NuttX, and then not see your
|
||||
changes when you run the program. That is because build is still using the
|
||||
version of the file in the copied directory, not your modified file! To work
|
||||
around this annoying behavior, do the following when you re-build:
|
||||
|
||||
make clean_context all <-- Remove and re-copy all of the directories, then make all
|
||||
doisp.sh <-- Load the code onto the board.
|
||||
|
||||
AVR32DEV1 Configuration Options
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
||||
be set to:
|
||||
|
||||
CONFIG_ARCH=avr
|
||||
|
||||
CONFIG_ARCH_family - For use in C code:
|
||||
|
||||
CONFIG_ARCH_AVR=y
|
||||
|
||||
CONFIG_ARCH_architecture - For use in C code:
|
||||
|
||||
CONFIG_ARCH_FAMILY_AVR32=y
|
||||
|
||||
CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
|
||||
|
||||
CONFIG_ARCH_CHIP=at32uc3
|
||||
|
||||
CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
|
||||
chip:
|
||||
|
||||
CONFIG_ARCH_CHIP_AT32UC3B0256
|
||||
|
||||
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
|
||||
hence, the board that supports the particular chip or SoC.
|
||||
|
||||
CONFIG_ARCH_BOARD=avr32dev1 (for the AV32DEV1 board)
|
||||
|
||||
CONFIG_ARCH_BOARD_name - For use in C code
|
||||
|
||||
CONFIG_ARCH_BOARD_AVR32DEV1
|
||||
|
||||
CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
|
||||
of delay loops
|
||||
|
||||
CONFIG_ENDIAN_BIG - define if big endian (default is little
|
||||
endian)
|
||||
|
||||
CONFIG_RAM_SIZE - Describes the installed DRAM (SRAM in this case):
|
||||
|
||||
CONFIG_RAM_SIZE=0x00010000 (64Kb)
|
||||
|
||||
CONFIG_RAM_START - The start address of installed DRAM
|
||||
|
||||
CONFIG_RAM_START=0x20000000
|
||||
|
||||
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to boards that
|
||||
have LEDs
|
||||
|
||||
CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
|
||||
stack. If defined, this symbol is the size of the interrupt
|
||||
stack in bytes. If not defined, the user task stacks will be
|
||||
used during interrupt handling.
|
||||
|
||||
CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
|
||||
|
||||
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture.
|
||||
|
||||
CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that
|
||||
cause a 100 second delay during boot-up. This 100 second delay
|
||||
serves no purpose other than it allows you to calibratre
|
||||
CONFIG_ARCH_LOOPSPERMSEC. You simply use a stop watch to measure
|
||||
the 100 second delay then adjust CONFIG_ARCH_LOOPSPERMSEC until
|
||||
the delay actually is 100 seconds.
|
||||
|
||||
Individual subsystems can be enabled:
|
||||
|
||||
CONFIG_AVR32_GPIOIRQ - GPIO interrupt support
|
||||
CONFIG_AVR32_GPIOIRQSETA - Set of GPIOs on PORTA that support interrupts
|
||||
CONFIG_AVR32_GPIOIRQSETB - Set of GPIOs on PORTB that support interrupts
|
||||
|
||||
CONFIG_AVR32_USARTn - Enable support for USARTn
|
||||
CONFIG_AVR32_USARTn_RS232 - Configure USARTn as an RS232 interface.
|
||||
CONFIG_AVR32_USARTn_SPI - Configure USARTn as an SPI interface.
|
||||
CONFIG_AVR32_USARTn_RS485 - Configure USARTn as an RS485 interface.
|
||||
CONFIG_AVR32_USARTn_MAN - Configure USARTn as an Manchester interface.
|
||||
CONFIG_AVR32_USARTn_MODEM - Configure USARTn as an Modem interface.
|
||||
CONFIG_AVR32_USARTn_IRDA - Configure USARTn as an IRDA interface.
|
||||
CONFIG_AVR32_USARTn_ISO786 - Configure USARTn as an ISO786 interface.
|
||||
|
||||
AT32UC3B0256 specific device driver settings
|
||||
|
||||
CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the
|
||||
console and ttys0 (default is the USART0).
|
||||
CONFIG_USARTn_RXBUFSIZE - Characters are buffered as received.
|
||||
This specific the size of the receive buffer
|
||||
CONFIG_USARTn_TXBUFSIZE - Characters are buffered before
|
||||
being sent. This specific the size of the transmit buffer
|
||||
CONFIG_USARTn_BAUD - The configure BAUD of the USART. Must be
|
||||
CONFIG_USARTn_BITS - The number of bits. Must be either 7 or 8.
|
||||
CONFIG_USARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
|
||||
CONFIG_USARTn_2STOP - Two stop bits
|
||||
|
||||
Configurations
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
Common Configuration Notes
|
||||
--------------------------
|
||||
|
||||
1. Each Atmel AVR32DEV configuration is maintained in a sub-directory and
|
||||
can be selected as follow:
|
||||
|
||||
cd tools
|
||||
./configure.sh avr32dev1/<subdir>
|
||||
cd -
|
||||
. ./setenv.sh
|
||||
|
||||
Where <subdir> is one of the configuration sub-directories described in
|
||||
the following paragraph.
|
||||
|
||||
(Use configure.bat instead of configure.sh in a native Windows environment).
|
||||
|
||||
2. These configurations use the mconf-based configuration tool. To
|
||||
change a configurations using that tool, you should:
|
||||
|
||||
a. Build and install the kconfig-mconf tool. See nuttx/README.txt
|
||||
see additional README.txt files in the NuttX tools repository.
|
||||
|
||||
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
||||
reconfiguration process.
|
||||
|
||||
3. By default, all configurations assume the AVR toolchain under Cygwin
|
||||
with Windows. This is easily reconfigured:
|
||||
|
||||
CONFIG_HOST_WINDOWS=y
|
||||
CONFIG_WINDOWS_CYGWIN=y
|
||||
CONFIG_AVR32_AVRTOOLSW=y
|
||||
|
||||
Configuration Sub-Directories
|
||||
-----------------------------
|
||||
|
||||
nsh:
|
||||
|
||||
Configures the NuttShell (nsh) located at examples/nsh. The
|
||||
Configuration enables only the serial NSH interface.
|
||||
|
||||
ostest:
|
||||
|
||||
This configuration directory, performs a simple OS test using
|
||||
examples/ostest.
|
||||
|
||||
NOTE: Round-robin scheduling is disabled in this test because
|
||||
the RR test in examples/ostest declares data structures that
|
||||
are too large for the poor little uc3 SRAM.
|
||||
@@ -1,204 +0,0 @@
|
||||
/************************************************************************************
|
||||
* configs/avr32dev1/include/board.h
|
||||
*
|
||||
* Copyright (C) 2010-2011, 2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __CONFIGS_AVR32DEV1_INCLUDE_BOARD_H
|
||||
#define __CONFIGS_AVR32DEV1_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* Clocking *************************************************************************/
|
||||
/* Oscillator setup: RCOSC, OSC32, OSC0, OSC1. Only RCOSC, OSC0, or PLL0 can drive
|
||||
* the main clock.
|
||||
*/
|
||||
|
||||
/* The RCOSC frequency needs to be calibrated! */
|
||||
|
||||
#define AVR32_FRCOSC 115000 /* RCOSC frequency in Hz. 115KHz nominal */
|
||||
|
||||
#define AVR32_FOSC32 32768 /* OSC32 frequency in Hz */
|
||||
#define AVR32_OSC32STARTUP 3 /* OSC32 startup time in RCOSC periods */
|
||||
|
||||
#define AVR32_FOSC0 12000000 /* OSC0 frequency in Hz */
|
||||
#define AVR32_OSC0STARTUP 3 /* OSC0 startup time in RCOSC periods.
|
||||
|
||||
/* #define AVR32_FOSC1 12000000 OSC1 frequency: Hz.
|
||||
* #define AVR32_OSC1STARTUP 3 OSC1 startup time in RCOSC periods.
|
||||
*/
|
||||
|
||||
/* PLL setup
|
||||
*
|
||||
* FOSC0 MUL DIV PLL DIV2_EN CPU_CLOCK PBA_CLOCK COMMENT
|
||||
* (MHz) (MHz) (MHz) (MHz)
|
||||
* 12 15 1 192 1 12 12
|
||||
* 12 9 3 40 1 20 20 PLL out of spec
|
||||
* 12 15 1 192 1 24 12
|
||||
* 12 9 1 120 1 30 15
|
||||
* 12 9 3 40 0 40 20 PLL out of spec
|
||||
* 12 15 1 192 1 48 12
|
||||
* 12 15 1 192 1 48 24
|
||||
* 12 8 1 108 1 54 27
|
||||
* 12 9 1 120 1 60 15
|
||||
* 12 9 1 120 1 60 30
|
||||
* 12 10 1 132 1 66 16.5
|
||||
*/
|
||||
|
||||
#define AVR32_CLOCK_PLL0_OSC0 1
|
||||
#undef AVR32_CLOCK_PLL0_OSC1
|
||||
#define AVR32_PLL0_MUL 15
|
||||
#define AVR32_PLL0_DIV 1
|
||||
#define AVR32_PLL0_DIV2 1
|
||||
#define AVR32_PLL0_WBWM 0
|
||||
#define AVR32_PLL0_FREQ 192000000
|
||||
|
||||
/* Set PLL1 @ 96 MHz from OSC0: 12MHz*(7+1)/1 = 96MHz */
|
||||
|
||||
#define AVR32_CLOCK_PLL1_OSC0 1
|
||||
#undef AVR32_CLOCK_PLL1_OSC1
|
||||
#define AVR32_PLL1_MUL 7
|
||||
#define AVR32_PLL1_DIV 1
|
||||
#define AVR32_PLL1_DIV2 1
|
||||
#define AVR32_PLL1_WBWM 0
|
||||
#define AVR32_PLL1_FREQ 96000000
|
||||
|
||||
/* Clock divider setup */
|
||||
|
||||
#define AVR32_CKSEL_CPUDIV 0
|
||||
#define AVR32_CKSEL_HSBDIV 0
|
||||
#define AVR32_CKSEL_PBADIV 0
|
||||
#define AVR32_CKSEL_PBBDIV 0
|
||||
|
||||
/* GCLK_USBB */
|
||||
|
||||
#undef AVR32_CLOCK_USB_PLL0
|
||||
#define AVR32_CLOCK_USB_PLL1 1
|
||||
#undef AVR32_CLOCK_USB_OSC0
|
||||
#undef AVR32_CLOCK_USB_OSC1
|
||||
#define AVR32_CLOCK_USB_DIV 0
|
||||
|
||||
/* Main Clock settup: Select OSC0 as the main clock.
|
||||
*
|
||||
* - A 12Mhz crystal is provided on he board for OSC0.
|
||||
* - The AVR32DEV1 board has no support for OSC1.
|
||||
* - There are pads for he 32Khz OSC32, but it is not populated on the
|
||||
* board.
|
||||
*/
|
||||
|
||||
#define AVR32_CLOCK_OSC0 1
|
||||
#undef AVR32_CLOCK_OSC1 /* Not supported */
|
||||
#undef AVR32_CLOCK_OSC32 /* Not populated */
|
||||
#undef AVR32_CLOCK_PLL0
|
||||
#undef AVR32_CLOCK_PLL1
|
||||
|
||||
#define AVR32_CPU_CLOCK AVR32_FOSC0
|
||||
#define AVR32_PBA_CLOCK AVR32_FOSC0
|
||||
|
||||
/* Pin muliplexing selecion *********************************************************/
|
||||
|
||||
#define PINMUX_USART1_RXD PINMUX_USART1_RXD_1
|
||||
#define PINMUX_USART1_TXD PINMUX_USART1_TXD_1
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* The AVR32DEV1 board has 3 LEDs, two of which can be controlled through GPIO pins */
|
||||
|
||||
/* ON OFF */
|
||||
/* LED1 LED2 LED1 LED2 */
|
||||
#define LED_STARTED 0 /* OFF OFF OFF OFF */
|
||||
#define LED_HEAPALLOCATE 0 /* OFF OFF OFF OFF */
|
||||
#define LED_IRQSENABLED 0 /* OFF OFF OFF OFF */
|
||||
#define LED_STACKCREATED 1 /* ON OFF OFF OFF */
|
||||
#define LED_INIRQ 2 /* ON ON ON OFF */
|
||||
#define LED_SIGNAL 2 /* ON ON ON OFF */
|
||||
#define LED_ASSERTION 2 /* ON ON ON OFF */
|
||||
#define LED_PANIC 2 /* ON ON ON OFF */
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* The AVR32DEV1 board has 3 BUTTONs, two of which can be sensed through GPIO pins. */
|
||||
|
||||
#define BUTTON1 1 /* Bit 0: Button 1 */
|
||||
#define BUTTON2 2 /* Bit 1: Button 2 */
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/************************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
/************************************************************************************
|
||||
* Name: avr32_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All AVR32 architectures must provide the following entry point. This entry point
|
||||
* is called early in the intitialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void avr32_boardinitialize(void);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_AVR32DEV1_INCLUDE_BOARD_H */
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
############################################################################
|
||||
# configs/avr32dev1/nsh/Make.defs
|
||||
#
|
||||
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include ${TOPDIR}/.config
|
||||
include ${TOPDIR}/tools/Config.mk
|
||||
include ${TOPDIR}/arch/avr/src/avr32/Toolchain.defs
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
||||
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script}"
|
||||
else
|
||||
# Linux/Cygwin-native toolchain
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
||||
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
||||
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script
|
||||
endif
|
||||
|
||||
CC = $(CROSSDEV)gcc
|
||||
CXX = $(CROSSDEV)g++
|
||||
CPP = $(CROSSDEV)gcc -E
|
||||
LD = $(CROSSDEV)ld
|
||||
AR = $(CROSSDEV)ar rcs
|
||||
NM = $(CROSSDEV)nm
|
||||
OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
|
||||
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
ARCHOPTIMIZATION = -g
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += -Os -ffunction-sections -fdata-sections -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin -muse-rodata-section
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||
ARCHWARNINGSXX = -Wall -Wshadow
|
||||
ARCHDEFINES =
|
||||
ARCHNOPICFLAGS = -fno-pic
|
||||
ARCHPICFLAGS = -fpic
|
||||
ARCHALLCFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
ARCHALLCXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
|
||||
CFLAGS = $(ARCHNOPICFLAGS) $(ARCHALLCFLAGS)
|
||||
CPICFLAGS = $(ARCHPICFLAGS) $(ARCHALLCFLAGS)
|
||||
CXXFLAGS = $(ARCHNOPICFLAGS) $(ARCHALLCXXFLAGS)
|
||||
CXXPICFLAGS = $(ARCHPICFLAGS) $(ARCHALLCXXFLAGS)
|
||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||
AFLAGS = $(ARCHALLCFLAGS) -D__ASSEMBLY__
|
||||
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
EXEEXT =
|
||||
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,105 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/avr32dev1/nsh/ld.script
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
|
||||
OUTPUT_ARCH(avr32:uc)
|
||||
ENTRY(_stext)
|
||||
|
||||
/* The following assumes that the bootloader resides at 0x8000:0000 and so
|
||||
* links the application to execute after the bootloader at 0x8000:2000.
|
||||
* To link so that NuttX boots directly without using the bootloader,
|
||||
* change the flash definition to:
|
||||
*
|
||||
* flash (rxai!w) : ORIGIN = 0x80000000, LENGTH = 256K
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rxai!w) : ORIGIN = 0x80002000, LENGTH = 256K - 8K
|
||||
intram (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 32K
|
||||
userpage : ORIGIN = 0x80800000, LENGTH = 512
|
||||
factorypage : ORIGIN = 0x80800200, LENGTH = 512
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
_stext = ABSOLUTE(.);
|
||||
*(.vectors)
|
||||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.got)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.r.*)
|
||||
_etext = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
_eronly = ABSOLUTE(.); /* See below */
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > intram AT > flash
|
||||
|
||||
.bss : { /* BSS */
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > intram
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
}
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/bash
|
||||
# configs/avr32dev1/nsh/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if [ "$(basename $0)" = "setenv.sh" ] ; then
|
||||
echo "You must source this script, not run it!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# This PATH setup assumes that you are using versin 2.1.4 of the Atmel
|
||||
# AVR GNU tools installed at the default location on Windows. NOTE
|
||||
# that the path is in appended to the end of the PATH variable; this is
|
||||
# because there are also many GNUWin32 binaries there that conflict with
|
||||
# Cygwin versions.
|
||||
#
|
||||
|
||||
if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi
|
||||
|
||||
WD=`pwd`
|
||||
|
||||
export AVR32_BIN="/cygdrive/c/Program Files/Atmel/AVR Tools/AVR32 Toolchain/bin/"
|
||||
export FLIP_BIN="/cygdrive/c/Program Files/Atmel/Flip 3.4.2/bin"
|
||||
export AVR32DEV1_BIN="${WD}/configs/avr32dev1/tools"
|
||||
export PATH="${FLIP_BIN}:${AVR32DEV1_BIN}:/sbin:/usr/sbin:${PATH_ORIG}:${AVR32_BIN}"
|
||||
|
||||
echo "PATH : ${PATH}"
|
||||
@@ -1,120 +0,0 @@
|
||||
############################################################################
|
||||
# configs/avr32dev1/ostest/Make.defs
|
||||
#
|
||||
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include ${TOPDIR}/.config
|
||||
include ${TOPDIR}/tools/Config.mk
|
||||
include ${TOPDIR}/arch/avr/src/avr32/Toolchain.defs
|
||||
|
||||
# Setup for the selected toolchain
|
||||
|
||||
ifeq ($(CONFIG_AVR32_AVRTOOLSW),y)
|
||||
# AVR Tools under Windows
|
||||
CROSSDEV = avr32-
|
||||
WINTOOL = y
|
||||
ARCHCPUFLAGS = -mpart=uc3b0256
|
||||
endif
|
||||
ifeq ($(CONFIG_AVR32_AVRTOOLSL),y)
|
||||
# AVR Tools under Linux
|
||||
CROSSDEV = avr32-
|
||||
ARCHCPUFLAGS = -mpart=uc3b0256
|
||||
endif
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
||||
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
|
||||
else
|
||||
# Linux/Cygwin-native toolchain
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
||||
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
||||
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
|
||||
endif
|
||||
|
||||
CC = $(CROSSDEV)gcc
|
||||
CXX = $(CROSSDEV)g++
|
||||
CPP = $(CROSSDEV)gcc -E
|
||||
LD = $(CROSSDEV)ld
|
||||
AR = $(CROSSDEV)ar rcs
|
||||
NM = $(CROSSDEV)nm
|
||||
OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
|
||||
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
ARCHOPTIMIZATION = -g
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += -Os -ffunction-sections -fdata-sections -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin -muse-rodata-section
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||
ARCHWARNINGSXX = -Wall -Wshadow
|
||||
ARCHDEFINES =
|
||||
ARCHNOPICFLAGS = -fno-pic
|
||||
ARCHPICFLAGS = -fpic
|
||||
ARCHALLCFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
ARCHALLCXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
|
||||
CFLAGS = $(ARCHNOPICFLAGS) $(ARCHALLCFLAGS)
|
||||
CPICFLAGS = $(ARCHPICFLAGS) $(ARCHALLCFLAGS)
|
||||
CXXFLAGS = $(ARCHNOPICFLAGS) $(ARCHALLCXXFLAGS)
|
||||
CXXPICFLAGS = $(ARCHPICFLAGS) $(ARCHALLCXXFLAGS)
|
||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||
AFLAGS = $(ARCHALLCFLAGS) -D__ASSEMBLY__
|
||||
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
EXEEXT =
|
||||
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,105 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/avr32dev1/ostest/ld.script
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
|
||||
OUTPUT_ARCH(avr32:uc)
|
||||
ENTRY(_stext)
|
||||
|
||||
/* The following assumes that the bootloader resides at 0x8000:0000 and so
|
||||
* links the application to execute after the bootloader at 0x8000:2000.
|
||||
* To link so that NuttX boots directly without using the bootloader,
|
||||
* change the flash definition to:
|
||||
*
|
||||
* flash (rxai!w) : ORIGIN = 0x80000000, LENGTH = 256K
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rxai!w) : ORIGIN = 0x80002000, LENGTH = 256K - 8K
|
||||
intram (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 32K
|
||||
userpage : ORIGIN = 0x80800000, LENGTH = 512
|
||||
factorypage : ORIGIN = 0x80800200, LENGTH = 512
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
_stext = ABSOLUTE(.);
|
||||
*(.vectors)
|
||||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.got)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.r.*)
|
||||
_etext = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
_eronly = ABSOLUTE(.); /* See below */
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > intram AT > flash
|
||||
|
||||
.bss : { /* BSS */
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > intram
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
}
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/bash
|
||||
# configs/avr32dev1/ostest/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if [ "$(basename $0)" = "setenv.sh" ] ; then
|
||||
echo "You must source this script, not run it!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# This PATH setup assumes that you are using versin 2.1.4 of the Atmel
|
||||
# AVR GNU tools installed at the default location on Windows. NOTE
|
||||
# that the path is in appended to the end of the PATH variable; this is
|
||||
# because there are also many GNUWin32 binaries there that conflict with
|
||||
# Cygwin versions.
|
||||
#
|
||||
|
||||
if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi
|
||||
|
||||
WD=`pwd`
|
||||
|
||||
export AVR32_BIN="/cygdrive/c/Program Files/Atmel/AVR Tools/AVR32 Toolchain/bin/"
|
||||
export FLIP_BIN="/cygdrive/c/Program Files/Atmel/Flip 3.4.2/bin"
|
||||
export AVR32DEV1_BIN="${WD}/configs/avr32dev1/tools"
|
||||
export PATH="${FLIP_BIN}:${AVR32DEV1_BIN}:/sbin:/usr/sbin:${PATH_ORIG}:${AVR32_BIN}"
|
||||
|
||||
echo "PATH : ${PATH}"
|
||||
@@ -1,404 +0,0 @@
|
||||
examples/ostest output as of November 4, 2010
|
||||
=============================================
|
||||
|
||||
stdio_test: write fd=1
|
||||
stdio_test: write fd=2
|
||||
stdio_test: Standard I/O Check: printf
|
||||
user_start: Started user_main at PID=2
|
||||
user_start: Exitting
|
||||
stdio_test: Standard I/O Check: fprintf to stderr
|
||||
|
||||
user_main: Begin argument test
|
||||
user_main: Started with argc=5
|
||||
user_main: argv[0]="<noname>"
|
||||
user_main: argv[1]="Arg1"
|
||||
user_main: argv[2]="Arg2"
|
||||
user_main: argv[3]="Arg3"
|
||||
user_main: argv[4]="Arg4"
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: /dev/null test
|
||||
dev_null: Read 0 bytes from /dev/null
|
||||
dev_null: Wrote 1024 bytes to /dev/null
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: mutex test
|
||||
Initializing mutex
|
||||
Starting thread 1
|
||||
Starting thread 2
|
||||
Thread1 Thread2
|
||||
Loops 32 32
|
||||
Errors 0 0
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: cancel test
|
||||
cancel_test: Test 1: Normal Cancelation
|
||||
cancel_test: Starting thread
|
||||
start_thread: Initializing mutex
|
||||
start_thread: Initializing cond
|
||||
start_thread: Starting thread
|
||||
thread_waiter: Taking mutex
|
||||
thread_waiter: Starting wait for condition
|
||||
start_thread: Yielding
|
||||
cancel_test: Canceling thread
|
||||
cancel_test: Joining
|
||||
cancel_test: waiter exited with result=ffffffff
|
||||
cancel_test: PASS thread terminated with PTHREAD_CANCELED
|
||||
cancel_test: Test 2: Cancelation of detached thread
|
||||
cancel_test: Re-starting thread
|
||||
restart_thread: Destroying cond
|
||||
restart_thread: Destroying mutex
|
||||
restart_thread: Re-starting thread
|
||||
start_thread: Initializing mutex
|
||||
start_thread: Initializing cond
|
||||
start_thread: Starting thread
|
||||
thread_waiter: Taking mutex
|
||||
thread_waiter: Starting wait for condition
|
||||
start_thread: Yielding
|
||||
cancel_test: Canceling thread
|
||||
cancel_test: Joining
|
||||
cancel_test: PASS pthread_join failed with status=ESRCH
|
||||
cancel_test: Test 3: Non-cancelable threads
|
||||
cancel_test: Re-starting thread (non-cancelable)
|
||||
restart_thread: Destroying cond
|
||||
restart_thread: Destroying mutex
|
||||
restart_thread: Re-starting thread
|
||||
start_thread: Initializing mutex
|
||||
start_thread: Initializing cond
|
||||
start_thread: Starting thread
|
||||
thread_waiter: Taking mutex
|
||||
thread_waiter: Starting wait for condition
|
||||
thread_waiter: Setting non-cancelable
|
||||
start_thread: Yielding
|
||||
cancel_test: Canceling thread
|
||||
cancel_test: Joining
|
||||
thread_waiter: Releasing mutex
|
||||
thread_waiter: Setting cancelable
|
||||
cancel_test: waiter exited with result=ffffffff
|
||||
cancel_test: PASS thread terminated with PTHREAD_CANCELED
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: semaphore test
|
||||
sem_test: Initializing semaphore to 0
|
||||
sem_test: Starting waiter thread 1
|
||||
sem_test: Set thread 1 priority to 191
|
||||
waiter_func: Thread 1 Started
|
||||
waiter_func: Thread 1 initial semaphore value = 0
|
||||
waiter_func: Thread 1 waiting on semaphore
|
||||
sem_test: Starting waiter thread 2
|
||||
sem_test: Set thread 2 priority to 128
|
||||
waiter_func: Thread 2 Started
|
||||
waiter_func: Thread 2 initial semaphore value = -1
|
||||
waiter_func: Thread 2 waiting on semaphore
|
||||
sem_test: Starting poster thread 3
|
||||
sem_test: Set thread 3 priority to 64
|
||||
poster_func: Thread 3 started
|
||||
poster_func: Thread 3 semaphore value = -2
|
||||
poster_func: Thread 3 posting semaphore
|
||||
waiter_func: Thread 1 awakened
|
||||
waiter_func: Thread 1 new semaphore value = -1
|
||||
waiter_func: Thread 1 done
|
||||
poster_func: Thread 3 new semaphore value = -1
|
||||
poster_func: Thread 3 semaphore value = -1
|
||||
poster_func: Thread 3 posting semaphore
|
||||
waiter_func: Thread 2 awakened
|
||||
waiter_func: Thread 2 new semaphore value = 0
|
||||
waiter_func: Thread 2 done
|
||||
poster_func: Thread 3 new semaphore value = 0
|
||||
poster_func: Thread 3 done
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: condition variable test
|
||||
cond_test: Initializing mutex
|
||||
cond_test: Initializing cond
|
||||
cond_test: Starting waiter
|
||||
cond_test: Set thread 1 priority to 128
|
||||
waiter_thread: Started
|
||||
cond_test: Starting signaler
|
||||
cond_test: Set thread 2 priority to 64
|
||||
thread_signaler: Started
|
||||
thread_signaler: Terminating
|
||||
cond_test: signaler terminated, now cancel the waiter
|
||||
cond_test: Waiter Signaler
|
||||
cond_test: Loops 32 32
|
||||
cond_test: Errors 0 0
|
||||
cond_test:
|
||||
cond_test: 0 times, waiter did not have to wait for data
|
||||
cond_test: 0 times, data was already available when the signaler run
|
||||
cond_test: 0 times, the waiter was in an unexpected state when the signaler ran
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: timed wait test
|
||||
thread_waiter: Initializing mutex
|
||||
timedwait_test: Initializing cond
|
||||
timedwait_test: Starting waiter
|
||||
timedwait_test: Set thread 2 priority to 177
|
||||
thread_waiter: Taking mutex
|
||||
thread_waiter: Starting 5 second wait for condition
|
||||
timedwait_test: Joining
|
||||
thread_waiter: pthread_cond_timedwait timed out
|
||||
thread_waiter: Releasing mutex
|
||||
thread_waiter: Exit with status 0x12345678
|
||||
timedwait_test: waiter exited with result=12345678
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: message queue test
|
||||
mqueue_test: Starting receiver
|
||||
mqueue_test: Set receiver priority to 128
|
||||
receiver_thread: Starting
|
||||
mqueue_test: Starting sender
|
||||
mqueue_test: Set sender thread priority to 64
|
||||
mqueue_test: Waiting for sender to complete
|
||||
sender_thread: Starting
|
||||
receiver_thread: mq_receive succeeded on msg 0
|
||||
sender_thread: mq_send succeeded on msg 0
|
||||
receiver_thread: mq_receive succeeded on msg 1
|
||||
sender_thread: mq_send succeeded on msg 1
|
||||
receiver_thread: mq_receive succeeded on msg 2
|
||||
sender_thread: mq_send succeeded on msg 2
|
||||
receiver_thread: mq_receive succeeded on msg 3
|
||||
sender_thread: mq_send succeeded on msg 3
|
||||
receiver_thread: mq_receive succeeded on msg 4
|
||||
sender_thread: mq_send succeeded on msg 4
|
||||
receiver_thread: mq_receive succeeded on msg 5
|
||||
sender_thread: mq_send succeeded on msg 5
|
||||
receiver_thread: mq_receive succeeded on msg 6
|
||||
sender_thread: mq_send succeeded on msg 6
|
||||
receiver_thread: mq_receive succeeded on msg 7
|
||||
sender_thread: mq_send succeeded on msg 7
|
||||
receiver_thread: mq_receive succeeded on msg 8
|
||||
sender_thread: mq_send succeeded on msg 8
|
||||
receiver_thread: mq_receive succeeded on msg 9
|
||||
sender_thread: mq_send succeeded on msg 9
|
||||
sender_thread: returning nerrors=0
|
||||
mqueue_test: Killing receiver
|
||||
receiver_thread: mq_receive interrupted!
|
||||
receiver_thread: returning nerrors=0
|
||||
mqueue_test: Canceling receiver
|
||||
mqueue_test: receiver has already terminated
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: timed message queue test
|
||||
timedmqueue_test: Starting sender
|
||||
sender_thread: Starting
|
||||
sender_thread: mq_timedsend succeeded on msg 0
|
||||
sender_thread: mq_timedsend succeeded on msg 1
|
||||
sender_thread: mq_timedsend succeeded on msg 2
|
||||
sender_thread: mq_timedsend succeeded on msg 3
|
||||
sender_thread: mq_timedsend succeeded on msg 4
|
||||
sender_thread: mq_timedsend succeeded on msg 5
|
||||
sender_thread: mq_timedsend succeeded on msg 6
|
||||
sender_thread: mq_timedsend succeeded on msg 7
|
||||
sender_thread: mq_timedsend succeeded on msg 8
|
||||
timedmqueue_test: Waiting for sender to complete
|
||||
sender_thread: mq_timedsend 9 timed out as expected
|
||||
sender_thread: returning nerrors=0
|
||||
timedmqueue_test: Starting receiver
|
||||
receiver_thread: Starting
|
||||
receiver_thread: mq_timedreceive succeeded on msg 0
|
||||
receiver_thread: mq_timedreceive succeeded on msg 1
|
||||
receiver_thread: mq_timedreceive succeeded on msg 2
|
||||
receiver_thread: mq_timedreceive succeeded on msg 3
|
||||
receiver_thread: mq_timedreceive succeeded on msg 4
|
||||
receiver_thread: mq_timedreceive succeeded on msg 5
|
||||
receiver_thread: mq_timedreceive succeeded on msg 6
|
||||
receiver_thread: mq_timedreceive succeeded on msg 7
|
||||
receiver_thread: mq_timedreceive succeeded on msg 8
|
||||
timedmqueue_test: Waiting for receiver to complete
|
||||
receiver_thread: Receive 9 timed out as expected
|
||||
receiver_thread: returning nerrors=0
|
||||
timedmqueue_test: Test complete
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: signal handler test
|
||||
sighand_test: Initializing semaphore to 0
|
||||
sighand_test: Starting waiter task
|
||||
sighand_test: Started waiter_main pid=20
|
||||
waiter_main: Waiter started
|
||||
waiter_main: Unmasking signal 17
|
||||
waiter_main: Registering signal handler
|
||||
waiter_main: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
|
||||
waiter_main: Waiting on semaphore
|
||||
sighand_test: Signaling pid=20 with signo=17 sigvalue=42
|
||||
wakeup_action: Received signal 17
|
||||
wakeup_action: sival_int=42
|
||||
wakeup_action: si_code=1
|
||||
wakeup_action: ucontext=0
|
||||
waiter_main: sem_wait() successfully interrupted by signal
|
||||
waiter_main: done
|
||||
sighand_test: done
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: POSIX timer test
|
||||
timer_test: Initializing semaphore to 0
|
||||
timer_test: Unmasking signal 17
|
||||
timer_test: Registering signal handler
|
||||
timer_test: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
|
||||
timer_test: Creating timer
|
||||
timer_test: Starting timer
|
||||
timer_test: Waiting on semaphore
|
||||
timer_expiration: Received signal 17
|
||||
timer_expiration: sival_int=42
|
||||
timer_expiration: si_code=2 (SI_TIMER)
|
||||
timer_expiration: ucontext=0
|
||||
timer_test: sem_wait() successfully interrupted by signal
|
||||
timer_test: g_nsigreceived=1
|
||||
timer_test: Waiting on semaphore
|
||||
timer_expiration: Received signal 17
|
||||
timer_expiration: sival_int=42
|
||||
timer_expiration: si_code=2 (SI_TIMER)
|
||||
timer_expiration: ucontext=0
|
||||
timer_test: sem_wait() successfully interrupted by signal
|
||||
timer_test: g_nsigreceived=2
|
||||
timer_test: Waiting on semaphore
|
||||
timer_expiration: Received signal 17
|
||||
timer_expiration: sival_int=42
|
||||
timer_expiration: si_code=2 (SI_TIMER)
|
||||
timer_expiration: ucontext=0
|
||||
timer_test: sem_wait() successfully interrupted by signal
|
||||
timer_test: g_nsigreceived=3
|
||||
timer_test: Waiting on semaphore
|
||||
timer_expiration: Received signal 17
|
||||
timer_expiration: sival_int=42
|
||||
timer_expiration: si_code=2 (SI_TIMER)
|
||||
timer_expiration: ucontext=0
|
||||
timer_test: sem_wait() successfully interrupted by signal
|
||||
timer_test: g_nsigreceived=4
|
||||
timer_test: Waiting on semaphore
|
||||
timer_expiration: Received signal 17
|
||||
timer_expiration: sival_int=42
|
||||
timer_expiration: si_code=2 (SI_TIMER)
|
||||
timer_expiration: ucontext=0
|
||||
timer_test: sem_wait() successfully interrupted by signal
|
||||
timer_test: g_nsigreceived=5
|
||||
timer_test: Deleting timer
|
||||
timer_test: done
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
user_main: barrier test
|
||||
barrier_test: Initializing barrier
|
||||
barrier_func: Thread 0 started
|
||||
barrier_test: Thread 0 created
|
||||
barrier_func: Thread 1 started
|
||||
barrier_test: Thread 1 created
|
||||
barrier_func: Thread 2 started
|
||||
barrier_test: Thread 2 created
|
||||
barrier_func: Thread 0 calling pthread_barrier_wait()
|
||||
barrier_func: Thread 1 calling pthread_barrier_wait()
|
||||
barrier_func: Thread 2 calling pthread_barrier_wait()
|
||||
barrier_func: Thread 2, back with status=PTHREAD_BARRIER_SERIAL_THREAD (I AM SPECIAL)
|
||||
barrier_func: Thread 0, back with status=0 (I am not special)
|
||||
barrier_func: Thread 1, back with status=0 (I am not special)
|
||||
barrier_func: Thread 2 done
|
||||
barrier_func: Thread 0 done
|
||||
barrier_func: Thread 1 done
|
||||
barrier_test: Thread 0 completed with result=0
|
||||
barrier_test: Thread 1 completed with result=0
|
||||
barrier_test: Thread 2 completed with result=0
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
|
||||
Final memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 71a0 71a0
|
||||
ordblks 2 2
|
||||
mxordblk 4a80 4a80
|
||||
uordblks 1900 1900
|
||||
fordblks 58a0 58a0
|
||||
user_main: Exitting
|
||||
@@ -1,2 +0,0 @@
|
||||
/.depend
|
||||
/Make.dep
|
||||
@@ -1,90 +0,0 @@
|
||||
############################################################################
|
||||
# configs/avr32dev1/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
CFLAGS += -I$(TOPDIR)/sched
|
||||
|
||||
ASRCS =
|
||||
CSRCS = avr32_boot.c
|
||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
||||
CSRCS += avr32_leds.c
|
||||
endif
|
||||
ifeq ($(CONFIG_ARCH_BUTTONS),y)
|
||||
CSRCS += avr32_buttons.c
|
||||
endif
|
||||
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
|
||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||
ifeq ($(WINTOOL),y)
|
||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/avr32}"
|
||||
else
|
||||
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/avr32
|
||||
endif
|
||||
|
||||
all: libboard$(LIBEXT)
|
||||
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
libboard$(LIBEXT): $(OBJS)
|
||||
$(call ARCHIVE, $@, $(OBJS))
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
$(Q) touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
$(call DELFILE, libboard$(LIBEXT))
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
$(call DELFILE, Make.dep)
|
||||
$(call DELFILE, .depend)
|
||||
|
||||
-include Make.dep
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/************************************************************************************
|
||||
* configs/avr32dev1/src/avr32_boot.c
|
||||
*
|
||||
* Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
#include "at32uc3_internal.h"
|
||||
#include "avr32dev1_internal.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: at32uc3_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All AVR32 AT32UC3 architectures must provide the following entry point. This
|
||||
* entry point is called early in the initialization -- after all memory has been
|
||||
* configured and mapped but before any devices have been initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
void at32uc3_boardinitialize(void)
|
||||
{
|
||||
/* Configure SPI chip selects */
|
||||
|
||||
/* Configure on-board LEDs if LED support has been selected. */
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
board_led_initializeialize();
|
||||
#endif
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/avr32dev1/src/avr32_buttons.c
|
||||
*
|
||||
* Copyright (C) 2010-2011, 2014-2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include "at32uc3_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "at32uc3_internal.h"
|
||||
#include "avr32dev1_internal.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_BUTTONS
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_button_irqx
|
||||
*
|
||||
* Description:
|
||||
* This function implements the core of the board_button_irq() logic.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_AVR32_GPIOIRQ) && defined(CONFIG_ARCH_IRQBUTTONS) && \
|
||||
(defined(CONFIG_AVR32DEV_BUTTON1_IRQ) || defined(CONFIG_AVR32DEV_BUTTON2_IRQ))
|
||||
static xcpt_t board_button_irqx(int irq, xcpt_t irqhandler)
|
||||
{
|
||||
xcpt_t oldhandler;
|
||||
|
||||
/* Attach the handler */
|
||||
|
||||
gpio_irqattach(irq, irqhandler, &oldhandler);
|
||||
|
||||
/* Enable/disable the interrupt */
|
||||
|
||||
if (irqhandler)
|
||||
{
|
||||
gpio_irqenable(irq);
|
||||
}
|
||||
else
|
||||
{
|
||||
gpio_irqdisable(irq);
|
||||
}
|
||||
|
||||
/* Return the old button handler (so that it can be restored) */
|
||||
|
||||
return oldhandler;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_button_initialize
|
||||
*
|
||||
* Description:
|
||||
* board_button_initialize() must be called to initialize button resources.
|
||||
* After that, board_buttons() may be called to collect the current state of
|
||||
* all buttons or board_button_irq() may be called to register button interrupt
|
||||
* handlers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_button_initialize(void)
|
||||
{
|
||||
(void)at32uc3_configgpio(PINMUX_GPIO_BUTTON1);
|
||||
(void)at32uc3_configgpio(PINMUX_GPIO_BUTTON2);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_buttons
|
||||
*
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions in the board.h header file for the meaning of each bit in
|
||||
* the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint8_t board_buttons(void)
|
||||
{
|
||||
uint8_t retval;
|
||||
|
||||
retval = at32uc3_gpioread(PINMUX_GPIO_BUTTON1) ? 0 : BUTTON1;
|
||||
retval |= at32uc3_gpioread(PINMUX_GPIO_BUTTON2) ? 0 : BUTTON2;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_button_irq
|
||||
*
|
||||
* Description:
|
||||
* This function may be called to register an interrupt handler that will
|
||||
* be called when a button is depressed or released. The ID value is one
|
||||
* of the BUTTON* definitions provided above. The previous interrupt
|
||||
* handler address isreturned (so that it may restored, if so desired).
|
||||
*
|
||||
* Configuration Notes:
|
||||
* Configuration CONFIG_AVR32_GPIOIRQ must be selected to enable the
|
||||
* overall GPIO IRQ feature and CONFIG_AVR32_GPIOIRQSETA and/or
|
||||
* CONFIG_AVR32_GPIOIRQSETB must be enabled to select GPIOs to support
|
||||
* interrupts on. For button support, bits 2 and 3 must be set in
|
||||
* CONFIG_AVR32_GPIOIRQSETB (PB2 and PB3).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_AVR32_GPIOIRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
|
||||
xcpt_t board_button_irq(int id, xcpt_t irqhandler)
|
||||
{
|
||||
#ifdef CONFIG_AVR32DEV_BUTTON1_IRQ
|
||||
if (id == BUTTON1)
|
||||
{
|
||||
return board_button_irqx(GPIO_BUTTON1_IRQ, irqhandler);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef CONFIG_AVR32DEV_BUTTON2_IRQ
|
||||
if (id == BUTTON2)
|
||||
{
|
||||
return board_button_irqx(GPIO_BUTTON2_IRQ, irqhandler);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_ARCH_BUTTONS */
|
||||
@@ -1,94 +0,0 @@
|
||||
/****************************************************************************
|
||||
* configs/avr32dev1/src/avr32_leds.c
|
||||
*
|
||||
* Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include "at32uc3_internal.h"
|
||||
#include "avr32dev1_internal.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_led_initializeialize
|
||||
****************************************************************************/
|
||||
|
||||
void board_led_initializeialize(void)
|
||||
{
|
||||
at32uc3_configgpio(PINMUX_GPIO_LED1);
|
||||
at32uc3_configgpio(PINMUX_GPIO_LED2);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_led_on
|
||||
****************************************************************************/
|
||||
|
||||
void board_led_on(int led)
|
||||
{
|
||||
at32uc3_gpiowrite(PINMUX_GPIO_LED1, (led != 0));
|
||||
at32uc3_gpiowrite(PINMUX_GPIO_LED2, (led == 2));
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_led_off
|
||||
****************************************************************************/
|
||||
|
||||
void board_led_off(int led)
|
||||
{
|
||||
at32uc3_gpiowrite(PINMUX_GPIO_LED1, (led == 2));
|
||||
at32uc3_gpiowrite(PINMUX_GPIO_LED2, false);
|
||||
}
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
||||
@@ -1,114 +0,0 @@
|
||||
/************************************************************************************
|
||||
* configs/avr32dev1/src/avr32dev1_internal.h
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef _CONFIGS_AVR32DEV1_SRC_AVR32DEV1_INTERNAL_H
|
||||
#define _CONFIGS_AVR32DEV1_SRC_AVR32DEV1_INTERNAL_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
#include "at32uc3_config.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* Configuration ********************************************************************/
|
||||
|
||||
#if (CONFIG_AVR32_GPIOIRQSETB & 4) == 1
|
||||
# define CONFIG_AVR32DEV_BUTTON1_IRQ 1
|
||||
#endif
|
||||
|
||||
#if (CONFIG_AVR32_GPIOIRQSETB & 8) == 1
|
||||
# define CONFIG_AVR32DEV_BUTTON2_IRQ 1
|
||||
#endif
|
||||
|
||||
/* AVRDEV1 GPIO Pin Definitions *****************************************************/
|
||||
/* LEDs
|
||||
*
|
||||
* The AVR32DEV1 board has 3 LEDs, two of which can be controlled through GPIO pins.
|
||||
*
|
||||
* PIN 13 PA7 LED1
|
||||
* PIN 14 PA8 LED2
|
||||
*/
|
||||
|
||||
#define PINMUX_GPIO_LED1 (GPIO_ENABLE | GPIO_OUTPUT | GPIO_LOW | GPIO_PORTA | 7)
|
||||
#define PINMUX_GPIO_LED2 (GPIO_ENABLE | GPIO_OUTPUT | GPIO_LOW | GPIO_PORTA | 8)
|
||||
|
||||
/* BUTTONs
|
||||
*
|
||||
* The AVR32DEV1 board has 3 BUTTONs, two of which can be sensed through GPIO pins.
|
||||
*
|
||||
* PIN 24 PB2 KEY1
|
||||
* PIN 25 PB3 KEY2
|
||||
*/
|
||||
|
||||
#if CONFIG_AVR32DEV_BUTTON1_IRQ
|
||||
# define PINMUX_GPIO_BUTTON1 (GPIO_ENABLE | GPIO_INPUT | GPIO_INTR | \
|
||||
GPIO_INTMODE_BOTH | GPIO_GLITCH | GPIO_PORTB | 2)
|
||||
# define GPIO_BUTTON1_IRQ AVR32_IRQ_GPIO_PB2
|
||||
#else
|
||||
# define PINMUX_GPIO_BUTTON1 (GPIO_ENABLE | GPIO_INPUT | GPIO_GLITCH | \
|
||||
GPIO_PORTB | 2)
|
||||
#endif
|
||||
|
||||
#if CONFIG_AVR32DEV_BUTTON2_IRQ
|
||||
# define PINMUX_GPIO_BUTTON2 (GPIO_ENABLE | GPIO_INPUT | GPIO_INTR | \
|
||||
GPIO_INTMODE_BOTH | GPIO_GLITCH | GPIO_PORTB | 3)
|
||||
# define GPIO_BUTTON2_IRQ AVR32_IRQ_GPIO_PB3
|
||||
#else
|
||||
# define PINMUX_GPIO_BUTTON2 (GPIO_ENABLE | GPIO_INPUT | GPIO_GLITCH | \
|
||||
GPIO_PORTB | 3)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public data
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _CONFIGS_AVR32DEV1_SRC_AVR32DEV1_INTERNAL_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user