summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-10 18:44:31 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-10 18:44:31 +0000
commit8111a4c622a0a9002378c8dea4f436cdd02a8fc2 (patch)
treeb733906a1e02eed177c6482d30b34a5ef5df1d52
parentcd19f6d867bbe3da36b30f9897aeb3b65e0eee08 (diff)
downloadnuttx-6.1.tar.gz
nuttx-6.1.tar.bz2
nuttx-6.1.zip
Prep for 6.1 releasenuttx-6.1
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3489 42af7a65-404d-4744-a932-0658087f49c3
-rwxr-xr-xapps/ChangeLog.txt3
-rw-r--r--nuttx/ChangeLog4
-rw-r--r--nuttx/Documentation/NuttX.html225
-rw-r--r--nuttx/ReleaseNotes47
-rw-r--r--nuttx/configs/README.txt5
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/README.txt54
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/tools/flash.sh127
7 files changed, 341 insertions, 124 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index 3a4ca602e..fb89e46d5 100755
--- a/apps/ChangeLog.txt
+++ b/apps/ChangeLog.txt
@@ -15,7 +15,7 @@
the apps/ directory
* Moved exec_nuttapp machinery into the nuttapp/ directory.
-6.1 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
+6.1 2011-04-10 Gregory Nutt <spudmonkey@racsa.co.cr>
* Creation of auto-generated header files now occurs during the context
build phase.
@@ -26,3 +26,4 @@
* Numerous fixes to build system required to support building with native
Windows toolchain.
+6.2 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index a75e90d29..662d4ec34 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -1602,7 +1602,7 @@
* apps/vsn: Move all VSN apps to apps/vsn.
* nuttx/examples moved to apps/examples
-6.1 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
+6.1 2011-04-11 Gregory Nutt <spudmonkey@racsa.co.cr>
* arch/arm/include/lpc17xx/irq.h and arch/arm/src/lpc17xx/lpc17_gpio*.c:
Fix several bugs in the GPIO interrupt logic. Submited by
@@ -1664,5 +1664,7 @@
* configs/lpcxpresso-lpc1768: Add a board configuration for the Embedded
Artists LPCXpresso LPC1768 board.
+6.2 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
+
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index 891e619bb..88f0493d3 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
- <p>Last Updated: April 6, 2011</p>
+ <p>Last Updated: April 10, 2011</p>
</td>
</tr>
</table>
@@ -356,6 +356,14 @@
<td><br></td>
<td>
<p>
+ <li>May be built either as an open, flat embedded RTOS or as a separtely built, secure micro-kernel with a system call interface.</li>
+ </p>
+</tr>
+
+<tr>
+ <td><br></td>
+ <td>
+ <p>
<li>Well documented in the NuttX <a href="NuttxUserGuide.html">User Guide</a>.</li>
</p>
</tr>
@@ -807,67 +815,74 @@
</tr>
</table>
-<p><b>nuttx-6.0 Release Notes</b>:
+<p><b>nuttx-6.1 Release Notes</b>:
<p>
- The 67<sup>th</sup> release of NuttX, Version 6.0, was made on March 21, 2011 and is available for download from the
+ The 68<sup>th</sup> release of NuttX, Version 6.1, was made on April 10, 2011 and is available for download from the
<a href="http://sourceforge.net/projects/nuttx/files/">SourceForge</a> website.
The change log associated with the release is available <a href="#currentrelease">here</a>.
Unreleased changes after this release are available in SVN.
These unreleased changes are listed <a href="#pendingchanges">here</a>.
</p>
<p>
- The version number of this release was bumped from 5.19 to 6.0.
- A change in the major revision number is used to reflect an incompatibility with previous versions.
- In this release, the NuttX core OS functionality has been separated from NuttX application-related functionality.
- These are provided as separate tarballs:
+ The 6.0 release introduced a detach-able application environment to build applications outside of the NuttX source tree.
+ The primary purpose of this release is to correct numerous build problems introduced by that architectural change:
</p>
<ul>
- <li><code>nuttx-6.0.tar.gz</code>, and</li>
- <li><code>apps-6.0.tar.gz</code></li>
+ <li>
+ In many newer environments, NuttX produced strange Makefile errors but built correctly in older environments.
+ A fix provided by Rafael Norinha was incorporated and is reported to fix those build problems.
+ </li>
+ <li>
+ The <code>apps/</code> directory build system would not handle Windows-native toolchains due to obscure path formatting issues.
+ </li>
+ <li>
+ And other problems as detailed in the change log.
+ </li>
</ul>
+
<p>
- The purpose of this separation is both to better organize and modularize the NuttX source tree,
- but also to provide better support for incorporation of end-user applications with Nuttx.
+ Many additional changes were made in the 6.1 release for another major architectural change:
+ NuttX will now build as a seperately linked micro-kernel.
+ In this build option the RTOS builds as a kernel, applications build separtate and interface with kernel via system calls.
+ Applications run in user mode and kernel logic users in kernel-mode.
+ This provides a secure environment for NuttX.
+ This feature is fully coded in NuttX-6.1, but has not been tested due to higher priority tasks that have arisen.
</p>
<p>
- The incompatibily results from the changes to the board configuration logic needed to supported the separable application.
- The major changes to the configuration include:
+ Related to this change, support for the Cortex-M3 memory protection unit (MPU) has been integrated with the NuttX kernel build to provide an even higher level of security.
</p>
-<ul>
- <li><code>CONFIG_APPS_DIR</code> - This should not, typically be set.
- The default is <code>../apps</code>.
- This should only be set if you have a custom, product-specific application directory in some different location.
- </li>
- <li><code>appconfig</code> - Each board configuration now requires a new file called <code>appconfig</code>.
- As its name suggests, this file provides new configuration information needed by the logic in <code>../apps</code>.
- </li>
-</ul>
+<p><small>
+ NOTE: This kernel build is an option; the default build configuration is still the standard, flat, unsecured RTOS as in previous releases.
+</small></p>
<p>
- In addition to this major reorganization in the directory structure, this release also includes some important extensions to existing features and
- some important bugfixes.
- These include:
+ Additional new features in this release:
</p>
<ul>
<li>
- The SLIP driver was been well debugged and significantly re-designed.
- Now you can have an Ethernet connection to you board even if you have no Ethernet hardware.
- How cool is that?
+ Support for LPC17xx GPIO interrupts (with much support from Decio Renno).
</li>
<li>
- The QEMU i486 port is now functional.
- It has also been reported to work on the <a href="http://bifferos.bizhat.com/">Bifferboard</a>.
+ Basic timer support for STM32 (Contributed by Uros Platise)
</li>
<li>
- And extensions to the uIP driver interface, and
+ A binfs file system.
+ This is a tiny psuedo file system that lets named appliations to be viewed and accessed in NSH under the <code>/bin</code> directory.
</li>
<li>
- Bug fixes to <code>fopen()</code> and STM32 GPIO configuration
+ An I2C-based driver for the LIS331DL MEMS motion sensor (Contributed by Uros Platise).
</li>
<li>
+ A board configuration for the Embedded Artists LPCXpresso LPC1768 board.
+ </li>
+ <li>
+ The <code>user_initialize()</code> interface has been removed.
+ </li>
</ul>
+
<p>
- Please see the ChangeLog for details.
+ And several bugfix are included.
+ This includes chagnes associated with SD drivers, openddir(), signed 8-bit types (<code>int8_t</code>), and USB serial device. See the ChangeLog for details.
</p>
<table width ="100%">
@@ -1321,6 +1336,9 @@
<li>
The LPC1766-sTK board from <a href="http://www.olimex.com/">Olimex</a> (LPC1766).
</li>
+ <li>
+ The Embedded Artists base board with NXP LPCXpresso LPC1768.
+ </li>
</ul>
</p>
<p>
@@ -1388,6 +1406,15 @@
</ul>
</p>
<p>
+ <b>Embedded Artists base board with NXP LPCXpresso LPC1768</b>.
+ <ul>
+ <li>
+ An initial board configuration is included in NuttX-6.1.
+ However, certain Code Red download issues have not yet been resolved and the port has not yet been tested.
+ </li>
+ </ul>
+ </p>
+ <p>
Verified configurations are now available for the NuttX OS test,
for the NuttShell with networking and microSD support(NSH, see the <a href="ttp://www.nuttx.org/NuttShell.html">NSH User Guide</a>),
for the NuttX network test, for the <a href="http://acme.com/software/thttpd">THTTPD</a> webserver,
@@ -2068,94 +2095,7 @@ Other memory:
</table>
<ul><pre>
-nuttx-6.0 2011-03-21 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
-
- * lib/lib_fopen() -- fopen() was not returning the correct errno value
- when the underlying open() failed.
- * include/net/uip/uip-arch.h -- The uIP interface has been extended
- slightly so that drivers can be concurrenly filling and sending
- packet buffers. This capability was needed by the SLIP driver.
- * drivers/net/slip.c -- Several corrections and some re-design of
- of the driver.
- * apps/ChangeLog.txt -- the apps/ directory now has its own ChangeLog.
- * configs/vsn:
- - IDLE LED blinking fix
- - Added board power off function
- * arch/arm/src/stm32/stm32_gpio.c and stm32_internal.h -- Fixed
- PullUp/Down Input Configuration.
- * arch/arm/src/lpc17xx/lpc17_serial.h -- Now supports Auto-RTS and
- Auto-CTS modes. This is needed to support SLIP.
- * drivers/net/slip.c -- SLIP is now basically functional on the
- LPC17xx with some caveats as described in the TODO list under
- LPC17xx.
- * arch/x86/include/i486/irq.h -- Fix irqrestore() macro... it was not
- correctly re-enabling interrupts.
- * arch/x86/src - Fix numerous problems with i486/QEMU context
- switching. Basically, the logic was missing the cases to handle
- the differing stack frames when a priority change occurs and when
- no priority change occurs.
- * configs/qemu-i486/ostest and nsh -- The QEMU i486 port is complete.
- it now passes the OS test and supports the NuttShell (NSH).
- * misc/drivers -- Created a new directory to hold non-BSD licensed
- drivers that may be added into NuttX via an installation script.
- * drivers/usbhost/usbhost_rtl8187.c -- A decision was made to
- incorporate code taken from the Linux kernel. That changes the
- licensing on this module to GPL. To avoid licensing contamination,
- this driver was moved to misc/drivers/rtl8187x *prior* to adding
- and of the GPL log. There is an INSTALL.sh script at the location
- where the GPL driver(s) can be re-installed into the NuttX source
- tree. By re-installing the driver, you agree to the GPL licsensing
- and all of its implications.
- * Makefile, apps/Makefile, tools/configure.sh -- add logic to copy
- configs/&lt;board&gt;/&lt;config&gt;/appdir to apps/.config and to simply the
- application configuration logic.
- * examples/nsh and apps/nshlib - Move the core NuttShell (NSH) logic
- out of the exemples directory and into the apps/directory where
- it belongs.
- * apps/Makefile and configs/*/appconfig - Use '=' as the delimiter
- instead of '/' so that sub-directories in apps/ can be used.
- * apps/vsn - Move all VSN apps to apps/vsn.
- * nuttx/examples moved to apps/examples
-
-apps-6.0 2011-03-21 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
-
- * README.txt -- README cosmetics
- * hello/ -- hello world minor changes
- * Makefile -- Makefile cosmetics (I am slowly adding the Darjeeling JVM)
- * Make.defs -- New file adds common make definitions for applications.
- * hello/Makefile -- Now uses new Make.defs definitions. Added README.txt.
- * apps/poweroff -- New application to turn off board power.
-
-pascal-2.0 2009-12-21 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
-
- * Updated to use standard C99 types in stdint.h and
- stdbool.h. This change was necessary for compatibility
- with NuttX-5.0 (any beyond).
-
-buildroot-1.9 2011-02-10 &lt;spudmonkey@racsa.co.cr&gt;
-
- * configs/arm926t-defconfig-4.3.3: update arm926t-defconfig-4.2.4
- * configs/arm926t-defconfig-nxflat: NXFLAT-only configuration for
- arm926
- * toolchain/gdb/gdb.mk - Remove ncurses dependency from gdb_target target.
- * toolchain/gdb/gdb.mk - Added --disable-werror to GDB configuration line.
- GDB 6.8 won't build because the tarbal was released with -Werror enabled and
- the build stops on the first warning.
- * Add support for Freescale m9s12x using binutils 2.18 and gcc 3.3.6 and
- patches available from http://www.msextra.com/tools courtesy of James
- Cortina. Add configs/m9x12x-defconfig-3.3.6.
-</pre></ul>
-
-<table width ="100%">
- <tr bgcolor="#e4e4e4">
- <td>
- <a name="pendingchanges">Unreleased Changes</a>
- </td>
- </tr>
-</table>
-
-<ul><pre>
-nuttx-6.1 2011-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
+nuttx-6.1 2011-04-10 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* arch/arm/include/lpc17xx/irq.h and arch/arm/src/lpc17xx/lpc17_gpio*.c:
Fix several bugs in the GPIO interrupt logic. Submited by
@@ -2210,8 +2150,14 @@ nuttx-6.1 2011-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
(usually called current_regs) should be marked volatile; Added general
capability to support nested interrupts (not fully realized for all
architectures).
+ * sched/task_create.c: Add support for starting kernel-mode thread.
+ * drivers/usbdev/usbdev_serial.c: Fix reported by Sheref Younan. USB
+ was being reset after serial driver was closed. As a result, you could
+ no reopen the serial driver.
+ * configs/lpcxpresso-lpc1768: Add a board configuration for the Embedded
+ Artists LPCXpresso LPC1768 board.
-apps-6.1 2011-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
+apps-6.1 2011-04-10 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* Creation of auto-generated header files now occurs during the context
build phase.
@@ -2219,6 +2165,41 @@ apps-6.1 2011-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* Renamed nuttapp to namedapp
* namedapp/binfs.c -- Create a tiny filesystem that can be used
to show the internal named apps under /bin.
+ * Numerous fixes to build system required to support building with native
+ Windows toolchain.
+
+pascal-2.0 2009-12-21 Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
+
+ * Updated to use standard C99 types in stdint.h and
+ stdbool.h. This change was necessary for compatibility
+ with NuttX-5.0 (any beyond).
+
+buildroot-1.9 2011-02-10 &lt;spudmonkey@racsa.co.cr&gt;
+
+ * configs/arm926t-defconfig-4.3.3: update arm926t-defconfig-4.2.4
+ * configs/arm926t-defconfig-nxflat: NXFLAT-only configuration for
+ arm926
+ * toolchain/gdb/gdb.mk - Remove ncurses dependency from gdb_target target.
+ * toolchain/gdb/gdb.mk - Added --disable-werror to GDB configuration line.
+ GDB 6.8 won't build because the tarbal was released with -Werror enabled and
+ the build stops on the first warning.
+ * Add support for Freescale m9s12x using binutils 2.18 and gcc 3.3.6 and
+ patches available from http://www.msextra.com/tools courtesy of James
+ Cortina. Add configs/m9x12x-defconfig-3.3.6.
+</pre></ul>
+
+<table width ="100%">
+ <tr bgcolor="#e4e4e4">
+ <td>
+ <a name="pendingchanges">Unreleased Changes</a>
+ </td>
+ </tr>
+</table>
+
+<ul><pre>
+nuttx-6.2 2011-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
+
+apps-6.1 2011-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
pascal-2.1 2011-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
diff --git a/nuttx/ReleaseNotes b/nuttx/ReleaseNotes
index cd9ac5277..eadffaab4 100644
--- a/nuttx/ReleaseNotes
+++ b/nuttx/ReleaseNotes
@@ -1777,3 +1777,50 @@ important bugfixes. These include:
Please see the ChangeLog for details.
+nuttx-6.1
+^^^^^^^^^
+
+The 68th release of NuttX, Version 6.1, was made on April 10, 2011 and is
+available for download from the SourceForge website. The 6.0 release
+introduced a detach-able application environment to build applications
+outside of the NuttX source tree. The primary purpose of this release
+is to correct numerous build problems introduced by that architectural
+change:
+
+ * In many newer environments, NuttX produced strange Makefile errors
+ but built correctly in older environments. A fix provided by
+ Rafael Norinha was incorporated and is reported to fix those build
+ problems.
+ * The apps/ directory build system would not handle Windows-native
+ toolchains due to obscure path formatting issues.
+ * And other problems as detailed in the change log.
+
+Many additional changes were made in the 6.1 release for another major
+architectural change: NuttX will now build as a seperately linked micro-
+kernel. In this build option the RTOS builds as a kernel, applications
+build separtate and interface with kernel via system calls. Applications
+run in user mode and kernel logic users in kernel-mode. This provides a
+secure environment for NuttX. This feature is fully coded in NuttX-6.1,
+but has not been tested due to higher priority tasks that have arisen.
+
+Related to this change, support for the Cortex-M3 memory protection unit (MPU) has
+been integrated with the NuttX kernel build to provide an even higher level
+of security.
+
+NOTE: This kernel build is an option; the default build configuration is
+still the standard, flat, unsecured RTOS as in previous releases.
+
+Additional new features in this release:
+
+ * Support for LPC17xx GPIO interrupts (with much support from Decio Renno).
+ * Basic timer support for STM32 (Contributed by Uros Platise)
+ * A binfs file system. This is a tiny psuedo file system that lets
+ named appliations to be viewed and accessed in NSH under the /bin
+ directory.
+ * An I2C-based driver for the LIS331DL MEMS motion sensor (Contributed
+ by Uros Platise).
+ * A board configuration for the Embedded Artists LPCXpresso LPC1768 board.
+ * The user_initialize() interface has been removed.
+
+And several bugfix associated with SD drivers, openddir(), signed 8-bit types
+(int8_t), and USB serial device. See the ChangeLog for details.
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
index 5986f9c60..6c0cf7768 100644
--- a/nuttx/configs/README.txt
+++ b/nuttx/configs/README.txt
@@ -981,6 +981,11 @@ configs/lm3s6965-ek
an ARM Cortex-M3 MCU, the Luminary/TI LM3S6965. This OS is built with the
arm-elf toolchain*. STATUS: This port is complete and mature.
+configs/lpcxpresso-lpc1768
+ Embedded Artists base board with NXP LPCExpresso LPC1768. This board
+ is based on the NXP LPC1768. The Code Red toolchain is used by default.
+ STATUS: Under development.
+
configs/m68322evb
This is a work in progress for the venerable m68322evb board from
Motorola. This OS is also built with the arm-elf toolchain*. STATUS:
diff --git a/nuttx/configs/lpcxpresso-lpc1768/README.txt b/nuttx/configs/lpcxpresso-lpc1768/README.txt
index 11bb0cc6e..403864aa6 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/README.txt
+++ b/nuttx/configs/lpcxpresso-lpc1768/README.txt
@@ -215,6 +215,60 @@ Code Red IDE
/cygdrive/c/nxp/lpcxpreeso_3.6/bin, and
/cygdrive/c/nxp/lpcxpreeso_3.6/Tools/bin
+ Command Line Flash Programming
+ ------------------------------
+
+ If using LPCLink as your debug connection, first of all boot the LPC-Link using
+ the script:
+
+ bin\Scripts\bootLPCXpresso type
+
+ where type = winusb for Windows XP, or type = hid for Windows Vista / 7.
+
+ Now run the flash programming utility with the following options
+
+ flash_utility wire -ptarget -flash-load[-exec]=filename [-load-base=base_address]
+
+ Where flash_utility is one of:
+
+ crt_emu_lpc11_13 (for LPC11xx or LPC13xx parts)
+ crt_emu_cm3_nxp (for LPC17xx parts)
+ crt_emu_a7_nxp (for LPC21/22/23/24 parts)
+ crt_emu_a9_nxp (for LPC31/32 and LPC29xx parts)
+ crt_emu_cm3_lmi (for TI Stellaris LM3S parts
+
+ wire is one of:
+
+ (empty) (for Red Probe+, Red Probe, RDB1768v1, or TI Stellaris evaluation boards)
+ -wire=hid (for RDB1768v2 without upgraded firmware)
+ -wire=winusb (for RDB1768v2 with upgraded firmware)
+ -wire=winusb (for LPC-Link on Windows XP)
+ -wire=hid (for LPC-Link on Windows Vista/ Windows 7)
+
+ target is the target chip name. For example LPC1343, LPC1114/301, LPC1768 etc.
+
+ filename is the file to flash program. It may be an executable (axf) or a binary
+ (bin) file. If using a binary file, the base_address must be specified.
+
+ base_address is the base load address when flash programming a binary file. It
+ should be specified as a hex value with a leading 0x.
+
+ Note:
+ - flash-load will leave the processor in a stopped state
+ - flash-load-exec will start execution of application as soon as download has
+ completed.
+
+ Examples
+ To load the executable file app.axf and start it executing on an LPC1758
+ target using Red Probe, use the following command line:
+
+ crt_emu_cm3_nxp -pLPC1758 -flash-load-exec=app.axf
+
+ To load the binary file binary.bin to address 0x1000 to an LPC1343 target
+ using LPC-Link on Windows XP, use the following command line:
+
+ crt_emu_lpc11_13_nxp -wire=hid -pLPC1343 -flash-load=binary.bin -load-base=0x1000
+
NuttX buildroot Toolchain
^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/nuttx/configs/lpcxpresso-lpc1768/tools/flash.sh b/nuttx/configs/lpcxpresso-lpc1768/tools/flash.sh
new file mode 100755
index 000000000..4d9f0b777
--- /dev/null
+++ b/nuttx/configs/lpcxpresso-lpc1768/tools/flash.sh
@@ -0,0 +1,127 @@
+#!/bin/bash
+####################################################################################
+# flash.sh
+#
+# Copyright (C) 2011 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.
+#
+####################################################################################
+
+USAGE="$0 <nuttx-path>"
+echo "Assumptions:"
+echo ""
+echo " - Windows 7"
+echo " - LPCXpresso 4.6 installed at /cygdrive/c/nxp/lpcxpresso_3.6"
+echo " - AXF image built with Code Red"
+echo " - LPC17xx"
+echo ""
+echo "You will need to edit this is any of the above are false"
+
+# This is the default install location for binaries on Linux
+#BINDIR=/usr/local/LPCXpresso/bin/dfu-util
+
+# This is the default install location for binaries on Windows (note that this
+# path could change with the Code Red version number
+BINDIR=/cygdrive/c/nxp/lpcxpresso_3.6/bin
+
+# This is the default install location for DFUAPP.exe on Windows
+DFUAPP="$BINDIR/DFUAPP.exe"
+
+# ROM image for resetting LPC-Link
+# ROM=LPCXpressoWIN.enc # WinUSB
+# ROM=LPCXpressoFS.enc # Win2000
+# ROM=LPCXpressoFS.enc # WinXP
+# ROM=LPCXpressoFS.enc # Win2003
+# ROM=LPCXpressoHS.enc # WinVista
+ROM=LPCXpressoHS.enc # Win7
+
+ROMPATH=`cygpath -w "$BINDIR/$ROM"`
+
+# FLASHUTIL="$BINDIR/crt_emu_lpc11_13" # for LPC11xx or LPC13xx parts)
+FLASHUTIL="$BINDIR/crt_emu_cm3_nxp" # for LPC17xx parts
+# FLASHUTIL="$BINDIR/crt_emu_a7_nxp" # for LPC21/22/23/24 parts)
+# FLASHUTIL="$BINDIR/crt_emu_a9_nxp" # for LPC31/32 and LPC29xx parts)
+# FLASHUTIL="$BINDIR/crt_emu_cm3_lmi" # for TI Stellaris LM3S parts
+
+if [ ! -x "$FLASHUTIL" ]; then
+ echo "No executable file at ${FLASHUTIL}"
+ exit 1
+fi
+
+# unset WIRE # for Red Probe+, Red Probe, RDB1768v1, or TI Stellaris evaluation boards
+# WIRE="-wire=hi" # for RDB1768v2 without upgraded firmware)
+# WIRE="-wire=winusb" # for RDB1768v2 with upgraded firmware)
+# WIRE="-wire=winusb" # for LPC-Link on Windows XP)
+WIRE="-wire=hid" # for LPC-Link on Windows Vista/ Windows 7)
+
+TARGET=LPC1768
+#TARGET=NXP_dir_part_LPC17
+
+# The nuttx directory must be provided as an argument
+
+NUTTX=$1
+if [ -z "${NUTTX}" ]; then
+ echo "Missing argument"
+ echo $USAGE
+ exit 1
+fi
+
+if [ ! -d "${NUTTX}" ]; then
+ echo "Directory ${NUTTX} does not exist"
+ echo $USAGE
+ exit 1
+fi
+
+# The binary to download:
+
+if [ ! -f "${NUTTX}/nuttx.axf" ]; then
+ if [ -f "${NUTTX}/nuttx" ]; then
+ echo "Renaming ${NUTTX}/nuttx to ${NUTTX}/nuttx.axf"
+ mv ${NUTTX}/nuttx ${NUTTX}/nuttx.axf
+ fi
+else
+ if [ -f "${NUTTX}/nuttx" ]; then
+ echo "Both ${NUTTX}/nuttx ${NUTTX}/nuttx.axf exist.."
+ echo " Deleting ${NUTTX}/nuttx.axf"
+ rm -f ${NUTTX}/nuttx.axf
+ echo "Renaming ${NUTTX}/nuttx to ${NUTTX}/nuttx.axf"
+ mv ${NUTTX}/nuttx ${NUTTX}/nuttx.axf
+ fi
+fi
+
+# First of all boot the LPC-Link using the script:
+
+#${DFUAPP} /f ${ROMPATH} /tl 250 dfuapp.log
+
+# Then program the FLASH
+
+#${FLASHUTIL} ${WIRE} -p${TARGET} -flash-load="${NUTTX}/nuttx.axf"
+${FLASHUTIL} -p${TARGET} -flash-load="${NUTTX}/nuttx.axf"
+