Setup -- Preparing the LPC2468 OEM Board for eCos Development
Overview
In a typical development environment, the LPC2468 OEM Board boots from
internal flash into RedBoot. eCos applications are
configured for RAM startup and then downloaded and run on the board
via the debugger arm-eabi-gdb. Preparing the board
therefore usually involves programming a suitable RedBoot image into
flash memory.
The following RedBoot configurations are supported:
Configuration
Description
Use
File
ROM
RedBoot running from ROM
redboot_ROM.ecm
redboot_ROM.hex
RAM
RedBoot running from RAM
redboot_RAM.ecm
redboot_RAM.srec
For serial communications, all versions run with 8 bits, no parity, and
1 stop bit at 38400 baud. This baud rate can be changed via the
RedBoot baud command.
Initial Installation
Flash Installation
This process assumes that a Microsoft Windows machine with the
Embedded Systems Academy Flash Magic utility is available.
The first step is to set up the board as described in the Embedded
Artists documentation. Install the FTDI USB driver from http://www.ftdichip.com/Drivers/VCP.htm
and configure it as described in the Embedded Artists documentation.
Install Flash Magic from http://www.flashmagictool.com.
Install the ISP jumpers (P2.10 and RESET) and press the reset button.
The board is now running a special NXP boot loader.
Start Flash Magic
and set the Communications section to select the FTDI USB device,
38400 baud, device LPC2468, Interface “None (ISP)” and 12MHz Oscillator
Frequency.
Test communication with the board by using the “ISP->Read
Device Signature” menu entry.
If communication is not successful, check that the USB cable is
connected, the ISP jumpers are installed and the correct COM port is being
used.
Check “Erase blocks used by Hex File” under
“Erase”. In the “Hex File” section, select
the redboot_ROM.hex file. Under
“Options”, all boxes should be clear except “Verify
after programming”. Now press the “Start”
button. The utility should show the progress of the upload.
When the process completes, the utility should be closed. Verify the
programming has been successful by starting a terminal emulation
application such as HyperTerminal or minicom on the host PC and set
the serial communication parameters to 38400 baud, 8 data bits, no
parity, 1 stop bit (8N1) and no flow control (handshaking). Remove the
ISP jumpers. Reset the
board and RedBoot should start. The output should be similar to
the following:
+**Warning** FLASH configuration checksum error or invalid key
Use 'fconfig -i' to [re]initialize database
Ethernet eth0: MAC address 0e:00:00:ea:18:f0
IP: 10.0.2.8/255.0.0.0, Gateway: 10.0.0.3
Default server: 0.0.0.0, DNS server IP: 10.0.0.1
RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version UNKNOWN - built 17:48:38, Mar 10 2008
Platform: Embedded Artists LPC2468 OEM Board (ARM7TDMI)
Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 eCosCentric Limited
RAM: 0xa0000000-0xa2000000, [0xa000ac08-0xa1fed000] available
FLASH: 0x00000000-0x0007dfff, 8 x 0x1000 blocks, 14 x 0x8000 blocks, 6 x 0x1000s
FLASH: 0x80000000-0x803fffff, 64 x 0x10000 blocks
RedBoot>
It is now necessary to initialize the flash file system and the flash
configuration. This can be done with the following commands:
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0x803f0000-0x803fffff: .
... Program from 0xa1ff0000-0xa2000000 to 0x803f0000: .
RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)? y
Run script at boot: false
Use BOOTP for network configuration: true
Default server IP address: 10.0.1.2
Console baud rate: 38400
DNS server IP address: 10.0.0.1
Network hardware address [MAC] for eth0: 0x0E:0x00:0x00:0xEA:0x18:0xF0
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Default network device: lpc2xxx
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0x803f0000-0x803fffff: .
... Program from 0xa1ff0000-0xa2000000 to 0x803f0000: .
RedBoot>
Replace the IP addresses in the above with those for your own
network. The above also accepts the default for the MAC address, if
more than one LPC2468 is to be used on the same network then different
MAC addresses should be used; Embedded Artists boards are supplied
with a sticker showing an assigned MAC address, and this should be
used by preference.
It is it ever necessary to reinstall RedBoot, the above directions can
be repeated. Alternatively, a new RedBoot may be installed from
RedBoot itself. It is not possible to do this directly, since RedBoot
is executing from the flash that needs to be erased and
reprogrammed. Instead it is necessary to run a RAM version of RedBoot,
use that to download the new ROM RedBoot to RAM, and then program that
to flash.
The following shows an example session to do this. It assumes that
redboot_RAM.srec and
redboot_ROM.bin are available via TFTP on the
server set up in fconfig.
RedBoot> load redboot_RAM.srec
Using default protocol (TFTP)
Entry point: 0xa0100040, address range: 0xa0100000-0xa011bab4
RedBoot> go
+Ethernet eth0: MAC address 0e:00:00:ea:18:f0
IP: 10.0.2.8/255.0.0.0, Gateway: 10.0.0.3
Default server: 10.0.1.2, DNS server IP: 10.0.0.1
RedBoot(tm) bootstrap and debug environment [RAM]
Non-certified release, version UNKNOWN - built 11:00:52, Mar 11 2008
Platform: Embedded Artists LPC2468 OEM Board (ARM7TDMI)
Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 eCosCentric Limited
RAM: 0xa0000000-0xa2000000, [0xa0125a28-0xa1fed000] available
FLASH: 0x00000000-0x0007dfff, 8 x 0x1000 blocks, 14 x 0x8000 blocks, 6 x 0x1000s
FLASH: 0x80000000-0x803fffff, 64 x 0x10000 blocks
RedBoot> load -r -b %{freememlo} redboot_ROM.bin
Using default protocol (TFTP)
Raw file loaded 0xa0125c00-0xa0142ba3, assumed entry at 0xa0125c00
RedBoot> fis write -f 0x00000000 -b %{freememlo} -l 0x20000
* CAUTION * about to program FLASH
at 0x00000000..0x0001ffff from 0xa0125c00 - continue (y/n)? y
... Erase from 0x00000000-0x0001ffff: ...........
... Program from 0xa0125c00-0xa0145c00 to 0x00000000: ...........
RedBoot> reset
+Ethernet eth0: MAC address 0e:00:00:ea:18:f0
IP: 10.0.2.8/255.0.0.0, Gateway: 10.0.0.3
Default server: 10.0.1.2, DNS server IP: 10.0.0.1
RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version UNKNOWN - built 11:04:34, Mar 11 2008
Platform: Embedded Artists LPC2468 OEM Board (ARM7TDMI)
Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 eCosCentric Limited
RAM: 0xa0000000-0xa2000000, [0xa000ac08-0xa1fed000] available
FLASH: 0x00000000-0x0007dfff, 8 x 0x1000 blocks, 14 x 0x8000 blocks, 6 x 0x1000s
FLASH: 0x80000000-0x803fffff, 64 x 0x10000 blocks
RedBoot>
Rebuilding RedBoot
Should it prove necessary to rebuild the RedBoot binary, this is done
most conveniently at the command line. Assuming your PATH and
ECOS_REPOSITORY environment variables have been set correctly,
the steps needed to rebuild RedBoot for the LPC2468-16 are:
$ mkdir redboot_ealpc2468_rom
$ cd redboot_ealpc2468_rom
$ ecosconfig new ea_lpc2468_16 redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/arm/lpc2xxx/ea_lpc2468/VERSION/misc/redboot_ROM.ecm
$ ecosconfig resolve
$ ecosconfig tree
$ make
At the end of the build the install/bin subdirectory should contain
the file redboot.hex.
Substitute 32 for 16 in the above to build RedBoot for the LPC2468-32 module.