eCosPro® Reference Manual
Prev |  | Next

# Setup

## Name

Setup -- Preparing the STR710-EVAL Board for eCos Development

## Overview

In a typical development environment, the STR710-EVAL board boots from external flash into RedBoot. eCos applications are configured for RAM startup and then downloaded and run on the board via the debugger arm-elf-gdb.

The following RedBoot configurations are supported:

Configuration | Description | Use | File
--- | --- | --- | ---
ROM | RedBoot running from external FLASH | redboot_ROM.ecm | redboot_ROM.bin
ROM_INT | RedBoot running from internal FLASH | redboot_ROM_INT.ecm | redboot_ROM_INT.bin
ROM_INT_EXTRAM | RedBoot running from internal FLASH, using external RAM for DATA, BSS and heap | redboot_ROM_INT_EXTRAM.ecm | redboot_ROM_INT_EXTRAM.bin
RAM | RedBoot running from external RAM | redboot_RAM.ecm | redboot_RAM.bin
JTAG | RedBoot running from external RAM, loaded via JTAG | redboot_JTAG.ecm | redboot_JTAG.bin

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.

Under normal circumstances, RedBoot runs in-place from the external Flash. The RAM version is provided to allow for updating the resident RedBoot image in Flash. The JTAG version is only used if loading RedBoot into RAM via a JTAG debugger or ICE. It is similar to the RAM version, but loads at a lower address within RAM, and so can be used to load eCos applications, as if it is the normal resident boot monitor. The ELF format image of this JTAG version of RedBoot can also be loaded and executed from GDB using the Abatron BDI2000 bdiGDB support, to allow it to be debugged. The ROM_INT version does not contain support for the flash filesystem or flash config since it uses only internal RAM, which is not large enough for the necessary data structures. The ROM_INT_EXTRAM version uses external RAM instead of internal RAM and is therefore able to contain a full implementation of the flash filesystem and configuration.

## Initial Installation

Two mechanisms are described below to program RedBoot into the external Flash. Both of them require a JTAG device. In the following documentation it is assumed that the Abatron BDI2000 is being used. For a different JTAG device, equivalent operations will need to be performed.

### Preparing the Abatron BDI2000 JTAG debugger

The BDI2000 must first be configured to allow communication with your local network, and configured with the parameters for interfacing with the target board. The following steps should be followed:

1. Prepare a PC to act as a host PC and start a TFTP server on it.

2. Connect the Abatron BDI2000 JTAG debugger via both serial and ethernet to the host PC and power it on. Use the serial cable supplied with the BDI2000.

3. Install the Abatron BDI2000 bdiGDB support software on the host PC.

4. Locate the file `bdi2000.str710eval.cfg` within the eCos platform HAL package in the source repository. This will be in the directory `packages/hal/arm/str710eval/VERSION/misc` relative to the root of your eCos installation.

5. Place the bdi2000.str710eval.cfg file in a location on the PC accessible to the TFTP server. Later you will configure the BDI2000 to load this file via TFTP as its configuration file.

6. Install and configure the Abatron BDI2000 in line with the bdiGDB instruction manual. Configure the BDI2000 to use the `bdi2000.str710eval.cfg` configuration file at the appropriate point of this process.

### Preparing the STR710-EVAL board for programming

Follow the steps in this section in order to allow communication between the board and the host PC, and between the board and the JTAG device.

1. First you must connect a null modem DB9 serial cable between the Serial Debug Port on the board and a serial port on the host computer.

2. Start a suitable terminal emulator on the host computer such as minicom or HyperTerminal. Set the communication parameters to 38400 baud, 8 data bits, no parity bit and 1 stop bit with no flow control.

3. Connect the board to the BDI2000 using a 20-pin ARM/Xscale cable from the JTAG interface connector to the Target A port on the BDI2000.

4. Locate switches SW13, SW14 and SW15 on the board, they are in a bank of 3 next to the processor. Set all these switches to the 2-3 position, this is the position away from the processor. In due course this will ensure that the board boots RedBoot from the external Flash device.

5. Power up the STR710-EVAL board.

6. Connect to the BDI2000's CLI interface via TCP/IP on the standard telnet port 23. The telnet application is suitable for this. You should see usage information followed by the prompt:

       Core#0>

7. Confirm correct connection with the BDI2000 with the reset command as follows:

       Core#0> reset
       - TARGET: processing reset request
       - TARGET: BDI asserts TRST and RESET
       - TARGET: BDI removes TRST
       - TARGET: Bypass check 0x00000001 => 0xFFFFFFFF
       - TARGET: JTAG exists check failed
       - TARGET: Remove RESET and try again
       - TARGET: BDI waits for RESET inactive
       - TARGET: Bypass check 0x00000001 => 0x00000001
       - TARGET: JTAG exists check passed
       - Core#0: ID code is 0x3F0F0F0F
       - TARGET: All ICEBreaker access checks passed
       - TARGET: BDI removes RESET
       - TARGET: BDI waits for RESET inactive
       - TARGET: resetting target passed
       - TARGET: processing target startup ....
       - TARGET: processing target startup passed
       Core#0>

8. Locate the `redboot_ROM.bin` image within the `loaders` subdirectory of the base of the eCos installation.

9. Copy the `redboot_ROM.bin` file into a location on the host computer accessible to its TFTP server.

### Method 1 - Using the BDI2000 to directly program RedBoot into Flash

As previously mentioned, there are two methods of programming a RedBoot image into the parallel NOR Flash. This method uses the built-in capabilities of the BDI2000.

This is a three stage process. The relevant Flash blocks must first be unlocked, then erased, and finally programmed. This can be accomplished with the following steps:

1. Connect to the BDI2000 telnet port as before.

2. Cut and paste the following commands into the BDI2000 telnet session. They are used to unlock the relevant Flash blocks that will contain RedBoot.

       Core#0>unlock 0x60000000 0x2000 8
       Unlocking flash at 0x60000000
       Unlocking flash at 0x60002000
       Unlocking flash at 0x60004000
       Unlocking flash at 0x60006000
       Unlocking flash at 0x60008000
       Unlocking flash at 0x6000a000
       Unlocking flash at 0x6000c000
       Unlocking flash at 0x6000e000
       Unlocking flash passed
       Core#0>unlock 0x60010000 0x10000 2
       Unlocking flash at 0x60010000
       Unlocking flash at 0x60020000
       Unlocking flash passed

3. Erase the 8 initial 8Kbyte sized Flash blocks, and the following 2 64Kbyte Flash blocks with the following command (the blocks to erase are defined in the .cfg file):

       Core#0>erase
       Erasing flash at 0x60000000
       Erasing flash at 0x60002000
       Erasing flash at 0x60004000
       Erasing flash at 0x60006000
       Erasing flash at 0x60008000
       Erasing flash at 0x6000a000
       Erasing flash at 0x6000c000
       Erasing flash at 0x6000e000
       Erasing flash at 0x60010000
       Erasing flash at 0x60020000
       Erasing flash passed
       Core#0>

4. Program the RedBoot image into Flash with the following command, replacing /RBPATH with the location of the redboot_ROM.bin file relative to the TFTP server root directory:

       Core#0>prog 0x60000000 /RBPATH/redboot_ROM.bin bin
       Programming /RBPATH/redboot_ROM.bin , please wait ....
       Programming flash passed
       Core#0>

   This operation can take some time.

The RedBoot installation is now complete. This can be tested by powering off the board, disconnecting the JTAG, and then powering on the board again. The RedBoot banner should be visible on the serial port. RedBoot's Flash configuration can be initialized using the same procedure as required in Method 2 below.

If it proves necessary to re-install RedBoot, this may be achieved by repeating the above process. Alternatively, a new image may be downloaded and programmed into flash more directly using RedBoot's own commands. See the RedBoot documentation for details.

### Method 2 - Program RedBoot into External Flash with RAM RedBoot

With this approach, the BDI2000 is used to load a RedBoot image into RAM, which can then in turn be used to load and program a ROM RedBoot image into Flash.

There are three stages, firstly loading the RAM RedBoot image, then initializing RedBoot's Flash configuration, and finally loading and programming the ROM RedBoot.

#### Loading a RAM RedBoot

