Setup -- Preparing the Zoom board for eCos Development
Overview
In a typical development environment, the Zoom board boots from
the SPI NOR and runs the RedBoot ROM monitor from SDRAM. 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 loaded from SPI NOR flash to SDRAM
redboot_ROM.ecm
redboot_ROM.bin
For serial communications, all versions run with 8 bits, no
parity, and 1 stop bit at 115200 baud. RedBoot also supports
ethernet communication and flash management.
Note that the use of the term ROM for the initial RedBoot
configuration is a historical accident. RedBoot actually runs from
SDRAM after being loaded there from NOR flash by the User Boot
Loader. The use of ROM for this configuration is intended to
indicate that it initializes the microprocessor and board
peripherals, as opposed to the RAM configuration which assumes
that this has already been done.
Initial Installation
The Zoom board comes with U-Boot installed by default. The booting
mechanism is that the on-chip firmware loads a small User Boot
Loader from the start of NOR flash which then loads U-Boot from
later in the flash. Our strategy is to leave the User Boot Loader
in place and replace U-Boot with RedBoot.
To write RedBoot to the SPI NOR flash, there are two possibilities:
either run a RAM-resident RedBoot using a JTAG emulator and use that
to program RedBoot into the SPI NOR flash; or use a Serial Boot and
Flash Utility for OMAP-L138.
The following section describes this process using the Ronetix PEEDI;
other JTAG emulators will have similar steps.
Programming RedBoot into NOR flash using the PEEDI
The following gives the steps needed to program RedBoot into the
SPI NOR Flash using the PEEDI. The basic process is to load and
run a copy of RedBoot, then use that to initialize the flash,
download a new copy of RedBoot and write that to the flash.
Set up the PEEDI as described in the Ronetix documentation. The
peedi.zoom.cfg file should be used to
setup and configure the hardware.
Connect a null-modem serial cable between the serial port of
the board and a serial port on a convenient host. Run a
terminal emulator (Hyperterm or minicom) at 115200
baud.
Copy redboot_ROM.srec to to a TFTP server
that the PEEDI can access. Copy
redboot_ROM.img to the machine running the
terminal emulator.
Connect a telnet session to the PEEDI and issue the following
command, substituting your own TFTP server address:
zoom>> mem load tftp://10.0.1.1/redboot.srec srec
++ info: Loading image file: tftp://10.0.1.1/redboot.srec
++ info: At absolute address: 0xC0008000
loading at 0xC0008000
loading at 0xC000C000
loading at 0xC0010000
loading at 0xC0014000
loading at 0xC0018000
loading at 0xC001C000
Successfully loaded 88KB (90336 bytes) in 20.4s
zoom>
Now issue the go command:
zoom> go 0xC0008000
You should see the following output on the Zoom board serial line:
+M25PXX : Init device with JEDEC ID 0x202017.
**Warning** FLASH configuration checksum error or invalid key
Use 'fconfig -i' to [re]initialize database
RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version UNKNOWN - built 10:27:53, Jan 26 2010
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 eCosCentric Limited
RedBoot is free software, covered by the eCos license, derived from the
GNU General Public License. You are welcome to change it and/or distribute
copies of it under certain conditions. Under the license terms, RedBoot's
source code and full license terms must have been made available to you.
Redboot comes with ABSOLUTELY NO WARRANTY.
Platform: Logic Zoom OMAP L138 eXperimenter (ARM9)
RAM: 0xc0000000-0xc4000000 [0xc0022128-0xc3fed000 available]
FLASH: 0x70000000-0x707fffff, 128 x 0x10000 blocks
RedBoot>
Run the following command to initialize RedBoot's flash file
system and flash configuration:
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0x707f0000-0x707fffff: .
... Program from 0xc3ff0000-0xc4000000 to 0x707f0000: .
RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)? y
Run script at boot: false
Console baud rate: 115200
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0x707e0000-0x707e0fff: .
... Program from 0xc3fef000-0xc3ff0000 to 0x707e0000: .
RedBoot>
We now need to download a copy of RedBoot and program it into
the flash. Give the following command to RedBoot:
RedBoot> load -r -m y -b %{freememlo}
C
From the terminal emulator upload the
redboot_ROM.img file using Y-Modem
protocol. When the upload is complete you should see something
similar to the following output.
RedBoot> fis cre RedBoot
An image named 'RedBoot' exists - continue (y/n)? y
... Erase from 0x70010000-0x7002ffff: ..
... Program from 0xc0022400-0xc00384f0 to 0x70010000: ..
... Erase from 0x707f0000-0x707fffff: .
... Program from 0xc3ff0000-0xc4000000 to 0x707f0000: .
RedBoot>
The RedBoot installation is now complete. This can be tested by
issuing the reset run command to the PEEDI, or
by detaching the PEEDI and power cycling the board. Output
similar to the following should be seen on the serial port.
+M25PXX : Init device with JEDEC ID 0x202017.
RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version UNKNOWN - built 10:27:53, Jan 26 2010
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 eCosCentric Limited
RedBoot is free software, covered by the eCos license, derived from the
GNU General Public License. You are welcome to change it and/or distribute
copies of it under certain conditions. Under the license terms, RedBoot's
source code and full license terms must have been made available to you.
Redboot comes with ABSOLUTELY NO WARRANTY.
Platform: Logic Zoom OMAP L138 eXperimenter (ARM9)
RAM: 0xc0000000-0xc4000000 [0xc0022128-0xc3fed000 available]
FLASH: 0x70000000-0x707fffff, 128 x 0x10000 blocks
RedBoot>
If it proves necessary to re-install RedBoot, this may be
achieved by repeating the serial download and fis
create parts of the above process. It is not necessary
to reinitialize the FIS and fconfig.
Note: If the board has been supplied with a TI User Boot Loader (UBL) version
prior to 1.65, then on startup the board may output a string on the
serial port saying "No magic number found". Earlier Zoom boards were
known to be supplied with version 1.30. In this situation you will
need to locate the script flashimg.tcl in the
misc subdirectory of the Zoom
platform HAL (i.e.
packages/hal/arm/arm9/zoom_l138/VERSION/misc/flashimg.tcl)
along with the redboot_ROM.bin file in the
loaders subdirectory of your eCosPro
installation, and run the following command at a command prompt:
You can then follow the above instructions for installing RedBoot, but
use redboot-oldubl.img in place of uses of
redboot_ROM.img.
You will also need to perform this step on any ROM startup user
applications to be programmed into Flash using a JTAG device and booted
by UBL.
Programming RedBoot into NOR flash using the TI Serial Boot and Flash utility
Texas Instruments have made available a command-line Serial Boot
and Flash Loading Utility for OMAP-L138. More information
including download and usage instructions is available
here on their website.
With this utility, you can program a ROM startup version of
RedBoot in raw binary format (a prebuilt version of which may be
found at loaders/zoom_l138/redboot_ROM.bin
within your eCos installation). On Windows, we advise running the
utility from a Command Prompt, rather than from a Cygwin bash
shell.
Before running the utility, first you need to connect your PC to
the board's serial port using a null-modem RS232 serial
cable. Secondly, (with the board powered off) you must set DIP
switch bank S7 so that switches 7, and 8 are set to the ON
position and the rest are set to the OFF position. If you wish to
confirm the board is configured correctly, then you can start a
terminal emulator application (such as Hyperterminal on some
versions of Windows) and connect to the serial port at 115200
baud, 8-N-1 with no hardware flow control, then you should see a
"BOOTME" prompt when you power on the board.
To program the redboot_ROM.bin image, change
directory to the directory containing the UBL binary file (which
is included with the Serial Boot and Flash utility download), copy
the redboot_ROM.bin into that directory, and
then run the utility as follows:
After successful completion, RedBoot will be resident in SPI NOR
Flash. To return to the normal boot mode, you must reset the SW7
DIP switches to their default position allowing booting from SPI
NOR Flash. To do so, set all S7 switches to their OFF
positions.
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 ROM version of RedBoot for the Zoom L138 are:
$ mkdir redboot_zoom_l138_rom
$ cd redboot_zoom_l138_rom
$ ecosconfig new zoom_l138 redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/arm/arm9/zoom_l138/VERSION/misc/redboot_ROM.ecm
$ ecosconfig resolve
$ ecosconfig tree
$ make
At the end of the build the install/bin subdirectory should
contain the files redboot.srec and
redboot.img. redboot.img
is a binary file that includes a 16 byte header needed by the
User Boot Loader to load RedBoot successfully.