Skip to content
Snippets Groups Projects
Commit eeb7e5a2 authored by patacongo's avatar patacongo
Browse files

Add NSH configuration

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3072 42af7a65-404d-4744-a932-0658087f49c3
parent 780464c2
No related branches found
No related tags found
No related merge requests found
......@@ -126,7 +126,7 @@
# define AV32_PSEL 1
# define AV32_TOP (82-1)
#else
# define AV32_PSEL 3
# define AV32_PSEL 2
# define AV32_TOP (144-1)
#endif
......
......@@ -94,7 +94,7 @@ up_switchcontext:
mfsr r10, AVR32_SR
sub r12, -4*(REG_LR+1)
/* Then "push" PC=LR, LR, SR, and SP as ther are on entry. */
/* Then "push" PC=LR, LR, SR, and SP as they are on entry. */
/* xx xx xx xx xx xx xx xx SP SR PC LR xx xx xx xx xx */
/* ^r12 */
......
......@@ -20,6 +20,7 @@ Contents
- Entering the ISP
- BatchISP
* Reset
* Make Tip
* AVR32DEV1 Configuration Options
* Configurations
......@@ -229,11 +230,11 @@ AVR32 Bootloader
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 availabel in the
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 program verify start reset 0
blankcheck loadbuffer nuttx.elf program verify start reset 0
"BatchISP main commands available on AT32UC3xxxxx are:
......@@ -289,10 +290,23 @@ AVR32 Bootloader
Reset
^^^^^
The AVR32DEV1 reset button is not useful for restarting the program. It
seems that, after the reset, the RTC is left is a bad state and is constantly
busy (this might be the fault of the bootloader???). There does not seem
to be any way around this except for power cycling the board.
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
does not understand Cygwin/POSIX paths, the NuttX make sysem does something
weird: It copies the configuration directories instead of simply 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 and get editting
a file in one of the linked directories, re-build, and not see your changes.
To work around this annoying behavior, I also do the following when I make:
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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......@@ -410,6 +424,10 @@ sudirectory and can be selected as follow:
Where <subdir> is one of the following:
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.
......
############################################################################
# configs/avr32dev1/nsh/Make.defs
#
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# 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
# 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/winlink.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
else
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) -pipe
ARCHALLCXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) -pipe
CFLAGS = $(ARCHNOPICFLAGS) $(ARCHALLCFLAGS)
CPICFLAGS = $(ARCHPICFLAGS) $(ARCHALLCFLAGS)
CXXFLAGS = $(ARCHNOPICFLAGS) $(ARCHALLCXXFLAGS)
CXXPICFLAGS = $(ARCHPICFLAGS) $(ARCHALLCXXFLAGS)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES)
AFLAGS = $(ARCHALLCFLAGS) -D__ASSEMBLY__
OBJEXT = .o
LIBEXT = .a
EXEEXT =
LDFLAGS += -nostartfiles -nodefaultlibs
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif
define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef
define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef
define COMPILEXX
@echo "CXX: $1"
@$(CXX) -c $(CXXFLAGS) $1 -o $2
endef
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
endef
define ARCHIVE
echo "AR: $2"; \
$(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
endef
define CLEAN
@rm -f *.o *.a
endef
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
This diff is collapsed.
/****************************************************************************
* configs/avr32dev1/nsh/ld.script
*
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* 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) }
}
#!/bin/bash
# configs/avr32dev1/nsh/setenv.sh
#
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# 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}"
......@@ -311,12 +311,12 @@ CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
CONFIG_MM_REGIONS=1
CONFIG_ARCH_LOWPUTC=y
CONFIG_RR_INTERVAL=200
CONFIG_RR_INTERVAL=0
CONFIG_SCHED_INSTRUMENTATION=n
CONFIG_TASK_NAME_SIZE=0
CONFIG_START_YEAR=2010
CONFIG_START_MONTH=6
CONFIG_START_DAY=20
CONFIG_START_MONTH=11
CONFIG_START_DAY=2
CONFIG_GREGORIAN_TIME=n
CONFIG_JULIAN_TIME=n
CONFIG_DEV_CONSOLE=y
......@@ -668,7 +668,7 @@ CONFIG_EXAMPLE_NETTEST_CLIENTIP=(10<<24|0<<16|0<<8|1)
# Settings for examples/ostest
#
CONFIG_EXAMPLES_OSTEST_LOOPS=1
CONFIG_EXAMPLES_OSTEST_STACKSIZE=2048
CONFIG_EXAMPLES_OSTEST_STACKSIZE=1024
CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment