Add ZP213X/4XPA nxlines configuration (needs a little more work)

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5466 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-12-30 16:39:25 +00:00
parent e0be95b9a0
commit e1eacb2254
18 changed files with 2094 additions and 91 deletions
@@ -14,6 +14,7 @@ BR2_arm=y
# BR2_m68k is not set
# BR2_m68hc11 is not set
# BR2_m68hc12 is not set
# BR2_m9s12x is not set
# BR2_mips is not set
# BR2_mipsel is not set
# BR2_nios2 is not set
@@ -71,8 +72,11 @@ BR2_GNU_TARGET_SUFFIX="nuttx-elf"
# Binutils Options
#
# BR2_BINUTILS_VERSION_2_17 is not set
# BR2_BINUTILS_VERSION_2_18 is not set
# BR2_BINUTILS_VERSION_2_19 is not set
BR2_BINUTILS_VERSION_2_19_1=y
# BR2_BINUTILS_VERSION_2_21_1 is not set
# BR2_BINUTILS_VERSION_2_22 is not set
BR2_BINUTILS_VERSION="2.19.1"
BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""
@@ -80,9 +84,12 @@ BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""
# GCC Options
#
BR2_PACKAGE_GCC=y
# BR2_GCC_VERSION_3_3_6 is not set
# BR2_GCC_VERSION_3_4_6 is not set
# BR2_GCC_VERSION_4_2_4 is not set
BR2_GCC_VERSION_4_3_3=y
# BR2_GCC_VERSION_4_5_2 is not set
# BR2_GCC_VERSION_4_6_3 is not set
BR2_GCC_SUPPORTS_SYSROOT=y
BR2_GCC_VERSION="4.3.3"
# BR2_GCC_USE_SJLJ_EXCEPTIONS is not set
+4 -1
View File
@@ -3842,4 +3842,7 @@
board (with the LPC2148 and the UG_2864AMBAG01).
* configs/sim/nxlines: Add an nxlines configuration for the
simulator.
* configs/zp214xpa/nxlines: Add an nxlines configuration for the
ZP213x/4xPA (with the LPC2148 and the UG_2864AMBAG01). As of this
writing (2012-12-30), I see only garbage on the display each time
the display is updated.
+1 -1
View File
@@ -47,7 +47,7 @@ endif
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = up_spi.c up_leds.c
CSRCS = up_spi1.c up_leds.c
ifeq ($(CONFIG_NSH_ARCHINIT),y)
CSRCS += up_nsh.c
@@ -1,6 +1,6 @@
/****************************************************************************
* config/mcu123-lpc214x/src/up_spi.c
* arch/arm/src/board/up_spi.c
* config/mcu123-lpc214x/src/up_spi1.c
* arch/arm/src/board/up_spi1.c
*
* Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
+5 -5
View File
@@ -439,12 +439,12 @@ LEDs
that interrupt). So a brighter LED1 means that the processor is spending
less time sleeping.
When my STM32 sits IDLE -- doing absolutely nothing but processing timer interrupts --
When my LPC1766 sits IDLE -- doing absolutely nothing but processing timer interrupts --
I see the following:
1. LED1 glows dimly due to the timer interrupts.
2. But LED2 is even more dim! The LED ON time excludes the time processing the
interrupt that re-awakens the processing. So this tells me that the STM32 is
interrupt that re-awakens the processing. So this tells me that the LPC1766 is
spending more time processing timer interrupts than doing any other kind of
processing. That, of course, makes sense if the system is truly idle and only
processing timer interrupts.
@@ -913,9 +913,9 @@ Where <subdir> is one of the following:
2. Default platform/toolchain: This is how the build is configured by
be default. These options can easily be re-confured, however.
CONFIG_HOST_WINDOWS=y : Windows
CONFIG_WINDOWS_CYGWIN=y : Cygwin environment on Windows
CONFIG_STM32_CODESOURCERYW=y : CodeSourcery under Windows
CONFIG_HOST_WINDOWS=y : Windows
CONFIG_WINDOWS_CYGWIN=y : Cygwin environment on Windows
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
nettest:
This configuration directory may be used to enable networking using the
+15
View File
@@ -446,6 +446,21 @@ nx11
See apps/examples/README.txt for further details.
nxlines
This is the apps/examples/nxlines test.
NOTES:
------
1. This configuration uses the mconf-based configuration tool. To
change this configuration using that tool, you should:
a. Build and install the mconf tool. See nuttx/README.txt and
misc/tools/
b. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
nxwm
This is a special configuration setup for the NxWM window manager
+286 -82
View File
@@ -9,114 +9,294 @@ Contents
o MCU Connections
o Serial Console
o Using OpenOCD and GDB with an FT2232 JTAG emulator
o Configurations
MCU Connections:
================
Module Socket:
--------------
PIN NAME PIN NAME
1 VBAT 56 VCC
2 3V3 55 Vusb
3 VREF 54 3V3
4 P0.0 53 RESET
5 P0.1 52 P1.31
6 P0.2 51 P1.30
7 P0.3 50 P1.29
8 P0.4 49 P1.28
9 P0.5 48 P1.27
10 P0.6 47 P1.26
11 P0.7 46 P1.25
12 P0.8 45 P1.24
13 P0.9 44 P1.23
14 P0.10 43 P1.22
15 P0.11 42 P1.21
16 P0.12 41 P1.20
17 P0.13 40 P1.19
18 P0.14 39 P1.18
19 P0.15 38 P1.17
20 P0.16 37 P1.16
21 P0.17 36 P0.31
22 P0.18 35 P0.30
23 P0.19 34 P0.29
24 P0.20 33 P0.28
25 P0.21 32 P0.27
26 P0.22 31 P0.26
27 P0.23 30 P0.25
28 GND 29 GND
The ZP213X/4XPA board is no more than an LPC2148, crystals,
USB device and several connectors.
JTAG Debug:
-----------
PIN NAME PIN NAME
1 VCC1 2 3V3
3 P1.31 NTRST 4 GND
5 P1.28 TDI 6 GND
7 P1.30 TMS 8 GND
9 P1.29 TCK 10 GND
11 P1.26 RTCK 12 GND
13 P1.27 TDO 14 GND
15 RESET NRTS 16 GND
17 N/C NC0 18 GND
19 N/C NC1 20 GND
Module Socket:
--------------
PIN NAME PIN NAME
1 VBAT 56 VCC
2 3V3 55 Vusb
3 VREF 54 3V3
4 P0.0 53 RESET
5 P0.1 52 P1.31
6 P0.2 51 P1.30
7 P0.3 50 P1.29
8 P0.4 49 P1.28
9 P0.5 48 P1.27
10 P0.6 47 P1.26
11 P0.7 46 P1.25
12 P0.8 45 P1.24
13 P0.9 44 P1.23
14 P0.10 43 P1.22
15 P0.11 42 P1.21
16 P0.12 41 P1.20
17 P0.13 40 P1.19
18 P0.14 39 P1.18
19 P0.15 38 P1.17
20 P0.16 37 P1.16
21 P0.17 36 P0.31
22 P0.18 35 P0.30
23 P0.19 34 P0.29
24 P0.20 33 P0.28
25 P0.21 32 P0.27
26 P0.22 31 P0.26
27 P0.23 30 P0.25
28 GND 29 GND
Z28160 Net Module:
------------------
PIN NAME PIN NAME
1 P0.7 /CS 10 3V3 VCC
2 P0.4 SCK 9 P1.24 RST
3 P0.6 SI 8 N/C CLKOUT
4 P0.5 SO 7 INT P1.25
5 GND 6 N/C WOL
JTAG Debug:
-----------
PIN NAME PIN NAME
1 VCC1 2 3V3
3 P1.31 NTRST 4 GND
5 P1.28 TDI 6 GND
7 P1.30 TMS 8 GND
9 P1.29 TCK 10 GND
11 P1.26 RTCK 12 GND
13 P1.27 TDO 14 GND
15 RESET NRTS 16 GND
17 N/C NC0 18 GND
19 N/C NC1 20 GND
SPI LCD:
--------
PIN NAME
1 3V3 3V3
2 VCC 5V
3 P0.18 RESET(DO)
4 P0.19 DI
5 P0.20 CS
6 P0.17 SCK
7 P0.23 A0(RESET)
8 N/C LED-
9 N/C LED+(BL)
10 GND GND
Z28160 Net Module:
------------------
PIN NAME PIN NAME
1 P0.7 /CS 10 3V3 VCC
2 P0.4 SCK 9 P1.24 RST
3 P0.6 SI 8 N/C CLKOUT
4 P0.5 SO 7 INT P1.25
5 GND 6 N/C WOL
USB Interface:
--------------
Vusb, P0.26, P0.27
SPI LCD:
--------
PIN NAME
1 3V3 3V3
2 VCC 5V
3 P0.18 RESET(DO)
4 P0.19 DI
5 P0.20 CS
6 P0.17 SCK
7 P0.23 A0(RESET)
8 N/C LED-
9 N/C LED+(BL)
10 GND GND
USB Interface:
--------------
Vusb, P0.26, P0.27
Serial Console:
===============
Both UART0 and UART1 are always enabled. UART0 is configured to be the
serial console in these configurations.
Both UART0 and UART1 are always enabled. UART0 is configured to be the
serial console in these configurations.
P0.0/TXD0/PWM1 Module Socket, Pin 4
P0.1/RxD0/PWM3/EINT0 Module Socket, Pin 5
P0.0/TXD0/PWM1 Module Socket, Pin 4
P0.1/RxD0/PWM3/EINT0 Module Socket, Pin 5
P0.8/TXD1/PWM4/AD1.1 Module Socket, Pin 12
P0.9/RxD1/PWM6/EINT3 Module Socket, Pin 13
P0.8/TXD1/PWM4/AD1.1 Module Socket, Pin 12
P0.9/RxD1/PWM6/EINT3 Module Socket, Pin 13
LCD Interface
=============
PIN NAME PIN CONFIGURATION
3 RESET P0.18/CAP1.3/MISO1/MAT1.3P0.18 RESET - General purpose output
4 DI P0.19/MAT1.2/MOSI1/CAP1.2P0.19 DI - Alternate function 2
5 CS P0.20/MAT1.3/SSEL1/EINT3 - General purpose output
6 SCK P0.17/CAP1.2/SCK1/MAT1.2 - Alternate function 2
7 A0 P0.23/VBUS - General purpose output
ENC29J60 Interface
==================
PIN NAME PIN CONFIGURATION
1 /CS P0.7/SSEL0/PWM2/EINT2 - General purpose output
2 SCK P0.4/SCK0/CAP0.1/AD0.6 - Alternate function 1
3 SI P0.6/MOSI0/CAP0.2/AD1.0 - Alternate function 1
4 SO P0.5/MISO0/MAT0.1/AD0.7 - Alternate function 1
7 INT P1.25/EXTIN0 - Alternal function 1
9 RST P1.24/TRACECLK - General purpose output
Using OpenOCD and GDB with an FT2232 JTAG emulator
==================================================
Downloading OpenOCD
You can get information about OpenOCD here: http://openocd.berlios.de/web/
and you can download it from here. http://sourceforge.net/projects/openocd/files/.
To get the latest OpenOCD with more mature lpc214x, you have to download
from the GIT archive.
git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
At present, there is only the older, frozen 0.4.0 version. These, of course,
may have changed since I wrote this.
Building OpenOCD under Cygwin:
You can build OpenOCD for Windows using the Cygwin tools. Below are a
few notes that worked as of November 7, 2010. Things may have changed
by the time you read this, but perhaps the following will be helpful to
you:
1. Install Cygwin (http://www.cygwin.com/). My recommendation is to install
everything. There are many tools you will need and it is best just to
waste a little disk space and have everthing you need. Everything will
require a couple of gigbytes of disk space.
2. Create a directory /home/OpenOCD.
3. Get the FT2232 drivr from http://www.ftdichip.com/Drivers/D2XX.htm and
extract it into /home/OpenOCD/ftd2xx
$ pwd
/home/OpenOCD
$ ls
CDM20802 WHQL Certified.zip
$ mkdir ftd2xx
$ cd ftd2xx
$ unzip ..CDM20802\ WHQL\ Certified.zip
Archive: CDM20802 WHQL Certified.zip
...
3. Get the latest OpenOCD source
$ pwd
/home/OpenOCD
$ git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
You will then have the source code in /home/OpenOCD/openocd
4. Build OpenOCD for the FT22322 interface
$ pwd
/home/OpenOCD/openocd
$ ./bootstrap
Jim is a tiny version of the Tcl scripting language. It is needed
by more recent versions of OpenOCD. Build libjim.a using the following
instructions:
$ git submodule init
$ git submodule update
$ cd jimtcl
$ ./configure --with-jim-ext=nvp
$ make
$ make install
Configure OpenOCD:
$ ./configure --enable-maintainer-mode --disable-werror --disable-shared \
--enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=/home/OpenOCD/ftd2xx \
LDFLAGS="-L/home/OpenOCD/openocd/jimtcl"
Then build OpenOCD and its HTML documentation:
$ make
$ make html
The result of the first make will be the "openocd.exe" will be
created in the folder /home/openocd/src. The following command
will install OpenOCD to a standard location (/usr/local/bin)
using using this command:
$ make install
Helper Scripts.
I have been using the Olimex ARM-USB-OCD JTAG debugger with the
ZP213X/4XPA. OpenOCD requires a configuration file. I keep the
one I used last here:
configs/zpa214xpa/tools/olimex.cfg
However, the "correct" configuration script to use with OpenOCD may
change as the features of OpenOCD evolve. So you should at least
compare that olimex.cfg file with configuration files in
/usr/local/share/openocd/scripts/target (or /home/OpenOCD/openocd/tcl/target).
There is also a script on the tools/ directory that I use to start
the OpenOCD daemon on my system called oocd.sh. That script will
probably require some modifications to work in another environment:
- Possibly the value of OPENOCD_PATH and TARGET_PATH
- It assumes that the correct script to use is the one at
configs/zp214xpa/tools/olimex.cfg
Starting OpenOCD
Then you should be able to start the OpenOCD daemon like:
configs/zp214xpa/tools/oocd.sh $PWD
If you use the setenv.sh file, that the path to oocd.sh will be added
to your PATH environment variabl. So, in that case, the command simplifies
to just:
oocd.sh $PWD
Where it is assumed that you are executing oocd.sh from the top-level
directory where NuttX is installed. $PWD will be the path to the
top-level NuttX directory.
Connecting GDB
Once the OpenOCD daemon has been started, you can connect to it via
GDB using the following GDB command:
arm-nuttx-elf-gdb
(gdb) target remote localhost:3333
NOTE: The name of your GDB program may differ. For example, with the
CodeSourcery toolchain, the ARM GDB would be called arm-none-eabi-gdb.
After starting GDB, you can load the NuttX ELF file:
(gdb) symbol-file nuttx
(gdb) load nuttx
NOTES:
1. Loading the symbol-file is only useful if you have built NuttX to
include debug symbols (by setting CONFIG_DEBUG_SYMBOLS=y in the
.config file).
OpenOCD will support several special 'monitor' commands. These
GDB commands will send comments to the OpenOCD monitor. Here
are a couple that you will need to use:
(gdb) monitor reset
(gdb) monitor halt
NOTES:
1. The MCU must be halted using 'mon halt' prior to loading code.
2. Reset will restart the processor after loading code.
3. The 'monitor' command can be abbreviated as just 'mon'.
Configurations:
===============
Each NXP LPC214x configuration is maintained in a sudirectory and
can be selected as follow:
Each NXP LPC214x configuration is maintained in a sudirectory and
can be selected as follow:
cd tools
./configure.sh zp214xpa/<subdir>
cd -
. ./setenv.sh
Where <subdir> is one of the following:
Where <subdir> is one of the following:
nsh:
----
nsh:
----
Configures the NuttShell (nsh) located at examples/nsh. The
Configuration enables only the serial NSH interfaces.
Configures the NuttShell (nsh) located at examples/nsh. The
Configuration enables only the serial NSH interfaces.
NOTES:
@@ -131,6 +311,30 @@ nsh:
2. Default platform/toolchain:
CONFIG_HOST_LINUX=y : Windows
CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too).
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y : Buildroot (arm-nuttx-elf-gcc)
CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary
nxlines:
--------
This is the apps/examples/nxlines test using the UG_2864AMBAG01 board
from The0.net that plugs into the "SPI LCD" connector on the ZP3X4XPA
board.
NOTES:
1. This configuration uses the mconf-based configuration tool. To
change this configuration using that tool, you should:
a. Build and install the mconf tool. See nuttx/README.txt and
misc/tools/
b. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
2. Default platform/toolchain:
CONFIG_HOST_LINUX=y : Linux (Cygwin under Windows okay too).
CONFIG_ARM_TOOLCHAIN_GNU_EABI=y : Buildroot (arm-nuttx-elf-gcc)
CONFIG_RAW_BINARY=y : Output formats: ELF and raw binary
+128
View File
@@ -0,0 +1,128 @@
##############################################################################
# configs/zp214xpa/nxlines/Make.defs
#
# Copyright (C) 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
# The default value for CROSSDEV can be overridden from the make command line:
# make -- Will build for the NuttX buildroot toolchain
# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
# make CROSSDEV=arm-nuttx-elf- -- Will build for the NuttX buildroot toolchain
CROSSDEV = arm-nuttx-elf-
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
HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
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 ($(ARCHCCMAJOR),4)
ifneq ($(HOSTOS),Cygwin)
OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment
endif
endif
ifeq ($(CROSSDEV),arm-nuttx-elf-)
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
MAXOPTIMIZATION = -Os
else
WINTOOL = y
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}"
MAXOPTIMIZATION = -O2
endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -g
else
ARCHOPTIMIZATION = $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ifeq ($(ARCHCCMAJOR),4)
ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft
else
ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float
endif
ARCHCFLAGS = -fno-builtin
ARCHCXXFLAGS = -fno-builtin -fno-exceptions
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
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-gotoff.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
+65
View File
@@ -0,0 +1,65 @@
#!/bin/bash
# configs/zp214xpa/nxlines/setenv.sh
#
# Copyright (C) 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.
#
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 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"
# This is the Cygwin path to the location where I build the buildroot
# toolchain.
export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin"
# The zp214xpa/tools directory
export LPCTOOL_DIR="${WD}/configs/zp214xpa/tools"
# Add the path to the toolchain and tools directory to the PATH varialble
export PATH="${TOOLCHAIN_BIN}:${LPCTOOL_DIR}:/sbin:/usr/sbin:${PATH_ORIG}"
echo "PATH : ${PATH}"
+4
View File
@@ -49,6 +49,10 @@ ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS =
ifeq ($(CONFIG_LCD_UG2864AMBAG01),y)
CSRCS += up_ug2864ambag01.c up_spi1.c
endif
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,177 @@
/****************************************************************************
* config/zp214xpa/src/up_ug2864ambag01.c
* arch/arm/src/board/up_ug2864ambag01.c
*
* Copyright (C) 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/spi.h>
#include <nuttx/lcd/lcd.h>
#include <nuttx/lcd/ug-2864ambag01.h>
#include "up_arch.h"
#include "chip.h"
#include "lpc214x_pinsel.h"
#ifdef CONFIG_LCD_UG2864AMBAG01
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* The pin configurations here requires that SPI1 is avaialable */
/* SPI should be configured with CMD/DATA support (and no transfer methods) */
#ifndef CONFIG_SPI_CMDDATA
# error "The OLED driver requires CONFIG_SPI_CMDDATA in the configuration"
#endif
/* Pin Configuration ********************************************************/
/* UG-2864AMBAG01 OLED Display:
*
* PIN NAME PIN CONFIGURATION
* 1 3V3
* 2 5V
* 3 RESET P0.18/CAP1.3/MISO1/MAT1.3P0.18 RESET - General purpose output
* 4 DI P0.19/MAT1.2/MOSI1/CAP1.2P0.19 DI - Alternate function 2
* 5 CS P0.20/MAT1.3/SSEL1/EINT3 - General purpose output
* 6 SCK P0.17/CAP1.2/SCK1/MAT1.2 - Alternate function 2
* 7 A0 P0.23/VBUS - General purpose output
* 8 N/C LED-
* 9 N/C LED+ (BL)
* 10 GND
*
* Definitions and configuration for DO, DI, CS, in up_spi1.c
*/
/* Use either FIO or legacy GPIO */
#ifdef CONFIG_LPC214x_FIO
# define CS_SET_REGISTER (LPC214X_FIO0_BASE+LPC214X_FIO_SET_OFFSET)
# define CS_CLR_REGISTER (LPC214X_FIO0_BASE+LPC214X_FIO_CLR_OFFSET)
# define CS_DIR_REGISTER (LPC214X_FIO0_BASE+LPC214X_FIO_DIR_OFFSET)
#else
# define CS_SET_REGISTER (LPC214X_GPIO0_BASE+LPC214X_GPIO_SET_OFFSET)
# define CS_CLR_REGISTER (LPC214X_GPIO0_BASE+LPC214X_GPIO_CLR_OFFSET)
# define CS_DIR_REGISTER (LPC214X_GPIO0_BASE+LPC214X_GPIO_DIR_OFFSET)
#endif
/* Debug ********************************************************************/
#ifdef CONFIG_DEBUG_LCD
# define lcddbg(format, arg...) dbg(format, ##arg)
# define lcdvdbg(format, arg...) vdbg(format, ##arg)
#else
# define lcddbg(x...)
# define lcdvdbg(x...)
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_nxdrvinit
*
* Description:
* Called by NX initialization logic to configure the OLED.
*
****************************************************************************/
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno)
{
FAR struct spi_dev_s *spi;
FAR struct lcd_dev_s *dev;
uint32_t regval32;
uint32_t bits32;
/* Configure multiplexed pins as connected on the ZP213X/4XPA board:
*
* PINSEL1 P0.18/CAP1.3/MISO1/MAT1.3 Bits 4-5=00 for P0.18
*/
regval32 = getreg32(LPC214X_PINSEL1);
regval32 &= ~LPC214X_PINSEL1_P018_MASK;
regval32 |= LPC214X_PINSEL1_P018_GPIO;
putreg32(regval32, LPC214X_PINSEL1);
/* Set the RESET line low, putting the OLED into the reset state. */
bits32 = (1 << 18);
putreg32(bits32, CS_CLR_REGISTER);
regval32 = getreg32(CS_DIR_REGISTER);
putreg32(regval32 | bits32, CS_DIR_REGISTER);
/* Wait a bit then release the OLED from the reset state */
up_mdelay(20);
putreg32(bits32, CS_SET_REGISTER);
/* Get the SPI1 port interface */
spi = up_spiinitialize(1);
if (!spi)
{
lcddbg("Failed to initialize SPI port 1\n");
}
else
{
/* Bind the SPI port to the OLED */
dev = ug2864ambag01_initialize(spi, devno);
if (!dev)
{
lcddbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno);
}
else
{
lcdvdbg("Bound SPI port 1 to OLED %d\n", devno);
/* And turn the OLED on */
(void)dev->setpower(dev, CONFIG_LCD_MAXPOWER);
return dev;
}
}
return NULL;
}
#endif /* CONFIG_LCD_UG2864AMBAG01 */
+62
View File
@@ -0,0 +1,62 @@
# NXP LPC2148 ARM7TDMI
#daemon configuration
telnet_port 4444
gdb_port 3333
#interface
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG A"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0003
# Use RCLK. If RCLK is not available fall back to 500kHz.
#
# Depending on cabling you might be able to eek this up to 2000kHz.
jtag_rclk 500
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME lpc2148
}
if { [info exists CPUTAPID ] } {
set _CPUTAPID $CPUTAPID
} else {
set _CPUTAPID 0x4f1f0f0f
}
adapter_nsrst_delay 200
jtag_ntrst_delay 200
# NOTE!!! LPCs need reset pulled while RTCK is low. 0 to activate
# JTAG, power-on reset is not enough, i.e. you need to perform a
# reset before being able to talk to the LPC2148, attach is not possible.
reset_config trst_and_srst
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm7tdmi -chain-position $_TARGETNAME
$_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0
$_TARGETNAME configure -event reset-init {
# Force target into ARM state
arm core_state arm
# Do not remap 0x0000-0x0020 to anything but the flash (i.e. select
# "User Flash Mode" where interrupt vectors are _not_ remapped,
# and reside in flash instead).
#
# See section 7.1 on page 32 ("Memory Mapping control register") in
# "UM10139: Volume 1: LPC214x User Manual", Rev. 02 -- 25 July 2006.
# http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/user.manual.lpc2141.lpc2142.lpc2144.lpc2146.lpc2148.pdf
mwb 0xE01FC040 0x01
}
# flash bank <name> lpc2000 <base> <size> 0 0 <target#> <variant> <clock> [calc checksum]
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME lpc2000 0x0 0x7d000 0 0 $_TARGETNAME lpc2000_v2 14765 calc_checksum
+52
View File
@@ -0,0 +1,52 @@
#!/bin/sh
#
# See configs/zp214xpa/README.txt for information about
# this file.
TOPDIR=$1
USAGE="$0 <TOPDIR> [-d]"
if [ -z "${TOPDIR}" ]; then
echo "Missing argument"
echo $USAGE
exit 1
fi
# Assume that OpenOCD was installed and at /usr/local/bin. Uncomment
# the following to run directly from the build directory
#OPENOCD_PATH="/home/OpenOCD/openocd/src"
#TARGET_PATH="/home/OpenOCD/openocd/tcl"
OPENOCD_PATH="/usr/local/bin"
TARGET_PATH="/usr/local/share/openocd/scripts"
OPENOCD_EXE=openocd.exe
OPENOCD_CFG="${TOPDIR}/configs/zp214xpa/tools/olimex.cfg"
OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}"
if [ "X$2" = "X-d" ]; then
OPENOCD_ARGS=$OPENOCD_ARGS" -d3"
set -x
fi
if [ ! -d ${OPENOCD_PATH} ]; then
echo "OpenOCD path does not exist: ${OPENOCD_PATH}"
exit 1
fi
if [ ! -x ${OPENOCD_PATH}/${OPENOCD_EXE} ]; then
echo "OpenOCD does not exist: ${OPENOCD_PATH}/${OPENOCD_EXE}"
exit 1
fi
if [ ! -f ${OPENOCD_CFG} ]; then
echo "OpenOCD config file does not exist: ${OPENOCD_CFG}"
exit 1
fi
echo "Starting OpenOCD"
cd ${OPENOCD_PATH} || { echo "Failed to CD to ${OPENOCD_PATH}"; exit 1; }
${OPENOCD_EXE} ${OPENOCD_ARGS} &
echo "OpenOCD daemon started"
ps -ef | grep openocd
echo "In GDB: target remote localhost:3333"
@@ -0,0 +1,25 @@
https://www.olimex.com/dev/pdf/ARM/JTAG/Repair%20Procedure%20for%20OpenOcd-Rev.%20G%20drivers.pdf
Repair procedure for ARM-USB-OCD drivers
1. Uninstalling ARM-USB-OCD drivers
-------------------------------------
1.1. Connect your programmer/debugger to your computer, open Device Manager
and uninstall the drivers for ARM-USB-OCD.
1.2. After you have uninstalled ARM-USB-TINY driver from Device Manager,
disconnect the programmer from your computer.
1.3. Now you should download FTClean.exe from here:
http://www.ftdichip.com/Support/Utilities/FTClean.zip.
1.4. After download is complete extract the "*.zip" file, open folder FTClean,
and run FTClean.exe
1.5. Ror VID (Hex) select "Other". And after that fill the first box with 15ba
and "PID (Hex)" with 0004.
1.6. Press "Clean System" button. Make sure that all FTDI devices are
disconnected. (My require administrator privileges).
2. Re-installing the ARM-USB-OCD driver
---------------------------------------
2.1 Connect the programmer/debugger to the computer.
2.2 When prompted, browse to the C:\gccfd\DRIVERS\ARM-USB-OCD-DRIVER
directory and install. (A different driver is required for OpenOCD
0.4.0. That driver is available from the olimex.com web site).
+6
View File
@@ -178,6 +178,12 @@ config NXFONTS_CHARBITS
The number of bits in the character set. Current options are only 7 and 8.
The default is 7.
config NXFONT_MONO5X8
bool "Mono 5x8"
default n
---help---
Tiny mono-spaced 5x8 font (font ID FONTID_MONO5X8 = 18)
config NXFONT_SANS17X22
bool "Sans 17x22"
default n
+5
View File
@@ -113,6 +113,11 @@
#elif defined(CONFIG_NXFONT_SERIF38X49B)
# define NXFONT_DEFAULT FONTID_SERIF38X49B
/* Mono-space fonts */
#elif defined(CONFIG_NXFONT_MONO5X8)
# define NXFONT_DEFAULT FONTID_MONO5X8
#endif
/****************************************************************************