Name

Setup — Preparing the VPB926EJS board for eCos Development

Overview

In a typical development environment, the VPB926EJS board boots from flash into the RedBoot ROM monitor. 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:

ConfigurationDescriptionUseFile
RAMRedBoot running from RAMredboot_RAM.ecmredboot_RAM.bin
ROMRedBoot running from flash ROMredboot_ROM.ecmredboot_ROM.bin
ROMRAMRedBoot running from RAM, but contained in the board's flash boot sectorredboot_ROMRAM.ecmredboot_ROMRAM.bin
SRAMRedBoot running from static RAMredboot_SRAM.ecmredboot_SRAM.bin

For serial communications, all versions run with 8 bits, no parity, and 1 stop bit at 38400 baud. RedBoot also supports ethernet communication and flash management.

Initial Installation

Flash Installation

Installing RedBoot is a matter of downloading a new binary image and overwriting the existing Boot monitor ROM image. This is a two stage process, you must first download an SRAM-resident version of RedBoot and then use that to download the ROM image to be programmed into the flash memory.

The VPB926EJS boards are shipped from ARM with a version of ARM's boot monitor installed. Unfortunately this boot monitor only works in conjunction with ARM's tools, which are not supplied with the board. Hence the only viable approach is to install RedBoot via the JTAG interface. The following directions are necessarily somewhat general since the specifics depend on the exact JTAG device available, and the software used to drive it.

Connect the JTAG device to the JTAG connector on the Versatile board and check that the device is functioning correctly. Using 32 bit memory writes, initialize the static memory controller so that the SRAM and flash are accessible. The following assignments should be made:

*(long *)0x10100034 = 0x00303021;
*(long *)0x10100054 = 0x00303021;
*(long *)0x10100074 = 0x00303021;
*(long *)0x10100094 = 0x00303021;

Now load the SRAM redboot binary image from the file redboot_SRAM.bin into the base of SRAM at 0x38000000. Exactly how you do this depends on the JTAG driver software.

Start RedBoot by executing from location 0x38000040, which should result in RedBoot starting up.

+... waiting for BOOTP information
Ethernet eth0: MAC address 00:02:f7:00:0b:34
IP: 10.0.0.208/255.255.255.0, Gateway: 10.0.0.1
Default server: 10.0.0.201

RedBoot(tm) bootstrap and debug environment [SRAM]
Non-certified release, version UNKNOWN - built 16:03:09, May  5 2004

Platform: ARM Versatile VPB926EJS (ARM9)
Copyright (C) 2000, 2001, 2002, Free Software Foundation, Inc.
Copyright (C) 2003, 2004, eCosCentric Limited

RAM: 0x00000000-0x02000000, [0x00013b20-0x01fbd000] available
FLASH: 0x34000000 - 0x38000000, 256 blocks of 0x00040000 bytes each.
RedBoot>

Now the ROM image can be downloaded using the following RedBoot command:

RedBoot> load -r -b %{FREEMEMLO} -m ymodem

Use HyperTerminal's Ymodem support to send the file redboot_ROMRAM.bin. This should result in something like the following output:

Raw file loaded 0x0002f800-0x0004be6b, assumed entry at 0x0002f800
xyzModem - CRC mode, 911(SOH)/0(STX)/0(CAN) packets, 4 retries
RedBoot>

Once the file has been uploaded, you can check that it has been transferred correctly using the cksum command. On the host (Linux or Cygwin) run the cksum program on the binary file:

$ cksum redboot_ROMRAM.bin
140216855 116332 redboot_ROMRAM.bin

In RedBoot, run the cksum command on the data that has just been loaded:

RedBoot> cksum -b %{FREEMEMLO} -l 116332
POSIX cksum = 140216855 116332 (0x085b8a17 0x0001c66c)

The second number in the output of the host cksum program is the file size, which should be used as the argument to the -l option in the RedBoot cksum command. The first numbers in each instance are the checksums, which should be equal.

If the program has downloaded successfully, then it can be programmed into the flash using the following commands:

RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)?y
*** Initialize FLASH Image System
... Unlock from 0x37fc0000-0x38000000: .
... Erase from 0x37fc0000-0x38000000: .
... Program from 0x03fc0000-0x04000000 at 0x37fc0000: .
... Lock from 0x37fc0000-0x38000000: .
RedBoot> fis create -b %{FREEMEMLO} RedBoot
An image named 'RedBoot' exists - continue (y/n)?y
... Unlock from 0x34000000-0x34040000: .
... Erase from 0x34000000-0x34040000: .
... Program from 0x0002f800-0x0006f800 at 0x34000000: .
... Lock from 0x34000000-0x34040000: .
... Unlock from 0x37fc0000-0x38000000: .
... Erase from 0x37fc0000-0x38000000: .
... Program from 0x03fc0000-0x04000000 at 0x37fc0000: .
... Lock from 0x37fc0000-0x38000000: .
RedBoot>

The VPB926EJS board may now be reset either by cycling the power, pressing the reset switch, or with the reset command. It should then display the startup screen for the ROMRAM version of 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 ROMRAM version of RedBoot for the VPB926EJS are:

$ mkdir redboot_vpb926ejs_romram
$ cd redboot_vpb926ejs_romram
$ ecosconfig new vpb926ejs redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/arm/arm9/vpb926ejs/current/misc/redboot_ROMRAM.ecm
$ ecosconfig resolve
$ ecosconfig tree
$ make

To rebuild the SRAM version of RedBoot:

$ mkdir redboot_vpb926ejs_sram
$ cd redboot_vpb926ejs_sram
$ ecosconfig new vpb926ejs redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/arm/arm9/vpb926ejs/current/misc/redboot_SRAM.ecm
$ ecosconfig resolve
$ ecosconfig tree
$ make

At the end of the build the install/bin subdirectory should contain the file redboot.bin. This is the case for both the above builds, take care not to mix the two files up, since programming the SRAM RedBoot into the ROM will render the board unbootable.