1. Locate the `redboot_JTAG.bin` image within the `loaders` subdirectory of the base of the eCos installation.

2. Copy the `redboot_JTAG.bin` file into a location on the host computer accessible to its TFTP server.

3. With the BDI2000 telnet interface, execute the following command, replacing /RBPATH with the location of the redboot_JTAG.bin file relative to the TFTP server root directory:

       Core#0>load 0x62000000 /RBPATH/redboot_JTAG.bin bin
       Loading /RBPATH/redboot_JTAG.bin , please wait ....
       Loading program file passed
       Core#0>

4. Run the loaded RAM RedBoot:

       Core#0>go 0x62000000
       Core#0>

The terminal emulator connected to the serial debug port should now have displayed the RedBoot banner and prompt similar to the following:

    +RedBoot(tm) bootstrap and debug environment [JTAG]
    Non-certified release, version UNKNOWN - built 17:29:34, Apr 10 2006

    Platform: ST STR710-EVAL Board (ARM7TDMI)
    Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Copyright (C) 2003, 2004, 2005, 2006 eCosCentric Limited

    RAM: 0x62000000-0x62400000, [0x62019a20-0x623ed000] available
         0x00000000-0x00010000, [0x00000000-0x00010000] available
    FLASH: 0x40000000-0x40c40000, 4 x 0x2000 blocks, 1 x 0x8000 blocks, 3 x 0x10000 blocks, 8 x 0x10000 blocks, 2 x 0x2000 blocks
    FLASH: 0x60000000-0x603fffff, 8 x 0x2000 blocks, 63 x 0x10000 blocks
    RedBoot>

> Note: It is also possible to use the RAM startup version of RedBoot and the redboot_RAM.bin file instead of redboot_JTAG.bin above. If so, then the address to the load command must be 0x62020000, as must be the address to the go command.

#### RedBoot Flash Configuration

The following steps describe how to initialize RedBoot's Flash configuration. This must be performed when using a JTAG or RAM RedBoot to program Flash, but is also applicable to initial configuration of a ROM RedBoot loaded using Method 1.

1. Use the following command to initialize RedBoot's Flash Information System (FIS):

       RedBoot> fis init
       About to initialize [format] FLASH image system - continue (y/n)? y
       *** Initialize FLASH Image System
       ... Unlocking from 0x603f0000-0x603fffff: .
       ... Erase from 0x603f0000-0x603fffff: .
       ... Program from 0x623f0000-0x62400000 to 0x603f0000: .
       ... Locking from 0x603f0000-0x603fffff: .
       RedBoot>

2. Now configure RedBoot's Flash configuration with the command:

       RedBoot> fconfig -i
       Initialize non-volatile configuration - continue (y/n)? y
       Run script at boot: false
       Console baud rate: 38400
       Update RedBoot non-volatile configuration - continue (y/n)? y
       ... Unlocking from 0x603f0000-0x603fffff: .
       ... Erase from 0x603f0000-0x603fffff: .
       ... Program from 0x623f0000-0x62400000 to 0x603f0000: .
       ... Locking from 0x603f0000-0x603fffff: .
       RedBoot>

#### Loading and programming the ROM RedBoot

This section describes the steps required to load the ROM RedBoot via the serial line and program it into Flash.

1. Load the RedBoot ROM binary image from the serial line. Use the following command:

       RedBoot> load -r -m y -b %{freememlo}
       CRaw file loaded 0x62038c00-0x6204eacb, assumed entry at 0x62038c00
       xyzModem - CRC mode, 704(SOH)/0(STX)/0(CAN) packets, 3 retries
       RedBoot>

2. Finally install the loaded image into Flash:

       RedBoot> fis create RedBoot
       An image named 'RedBoot' exists - continue (y/n)? y
       ... Unlocking from 0x60000000-0x6001ffff: .........
       ... Erase from 0x60000000-0x6001ffff: .........
       ... Program from 0x62038c00-0x6204eacc to 0x60000000: .........
       ... Locking from 0x60000000-0x6001ffff: .........
       ... Unlocking from 0x603f0000-0x603fffff: .
       ... Erase from 0x603f0000-0x603fffff: .
       ... Program from 0x623f0000-0x62400000 to 0x603f0000: .
       ... Locking from 0x603f0000-0x603fffff: .
       RedBoot>

   It is also possible to use the fis write command to write the image into Flash, but if so, the relevant Flash blocks must also be explicitly unlocked with the command:

       RedBoot> fis unlock -f 0x60000000 -l 0x20000

