Add Z16F NSH configuration

This commit is contained in:
Gregory Nutt
2014-01-01 12:40:18 -06:00
parent 1da566f27b
commit 5a8517b849
15 changed files with 1490 additions and 45 deletions
+2
View File
@@ -6354,4 +6354,6 @@
well (2013-12-30).
* configs/sim/mount/defconfig: Converted to use kconfig-frontends
tools (2013-21-31).
* configs/z16f2800100zcog/nsh: Add a Z16F NSH configuration. Does not
yet work (2014-1-1).
+2 -2
View File
@@ -89,7 +89,7 @@ _z16f_lowuartinit:
#endif
ld r0, r3 /* r0 = baud */
sll r0, #3 /* r0 = baud * 8 */
add r0, #_SYS_CLK_FREQ /* r3 = freq + baud * 8*/
add r0, #_SYS_CLK_FREQ /* r3 = freq + baud * 8 */
sll r3, #4 /* r3 = baud * 16 */
udiv r0, r3 /* BRG = (freq + baud * 8)/(baud * 16) */
@@ -143,7 +143,7 @@ _z16f_lowuartinit:
_up_lowputc:
/* Check if the character to output is a linefeed */
ext.ub r0, r1 /* r0=Character masked to 8-bits */
ext.ub r0, r1 /* r0=Character masked to 8-bits */
cp r0, #10 /* Is it a linefeed ('\n') */
jp ne, _z16f_xmitc /* No? Jump to _z16f_xmitc with character in r1 */
+23 -21
View File
@@ -78,16 +78,14 @@ extern _Erom unsigned long SYS_CLK_FREQ;
struct z16f_uart_s
{
uint32_t uartbase; /* Base address of UART
* registers */
uint32_t baud; /* Configured baud */
bool rxenabled; /* RX interrupt enabled */
bool txenabled; /* TX interrupt enabled */
uint8_t rxirq; /* RX IRQ associated with this UART */
uint8_t txirq; /* RX IRQ associated with this UART */
uint8_t parity; /* 0=none, 1=odd, 2=even */
bool stopbits2; /* true: Configure with 2
* stop bits instead of 1 */
uint32_t uartbase; /* Base address of UART registers */
uint32_t baud; /* Configured baud */
bool rxenabled; /* RX interrupt enabled */
bool txenabled; /* TX interrupt enabled */
uint8_t rxirq; /* RX IRQ associated with this UART */
uint8_t txirq; /* RX IRQ associated with this UART */
uint8_t parity; /* 0=none, 1=odd, 2=even */
bool stopbits2; /* true: Configure with 2 stop bits instead of 1 */
};
/****************************************************************************
@@ -291,6 +289,7 @@ static void z16f_consoleput(uint8_t ch)
break;
}
}
putreg8(ch, priv->uartbase + Z16F_UART_TXD);
}
@@ -320,7 +319,9 @@ static int z16f_setup(struct uart_dev_s *dev)
/* Configure STOP bits */
ctl0 = ctl1 = 0;
ctl0 = 0;
ctl1 = 0;
if (priv->stopbits2)
{
ctl0 |= Z16F_UARTCTL0_STOP;
@@ -345,6 +346,7 @@ static int z16f_setup(struct uart_dev_s *dev)
ctl0 |= (Z16F_UARTCTL0_TEN|Z16F_UARTCTL0_REN);
putreg8(ctl0, priv->uartbase + Z16F_UART_CTL0);
#endif
return OK;
}
@@ -352,8 +354,7 @@ static int z16f_setup(struct uart_dev_s *dev)
* Name: z16f_shutdown
*
* Description:
* Disable the UART. This method is called when the serial
* port is closed
* Disable the UART. This method is called when the serial port is closed
*
****************************************************************************/
@@ -664,14 +665,16 @@ static bool z16f_txempty(struct uart_dev_s *dev)
* Name: up_earlyserialinit
*
* Description:
* Performs the low level UART initialization early in
* debug so that the serial console will be available
* during bootup. This must be called before z16f_serialinit.
* Performs the low level UART initialization early in debug so that the
* serial console will be available during bootup. This must be called
* before z16f_serialinit.
*
****************************************************************************/
void up_earlyserialinit(void)
{
/* REVISIT: UART GPIO AFL register is not initialized */
(void)z16f_disableuartirq(&TTYS0_DEV);
(void)z16f_disableuartirq(&TTYS1_DEV);
@@ -683,8 +686,8 @@ void up_earlyserialinit(void)
* Name: up_serialinit
*
* Description:
* Register serial console and serial ports. This assumes
* that up_earlyserialinit was called previously.
* Register serial console and serial ports. This assumes that
* up_earlyserialinit was called previously.
*
****************************************************************************/
@@ -699,8 +702,7 @@ void up_serialinit(void)
* Name: up_putc
*
* Description:
* Provide priority, low-level access to support OS debug
* writes
* Provide priority, low-level access to support OS debug writes
*
****************************************************************************/
@@ -709,7 +711,7 @@ int up_putc(int ch)
uint8_t state;
/* Keep interrupts disabled so that we do not interfere with normal
* driver operation
* driver operation
*/
state = z16f_disableuartirq(&CONSOLE_DEV);
+52 -11
View File
@@ -44,7 +44,7 @@ Version 5.0.1
to modify the versioning in Make.defs and setenv.sh; if you want to build
on a different platform, you will need to change the path in the ZDS binaries
in those same files.
Other Versions
If you use any version of ZDS-II other than 5.0.1 or if you install ZDS-II
@@ -62,7 +62,7 @@ mentioned here because it causes a failure to compile Nuttx:
Description: The file drivers/mmcsd/mmcsd_sdio.c generates an internal compiler
error like:
mmcsd\mmcsd_sdio.c
Internal Error(0503) On line 2524 of "MMCSD\MMCSD_SDIO.C"
File <c3>, Args(562,46)
@@ -94,11 +94,13 @@ Where <sub-directory> is the specific board configuration that you
wish to build. The following board-specific configurations are
available:
ostest
------
This builds the examples/ostest application for execution from FLASH.
See examples/README.txt for information about ostest.
nsh
---
nsh:
This configuration directory will built the NuttShell (NSH). See
the NSH user manual in the documents directory (or online at nuttx.org).
See also the README.txt file in the ostest sub-directory for information
about using ZDS-II.
NOTES:
@@ -125,7 +127,49 @@ ostest
CONFIG_APPS_DIR="..\apps"
NOTES:
a. If you need to change the toolchain path used in Make.defs, you
will need to use the short 8.3 filenames to avoid spaces. On my
PC, C:\PROGRA~1\ is is C:\Program Files\ and C:\PROGRA~2\ is
C:\Program Files (x86)\
b. I have not tried to use this configuration with the native
Windows build, but I would expect the same issues as is listed
for the ostest configuration..
ostest
------
This builds the examples/ostest application for execution from FLASH.
See the README.txt file in the ostest sub-directory for information
about using ZDS-II. See also apps/examples/README.txt for information
about ostest.
NOTES:
1. This configuration uses the mconf-based configuration tool. To
change this configuration using that tool, you should:
a. Build and install the kconfig-mconf tool. See nuttx/README.txt
and misc/tools/
b. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
2. By default, this configuration assumes that you are using the
Cygwin environment on Windows. An option is to use the native
CMD.exe window build as described in the top-level README.txt
file. To set up that configuration:
-CONFIG_WINDOWS_CYGWIN=y
+CONFIG_WINDOWS_NATIVE=y
And after configuring, make sure that CONFIG_APPS_DIR uses
the back slash character. For example:
CONFIG_APPS_DIR="..\apps"
NOTES:
a. If you need to change the toolchain path used in Make.defs, you
will need to use the short 8.3 filenames to avoid spaces. On my
PC, C:\PROGRA~1\ is is C:\Program Files\ and C:\PROGRA~2\ is
@@ -139,9 +183,6 @@ ostest
the end of the lines after a line continuation (\ ^M). If these
trailing bad characters are manually eliminated, then the build
will succeed on the next try.
d. Hmmm... when last tested, there some missing .obj files in arch/z16/src.
A little additional TLC might be needed to get a reliable Windows
native build.
pashello
--------
+5
View File
@@ -0,0 +1,5 @@
nsh.hex
nsh.map
nsh.lod
nsh.wsp
+264
View File
@@ -0,0 +1,264 @@
############################################################################
# configs/z16f2800100zcog/nsh/Make.defs
#
# Copyright (C) 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.
#
############################################################################
include $(TOPDIR)/.config
include $(TOPDIR)/tools/Config.mk
# These are the directories where the ZDS-II toolchain is installed. NOTE
# that short 8.3 path names are used in order to avoid spaces. On my machine
# I have:
#
# C:\PROGRA~1\ = C:\Profram Files\
# C:\PROGRA~2\ = C:\Program Files (x86)\
#
# Your PC may be configured differently.
ZDSVERSION = 5.0.1
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_ZNEO_$(ZDSVERSION)
INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"}
ZDSBINDIR = $(INSTALLDIR)\bin
ZDSSTDINCDIR = $(INSTALLDIR)\include\std
ZDSZILOGINCDIR = $(INSTALLDIR)\include\zilog
ZDSSTDLIBDIR = $(INSTALLDIR)\lib\std
ZDSZILOGLIBDIR = $(INSTALLDIR)\lib\zilog
# CFLAGs
ARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR)
EARCHASMINCLUDES = -include:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR)
ARCHSTDINCLUDES = -stdinc:$(TOPDIR)\include;$(ZDSSTDINCDIR);$(ZDSZILOGINCDIR)
ARCHUSRINCLUDES = -usrinc:.
else
WINTOOL = y
ZDSINSTALLDIR = C:/PROGRA~2/ZiLOG/ZDSII_ZNEO_$(ZDSVERSION)
INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"}
ZDSBINDIR = $(INSTALLDIR)/bin
ZDSSTDINCDIR = $(INSTALLDIR)/include/std
ZDSZILOGINCDIR = $(INSTALLDIR)/include/zilog
ZDSSTDLIBDIR = $(INSTALLDIR)/lib/std
ZDSZILOGLIBDIR = $(INSTALLDIR)/lib/zilog
# These are the same directories but with the directory separator
# character swapped as needed by the ZDS-II compiler
WTOPDIR = ${shell cygpath -w "$(TOPDIR)"}
WZDSSTDINCDIR = ${shell cygpath -w "$(ZDSSTDINCDIR)"}
WZDSZILOGINCDIR = ${shell cygpath -w "$(ZDSZILOGINCDIR)"}
WZDSSTDLIBDIR = ${shell cygpath -w "$(ZDSSTDLIBDIR)"}
WZDSZILOGLIBDIR = ${shell cygpath -w "$(ZDSZILOGLIBDIR)"}
# Escaped versions
ETOPDIR = ${shell echo "$(WTOPDIR)" | sed -e "s/ /%20/g"}
EZDSSTDINCDIR = ${shell echo "$(WZDSSTDINCDIR)" | sed -e "s/ /%20/g"}
EZDSZILOGINCDIR = ${shell echo "$(WZDSZILOGINCDIR)" | sed -e "s/ /%20/g"}
# CFLAGs
ARCHASMINCLUDES = -include:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)'
EARCHASMINCLUDES = -include:'$(ETOPDIR)\include;$(EZDSSTDINCDIR);$(EZDSZILOGINCDIR)'
ARCHSTDINCLUDES = -stdinc:'$(WTOPDIR)\include;$(WZDSSTDINCDIR);$(WZDSZILOGINCDIR)'
ARCHUSRINCLUDES = -usrinc:'.'
endif
# Assembler definitions
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHASMOPTIMIZATION = -debug
else
ARCHASMOPTIMIZATION = -nodebug
endif
ARCHASMCPUFLAGS = -cpu:Z16F2811AL -NOigcase
ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet
ARCHASMWARNINGS = -warn
ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 -define:__ASSEMBLY__
AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)
# Compiler definitions
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -debug
else
ARCHOPTIMIZATION = -nodebug
endif
ifeq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += -NOregvar -reduceopt
else
ARCHOPTIMIZATION += -regvar
endif
ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL -NOgenprint \
-asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)"
ARCHLIST = -keeplst -NOlist -NOlistinc -NOkeepasm
ARCHPICFLAGS =
ARCHWARNINGS = -warn
ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES -define:_Z16F_SERIES
ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES)
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHLIST) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
CPPDEFINES = -D_Z16F2811AL -D_Z16K_SERIES -D_Z16F_SERIES -D__ASSEMBLY__
CPPINCLUDES = -I$(TOPDIR)$(DELIM)include
CPPFLAGS = $(CPPDEFINES) $(CPPINCLUDES)
# Librarian definitions
ARFLAGS = -quiet -warn
# Linker definitions
LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)z16f2800100zcog$(DELIM)nsh$(DELIM)nsh.linkcmd
# Tool names/pathes
CROSSDEV =
CC = zneocc.exe
CPP = gcc -E
LD = zneolink.exe
AS = zneoasm.exe
AR = zneolib.exe
# File extensions
ASMEXT = .asm
OBJEXT = .obj
LIBEXT = .lib
EXEEXT = .hex
# These are the macros that will be used in the NuttX make system
# to compile and assembly source files and to insert the resulting
# object files into an archive
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define PREPROCESS
@echo CPP: $1->$2
$(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2
endef
define COMPILE
$(Q) "$(CC)" $(CFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"}
endef
define ASSEMBLE
$(Q) "$(AS)" $(AFLAGS) ${shell echo $1 | sed -e "s/\//\\/g"}
endef
define MOVEOBJ
$(call MOVEFILE, "$1.obj", "$2$(DELIM)$1.obj")
$(call MOVEFILE, "$1.lst", "$2$(DELIM)$1.lst")
@#$(call MOVEFILE, "$1.src", "$2$(DELIM)$1.src")
endef
define ARCHIVE
@echo AR: $2
$(Q) for %%G in ($(2)) do ( "$(AR)" $(ARFLAGS) $1=-+%%G )
endef
define CLEAN
$(Q) if exist *.obj (del /f /q *.obj)
$(Q) if exist *.src (del /f /q *.src)
$(Q) if exist *.lib (del /f /q *.lib)
$(Q) if exist *.hex (del /f /q *.hex)
$(Q) if exist *.lod (del /f /q *.lod)
$(Q) if exist *.lst (del /f /q *.lst)
endef
else
define PREPROCESS
@echo "CPP: $1->$2"
$(Q) "$(CPP)" $(CPPFLAGS) $1 -o $2
endef
define COMPILE
$(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile)
endef
define ASSEMBLE
$(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile)
endef
define MOVEOBJ
$(call MOVEFILE, "$1.obj", "$2$(DELIM)$1.obj")
$(call MOVEFILE, "$1.lst", "$2$(DELIM)$1.lst")
@#$(call MOVEFILE, "$1.src", "$2$(DELIM)$1.src")
endef
define ARCHIVE
$(Q) for __obj in $(2) ; do \
echo "AR: $$__obj"; \
"$(AR)" $(ARFLAGS) $1=-+$$__obj || { echo "$(AR) $1=-+$$__obj FAILED!" ; exit 1 ; } \
done
endef
define CLEAN
$(Q) rm -f *.obj *.src *.lib *.hex *.lod *.lst
endef
endif
# Windows native host tool definitions
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTCC = mingw32-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
HOSTEXEEXT = .exe
# Windows-native host tools
MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
else
# Linux/Cygwin host tool definitions
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
# This is the tool to use for dependencies (i.e., none)
MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh
# ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
endif
+49
View File
@@ -0,0 +1,49 @@
README.txt
==========
Contents
--------
o NSH Project
o Loading and Executing Code
o Console Output
o STATUS
NSH Project
-----------
nsh.zfpproj is a simple ZDS II - ZNEO 5.0.1 project that will allow you
to use the ZDS-II debugger. Before using, copy the following files from
the toplevel directory:
nuttx.hex, nuttx.map, nuttx.lod
to this directory as:
nsh.hex, nsh.map, nsh.lod
Loading and Executing Code
--------------------------
1. Copy the files to this directory as described above
2. Connect the ZiLOG XTools USB debugger.
3. Install the USB driver from the ZDS-II device_drivers directory
4. Start ZDS-II and load the nsh.zfpproj project
5. In the debug tab, connect to the debugger
6. In the debug tab, load code, reset, and go
Console Output
--------------
Interaction with NSH is via the serial console at 57600 8N1 baud.
STATUS
------
1. This configuration does not run correctly. There is a problem with the
serial driver. When started, some garbled characters appear on the
console. I suspect (a) the UART is not being configured correctly, and
(2) UART interrupts are not be set up correctly.
2. I bet that this code, like ostest, will not run if started by a hardware
reset. It may only run when started via the debugger.
File diff suppressed because it is too large Load Diff
+92
View File
@@ -0,0 +1,92 @@
/****************************************************************************/
/* configs/z16f2800100zcog/nsh/nsh.linkcmd */
/* */
/* Copyright (C) 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. */
/* */
/****************************************************************************/
-FORMAT=OMF695,INTEL32
-map -maxhexlen=64 -quiet -sort NAME=ascending -unresolved=fatal
-warnoverlap -NOxref -warn -debug -NOigcase
RANGE ROM $000000 : $007FFF
RANGE RAM $FFB000 : $FFBFFF
RANGE IODATA $FFC000 : $FFFFFF
RANGE EROM $008000 : $01FFFF
RANGE ERAM $800000 : $87FFFF
CHANGE NEAR_TEXT=NEAR_DATA
CHANGE FAR_TEXT=FAR_DATA
ORDER FAR_BSS, FAR_DATA
ORDER NEAR_BSS, NEAR_DATA
COPY NEAR_DATA EROM
COPY FAR_DATA EROM
define _0_exit = 0
define _low_near_romdata = copy base of NEAR_DATA
define _low_neardata = base of NEAR_DATA
define _len_neardata = length of NEAR_DATA
define _low_far_romdata = copy base of FAR_DATA
define _low_fardata = base of FAR_DATA
define _len_fardata = length of FAR_DATA
define _low_nearbss = base of NEAR_BSS
define _len_nearbss = length of NEAR_BSS
define _low_farbss = base of FAR_BSS
define _len_farbss = length of FAR_BSS
define _near_heaptop = highaddr of RAM
define _far_heaptop = highaddr of ERAM
define _far_stack = highaddr of ERAM
define _near_stack = highaddr of RAM
define _near_heapbot = top of RAM
define _far_heapbot = top of ERAM
define _SYS_CLK_SRC = 2
define _SYS_CLK_FREQ = 20000000
define __EXTCT_INIT_PARAM = $80
define __EXTCS0_INIT_PARAM = $8012
define __EXTCS1_INIT_PARAM = $8001
define __EXTCS2_INIT_PARAM = $0000
define __EXTCS3_INIT_PARAM = $0000
define __EXTCS4_INIT_PARAM = $0000
define __EXTCS5_INIT_PARAM = $0000
define __PFAF_INIT_PARAM = $ff
define __PGAF_INIT_PARAM = $ff
define __PDAF_INIT_PARAM = $ff00
define __PAAF_INIT_PARAM = $0000
define __PCAF_INIT_PARAM = $0000
define __PHAF_INIT_PARAM = $0300
define __PKAF_INIT_PARAM = $0f
/* arch/z16/src/Makefile will append target, object and library paths below */
+245
View File
@@ -0,0 +1,245 @@
<project type="Standard" project-type="Standard" configuration="Debug" created-by="{{build_number}}" modified-by="d:5.0.0:11071102" ZDSII="ZDS - ZNEO 5.0.1 (Build 11071201)">
<cpu>Z16F2811AL</cpu>
<!-- file information -->
<files>
<file filter-key="flash">..\..\..\nuttx.hex</file>
</files>
<!-- configuration information -->
<configurations>
<configuration name="Debug" >
<tools>
<tool name="Assembler">
<options>
<option name="define" type="string" change-action="assemble">_Z16F2811AL=1,_Z16F_SERIES=1</option>
<option name="include" type="string" change-action="assemble"></option>
<option name="list" type="boolean" change-action="none">true</option>
<option name="listmac" type="boolean" change-action="none">false</option>
<option name="name" type="boolean" change-action="none">true</option>
<option name="pagelen" type="integer" change-action="none">56</option>
<option name="pagewidth" type="integer" change-action="none">80</option>
<option name="quiet" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="Compiler">
<options>
<option name="chartype" type="string" change-action="compile">U</option>
<option name="define" type="string" change-action="compile">_Z16F2811AL,_Z16F_SERIES</option>
<option name="genprintf" type="boolean" change-action="compile">true</option>
<option name="keepasm" type="boolean" change-action="none">false</option>
<option name="keeplst" type="boolean" change-action="none">false</option>
<option name="list" type="boolean" change-action="none">false</option>
<option name="listinc" type="boolean" change-action="none">false</option>
<option name="model" type="string" change-action="compile">S</option>
<option name="modsect" type="boolean" change-action="compile">false</option>
<option name="stdinc" type="string" change-action="compile"></option>
<option name="usrinc" type="string" change-action="compile"></option>
<option name="regvar" type="boolean" change-action="compile">true</option>
<option name="regvarcache" type="boolean" change-action="none">false</option>
<option name="reduceopt" type="boolean" change-action="compile">false</option>
<option name="watch" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Debugger">
<options>
<option name="target" type="string" change-action="rebuild">Z16F2800100ZCOG</option>
<option name="debugtool" type="string" change-action="none">USBSmartCable</option>
<option name="usepageerase" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="FlashProgrammer">
<options>
<option name="erasebeforeburn" type="boolean" change-action="none">false</option>
<option name="eraseinfopage" type="boolean" change-action="none">false</option>
<option name="enableinfopage" type="boolean" change-action="none">false</option>
<option name="includeserial" type="boolean" change-action="none">false</option>
<option name="offset" type="integer" change-action="none">0</option>
<option name="snenable" type="boolean" change-action="none">true</option>
<option name="sn" type="string" change-action="none">000000000000000000000000</option>
<option name="snsize" type="integer" change-action="none">1</option>
<option name="snstep" type="integer" change-action="none">000000000000000000000001</option>
<option name="snstepformat" type="integer" change-action="none">0</option>
<option name="snaddress" type="string" change-action="none">0</option>
<option name="snformat" type="integer" change-action="none">0</option>
<option name="snbigendian" type="boolean" change-action="none">true</option>
<option name="singleval" type="string" change-action="none">0</option>
<option name="singlevalformat" type="integer" change-action="none">0</option>
<option name="usepageerase" type="boolean" change-action="none">false</option>
<option name="autoselect" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="General">
<options>
<option name="warn" type="boolean" change-action="none">true</option>
<option name="debug" type="boolean" change-action="assemble">true</option>
<option name="debugcache" type="boolean" change-action="none">true</option>
<option name="igcase" type="boolean" change-action="assemble">false</option>
<option name="outputdir" type="string" change-action="compile">.</option>
</options>
</tool>
<tool name="Librarian">
<options>
<option name="outfile" type="string" change-action="build"></option>
<option name="warn" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Linker">
<options>
<option name="directives" type="string" change-action="build"></option>
<option name="createnew" type="boolean" change-action="build">false</option>
<option name="eram" type="string" change-action="build">0-0</option>
<option name="erom" type="string" change-action="build">0-0</option>
<option name="exeform" type="string" change-action="build">OMF695,INTEL32</option>
<option name="fplib" type="string" change-action="build">Dummy</option>
<option name="iodata" type="string" change-action="build">0-0</option>
<option name="linkctlfile" type="string" change-action="build"></option>
<option name="map" type="boolean" change-action="none">true</option>
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="objlibmods" type="string" change-action="build"></option>
<option name="of" type="string" change-action="build">.\nsh</option>
<option name="padhex" type="boolean" change-action="build">false</option>
<option name="quiet" type="boolean" change-action="none">false</option>
<option name="ram" type="string" change-action="build">FFB000-FFBFFF</option>
<option name="relist" type="boolean" change-action="build">false</option>
<option name="rom" type="string" change-action="build">000000-007FFF</option>
<option name="sort" type="string" change-action="none">name</option>
<option name="startuplnkcmds" type="boolean" change-action="build">true</option>
<option name="startuptype" type="string" change-action="build">1</option>
<option name="undefisfatal" type="boolean" change-action="none">true</option>
<option name="useadddirectives" type="boolean" change-action="build">false</option>
<option name="usecrun" type="boolean" change-action="build">true</option>
<option name="warnoverlap" type="boolean" change-action="none">false</option>
<option name="warnisfatal" type="boolean" change-action="none">false</option>
<option name="xref" type="boolean" change-action="none">false</option>
</options>
</tool>
</tools>
</configuration>
<configuration name="Release" >
<tools>
<tool name="Assembler">
<options>
<option name="define" type="string" change-action="assemble">_Z16F2811AL=1,_Z16F_SERIES=1</option>
<option name="include" type="string" change-action="assemble"></option>
<option name="list" type="boolean" change-action="none">true</option>
<option name="listmac" type="boolean" change-action="none">false</option>
<option name="name" type="boolean" change-action="none">true</option>
<option name="pagelen" type="integer" change-action="none">56</option>
<option name="pagewidth" type="integer" change-action="none">80</option>
<option name="quiet" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="Compiler">
<options>
<option name="chartype" type="string" change-action="compile">U</option>
<option name="define" type="string" change-action="compile">_Z16F2811AL,_Z16F_SERIES</option>
<option name="genprintf" type="boolean" change-action="compile">true</option>
<option name="keepasm" type="boolean" change-action="none">false</option>
<option name="keeplst" type="boolean" change-action="none">false</option>
<option name="list" type="boolean" change-action="none">false</option>
<option name="listinc" type="boolean" change-action="none">false</option>
<option name="model" type="string" change-action="compile">S</option>
<option name="modsect" type="boolean" change-action="compile">false</option>
<option name="stdinc" type="string" change-action="compile"></option>
<option name="usrinc" type="string" change-action="compile"></option>
<option name="regvar" type="boolean" change-action="compile">true</option>
<option name="regvarcache" type="boolean" change-action="none">false</option>
<option name="reduceopt" type="boolean" change-action="compile">false</option>
<option name="watch" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Debugger">
<options>
<option name="target" type="string" change-action="rebuild"></option>
<option name="debugtool" type="string" change-action="none">ZPAKII</option>
<option name="usepageerase" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="FlashProgrammer">
<options>
<option name="erasebeforeburn" type="boolean" change-action="none">false</option>
<option name="eraseinfopage" type="boolean" change-action="none">false</option>
<option name="enableinfopage" type="boolean" change-action="none">false</option>
<option name="includeserial" type="boolean" change-action="none">false</option>
<option name="offset" type="integer" change-action="none">0</option>
<option name="snenable" type="boolean" change-action="none">false</option>
<option name="sn" type="string" change-action="none">0</option>
<option name="snsize" type="integer" change-action="none">0</option>
<option name="snstep" type="integer" change-action="none">1</option>
<option name="snstepformat" type="integer" change-action="none">0</option>
<option name="snaddress" type="string" change-action="none">0</option>
<option name="snformat" type="integer" change-action="none">0</option>
<option name="snbigendian" type="boolean" change-action="none">true</option>
<option name="singleval" type="string" change-action="none">0</option>
<option name="singlevalformat" type="integer" change-action="none">0</option>
<option name="usepageerase" type="boolean" change-action="none">false</option>
<option name="autoselect" type="boolean" change-action="none">true</option>
</options>
</tool>
<tool name="General">
<options>
<option name="warn" type="boolean" change-action="none">true</option>
<option name="debug" type="boolean" change-action="assemble">false</option>
<option name="debugcache" type="boolean" change-action="none">true</option>
<option name="igcase" type="boolean" change-action="assemble">false</option>
<option name="outputdir" type="string" change-action="compile">.</option>
</options>
</tool>
<tool name="Librarian">
<options>
<option name="outfile" type="string" change-action="build"></option>
<option name="warn" type="boolean" change-action="none">false</option>
</options>
</tool>
<tool name="Linker">
<options>
<option name="directives" type="string" change-action="build"></option>
<option name="createnew" type="boolean" change-action="build">false</option>
<option name="eram" type="string" change-action="build">0-0</option>
<option name="erom" type="string" change-action="build">0-0</option>
<option name="exeform" type="string" change-action="build">OMF695,INTEL32</option>
<option name="fplib" type="string" change-action="build">Dummy</option>
<option name="iodata" type="string" change-action="build">0-0</option>
<option name="linkctlfile" type="string" change-action="build"></option>
<option name="map" type="boolean" change-action="none">true</option>
<option name="maxhexlen" type="integer" change-action="build">64</option>
<option name="objlibmods" type="string" change-action="build"></option>
<option name="of" type="string" change-action="build">.\nsh</option>
<option name="padhex" type="boolean" change-action="build">false</option>
<option name="quiet" type="boolean" change-action="none">false</option>
<option name="ram" type="string" change-action="build">FFB000-FFBFFF</option>
<option name="relist" type="boolean" change-action="build">false</option>
<option name="rom" type="string" change-action="build">000000-007FFF</option>
<option name="sort" type="string" change-action="none">name</option>
<option name="startuplnkcmds" type="boolean" change-action="build">true</option>
<option name="startuptype" type="string" change-action="build">1</option>
<option name="undefisfatal" type="boolean" change-action="none">true</option>
<option name="useadddirectives" type="boolean" change-action="build">false</option>
<option name="usecrun" type="boolean" change-action="build">true</option>
<option name="warnoverlap" type="boolean" change-action="none">false</option>
<option name="warnisfatal" type="boolean" change-action="none">false</option>
<option name="xref" type="boolean" change-action="none">false</option>
</options>
</tool>
</tools>
</configuration>
</configurations>
<!-- watch information -->
<watch-elements>
<watch-element expression="0x801d1a" />
</watch-elements>
<!-- breakpoint information -->
<breakpoints>
<breakpoint temporary="false" enabled="true" >
<line-number>0</line-number>
<pathname></pathname>
<address>37442</address>
<command></command>
<preserve-type>1</preserve-type>
</breakpoint>
</breakpoints>
</project>
+64
View File
@@ -0,0 +1,64 @@
#!/bin/bash
# configs/z16f2800100zcog/nsh/setenv.sh
#
# Copyright (C) 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.
#
# Check how we were executed
#
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 location where the XDS-II tools were installed
#
TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/ZiLOG/ZDSII_ZNEO_5.0.1/bin"
#
# Add the path to the toolchain to the PATH variable. NOTE that /bin and /usr/bin
# preceded the toolchain bin directory. This is because the ZDSII bin directory
# includes binaries like make.exe that will interfere with the normal build process
# if we do not give priority to the versions at /bin and /usr/bin.
#
export PATH="/bin:/usr/bin:${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
echo "PATH : ${PATH}"
+3 -3
View File
@@ -7,11 +7,11 @@ OSTEST Project
ostest.zfpproj is a simple ZDS II - ZNEO 5.0.1 project that will allow you
to use the ZDS-II debugger. Before using, copy the following files from
the toplevel directory:
nuttx.hex, nuttx.map, nuttx.lod
to this directory as:
ostest.hex, ostest.map, ostest.lod
ostest.zdzbak is a project file for an older ZDS-II 4.0 version (There is no
@@ -2,7 +2,7 @@
/* configs/z16f2800100zcog/ostest/ostest.linkcmd */
/* */
/* Copyright (C) 2008 Gregory Nutt. All rights reserved. */
/* Author: Gregory Nutt <gnutt@nuttx.org> */
/* 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 */
@@ -2,7 +2,7 @@
/* configs/z16f2800100zcog/pashello/pashello.linkcmd */
/* */
/* Copyright (C) 2008 Gregory Nutt. All rights reserved. */
/* Author: Gregory Nutt <gnutt@nuttx.org> */
/* 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 */
+4 -6
View File
@@ -56,9 +56,9 @@
* Other values - Not implemented
*/
#define WEXITSTATUS(s) (((s) >> 8) & 0xff)/* Return exit status */
#define WEXITSTATUS(s) (((s) >> 8) & 0xff) /* Return exit status */
#define WIFEXITED(s) (((s) & 0xff) == 0) /* True: Child exited normally */
#define WIFCONTINUED(s) (false) /* True: Child has been continued */
#define WIFSIGNALED(s) (false) /* True: Child exited due to uncaught signal */
#define WIFSTOPPED(s) (false) /* True: Child is currently stopped */
@@ -70,13 +70,11 @@
*/
#define WCONTINUED (1 << 0) /* Status for child that has been continued (1)(2) */
#define WNOHANG (1 << 1) /* Do not wait if status not available (1) */
#define WNOHANG (1 << 1) /* Do not wait if status not available (1) (2) */
#define WUNTRACED (1 << 2) /* Report status of stopped child process (1) */
#define WEXITED (1 << 3) /* Wait for processes that have exited (2) */
#define WSTOPPED (1 << 4) /* Status for child stopped on signal (2) */
#define WNOHANG (1 << 5) /* Return immediately if there are no children (2) */
#define WNOWAIT (1 << 6) /* Keep the process in a waitable state (2) */
#define WNOWAIT (1 << 5) /* Keep the process in a waitable state (2) */
/****************************************************************************
* Public Type Definitions