eCosPro® Reference Manual
Prev |  | Next

# Setup

## Name

Setup -- Preparing the phyCORE LPC2294 Board for eCos Development

## Overview

In a typical development environment, the phyCORE LPC2294 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-elf-gdb. Preparing the board therefore usually involves programming a suitable stubrom 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 configuration option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD and rebuilding the stubrom.

## Initial Installation

### Flash Installation

This process assumes that a Microsoft Windows machine with the Embedded Systems Academy Flash Magic utility is available.

Install Flash Magic from http://www.flashmagictool.com.

Connect the RS232 cable supplied with the phyCORE LPC2294 between port 0 of the phyCORE LPC2294 and the host PC. Apply power to the board and with the Boot button (S_1) held down, press and release the reset button (S_2). The board is now running a special NXP boot loader. Start Flash Magic and set the Communications section to select the appropraite serial port, 38400 baud, device LPC2294, 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 serial cable is connected correctly, that the board was booted with the Boot button (S_1) held down and that the correct communication parameters have been selected in Flash Magic.

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 that 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). Reset the board and RedBoot should start. The output should be similar to the following:

    +... Read from 0x801e0000-0x801fffff to 0x810e0000:
    ... Read from 0x801ff000-0x801fffff to 0x810df000:
    ... waiting for BOOTP information
    Ethernet eth0: MAC address 00:50:c2:32:ad:40
    IP: 10.0.0.200/255.255.255.0, Gateway: 10.0.0.3
    Default server: 10.0.0.102, DNS server IP: 10.0.0.1

    RedBoot(tm) bootstrap and debug environment [ROM]
    Non-certified release, version UNKNOWN - built 17:10:02, Dec  1 2004

    Platform: Phytec phyCORE LPC229x Board (ARM7TDMI)
    Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Copyright (C) 2003, 2004, 2005 eCosCentric Limited

    RAM: 0x81000000-0x81100000, [0x8100b1a8-0x810dd000] available
    FLASH: 0x80000000 - 0x801fffff 16 x 0x20000 blocks
    RedBoot>

If 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: 0x81010040, address range: 0x81010000-0x8102c04c
    RedBoot> go
    +Ethernet eth0: MAC address 00:50:c2:3b:aa:9d
    IP: 192.168.7.251/255.255.255.0, Gateway: 192.168.7.11
    Default server: 192.168.7.5
    DNS server IP: 192.168.7.11, DNS domain name: <null>

    RedBoot(tm) bootstrap and debug environment [RAM]
    eCosCentric certified release, version v2_0_105 - built 15:42:30, Dec  5 2008

    Platform: Phytec phyCORE LPC229x Board (ARM7TDMI)
    Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 eCosCentric Limited

    RAM: 0x81000000-0x81800000, [0x81035f90-0x817dd000] available
    FLASH: 0x00000000-0x0003dfff, 8 x 0x2000 blocks, 2 x 0x10000 blocks, 7 x 0x2000s
    FLASH: 0x80000000-0x80ffffff, 63 x 0x20000 blocks, 8 x 0x4000 blocks, 63 x 0x20s
    RedBoot> load -r -b %{freememlo} redboot_ROM.bin
    Raw file loaded 0x81036000-0x81053463, assumed entry at 0x81036000
    RedBoot> fis write -f 0x00000000 -b %{freememlo} -l 0x20000
    * CAUTION * about to program FLASH
                at 0x00000000..0x0001ffff from 0x81036000 - continue (y/n)? y
    ... Erase from 0x00000000-0x0001ffff: .........
    ... Program from 0x81036000-0x81056000 to 0x00000000: .........
    RedBoot> reset
    +Ethernet eth0: MAC address 00:50:c2:3b:aa:9d
    IP: 192.168.7.251/255.255.255.0, Gateway: 192.168.7.11
    Default server: 192.168.7.5
    DNS server IP: 192.168.7.11, DNS domain name: <null>

    RedBoot(tm) bootstrap and debug environment [ROM]
    eCosCentric certified release, version v2_0_105 - built 15:42:52, Dec  5 2008

    Platform: Phytec phyCORE LPC229x Board (ARM7TDMI)
    Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 eCosCentric Limited

    RAM: 0x81000000-0x81800000, [0x8100acc8-0x817dd000] available
    FLASH: 0x00000000-0x0003dfff, 8 x 0x2000 blocks, 2 x 0x10000 blocks, 7 x 0x2000s
    FLASH: 0x80000000-0x80ffffff, 63 x 0x20000 blocks, 8 x 0x4000 blocks, 63 x 0x20s
    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 are:

    $ mkdir redboot_phycore_rom
    $ cd redboot_phycore_rom
    $ ecosconfig new phycore_lpc2294 redboot
    $ ecosconfig import $ECOS_REPOSITORY/hal/arm/lpc2xxx/phycore_lpc229x/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`.

> Note: The PhyCORE LPC2294 board can be fitted with a wide range of flash and SRAM parts. So it may be necessary to adjust the configuration after importing the `redboot_ROM.ecm` file to match the hardware being used. The Memory Configuration section contains full details of the options available for this.

Prev | Home | Next
Overview | Up | Configuration