Documentation/Setting-up-downloader : quickie guide to setting up lpc21isp
Copyright (c) 2005-2007 Garth Zeglin

This file is part of ArtLPC, distributed under the terms of
the GNU General Public License version 2 or later.

/****************************************************************/

The LPC2xxx can be reprogrammed by downloading a memory image across a
normal serial port into the on-chip FLASH, where it will then run at
every reset or power-up.  This process requires a downloader program
to communicate with the bootloader after some manual intervention to
trigger bootloader execution.  nxp/Philips offers a free downloader
for Windows, but this document describes the setup for the open source
downloader lpc21isp.

Recent versions of the lpc21isp source code can be found on the files
section of the related Yahoo group at http://groups.yahoo.com/group/lpc21isp.

As an example of its use, the procedure for downloading a new image to
the LPC2103 internal FLASH on the Olimex LPC-P2103 board is to move
the BSL jumper to the closed position, reset the board, then run
lpc21isp.  When P0.14/BSL is held low at reset, the bootloader will
take control and wait for the programming handshake.  One jumper pulls
P0.14/BSL low.  The other enables automatically resetting the chip
using the DTR serial port line, which is not necessary if the chip is
manually reset.  After lpc21isp is done, move both jumpers back to the
open position and reset the board again or power cycle it, and the new
code will run from FLASH.

lpc21isp needs to know the clock rate and the port to use.  Here's a sample 
set of command switches:

  lpc21isp-1.37 -control balancer.hex /dev/cu.USA19QWb13P1.1 115200 14746

Compiling lpc21isp from the command line is straightforward, although
an entirely manual process (no autoconf or makefile).  Here is an
example for the 1.37 version:

 mkdir lpc21isp-1.37                    create a directory for the files
 cd lpc21isp-1.37
 unzip ../lpc21isp_137.zip              unpack it (you may need your specific path to the zip file)

 cc -o lpc21isp-1.37 lpc21isp.c         compile using your normal system C compiler
 
 cp lpc21isp-1.37 /usr/local/arm/bin    install to your ARM tools directory