The RedBoot installation is now complete. This can be tested by powering off the board, disconnecting the JTAG, and then powering on the board again. Output similar to the following should be seen on the serial port.

    +RedBoot(tm) bootstrap and debug environment [ROM]
    Non-certified release, version UNKNOWN - built 10:22:53, Apr 10 2006

    Platform: ST STR710-EVAL Board (ARM7TDMI)
    Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Copyright (C) 2003, 2004, 2005, 2006 eCosCentric Limited

    RAM: 0x62000000-0x62400000, [0x62004910-0x623ed000] available
         0x00000000-0x00010000, [0x00000000-0x00010000] available
    FLASH: 0x40000000-0x40c40000, 4 x 0x2000 blocks, 1 x 0x8000 blocks, 3 x 0x10000 blocks, 8 x 0x10000 blocks, 2 x 0x2000 blocks
    FLASH: 0x60000000-0x603fffff, 8 x 0x2000 blocks, 63 x 0x10000 blocks
    RedBoot>

If it proves necessary to re-install RedBoot, this may be achieved by repeating the above process. Alternatively, a new image may be downloaded and programmed into flash more directly using RedBoot's own commands. See the RedBoot documentation for details.

### Method 3 - Program RedBoot into Internal Flash with RAM RedBoot

This is a variant of Method 2, which puts RedBoot into the internal flash of the STR710, rather than the external M28W320CB flash device.

The first part of this is exactly the same as Method 2: load a RAM version of RedBoot as described in the Loading a RAM RedBoot section and configure is as described in the RedBoot Flash Configuration section. Now load the `redboot_ROM_INT.bin` binary image from the serial line as follows:

    RedBoot> load -r -m y -b %{freememlo}
    CRaw file loaded 0x6201a800-0x6202c733, assumed entry at 0x6201a800
    xyzModem - CRC mode, 577(SOH)/0(STX)/0(CAN) packets, 4 retries
    RedBoot>

Install the loaded image into Flash:

    RedBoot> fis write -f 0x40000000 -b %{freememlo} -l 0x20000
    * CAUTION * about to program FLASH
                at 0x40000000..0x4001ffff from 0x6201a800 - continue (y/n)? y
    ... Erase from 0x40000000-0x4001ffff: ......
    ... Program from 0x6201a800-0x6203a800 to 0x40000000: ......
    RedBoot>

The RedBoot installation is now complete. This can be tested by powering off the board, disconnecting the JTAG, and then powering on the board again. Output similar to the following should be seen on the serial port.

    +
    RedBoot(tm) bootstrap and debug environment [ROM]
    Non-certified release, version UNKNOWN - built 18:41:12, Jun  1 2006

    Platform: ST STR710-EVAL Board (ARM7TDMI)
    Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Copyright (C) 2003, 2004, 2005, 2006 eCosCentric Limited

    RAM: 0x00000000-0x00010000, [0x000048b0-0x00010000] available
    FLASH: 0x40000000-0x40c40000, 4 x 0x2000 blocks, 1 x 0x8000 blocks, 3 x 0x10000 blocks, 8 x 0x10000 blocks, 2 x 0x2000 blocks
    FLASH: 0x60000000-0x603fffff, 8 x 0x2000 blocks, 63 x 0x10000 blocks
    RedBoot>

## Rebuilding RedBoot

Should it prove necessary to rebuild a RedBoot binary, this is done most conveniently at the command line. The steps needed to rebuild the the ROM version of RedBoot are:

    $ mkdir redboot_str710eval_rom
    $ cd redboot_str710eval_rom
    $ ecosconfig new str710eval redboot
    $ ecosconfig import $ECOS_REPOSITORY/hal/arm/str7xx/str710eval/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.bin`.

The other versions of RedBoot - ROM, RAM or JTAG - may be similarly built by choosing the appropriate alternative .ecm file.

Prev | Home | Next
Overview | Up | Configuration