Setup -- Preparing the SD-L137 board for eCos Development
Overview
In a typical development environment, the SD-L137 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.img
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 first three
bootloaders. 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
Installation involves writing an image to the start of the serial
flash. This image contains the AIS script interpreted by the
primary bootloader, the secondary and tertiary bootloaders, and a
RedBoot executable. A suitable image
redboot.img is provided with the release or
can be rebuilt using the instructions below.
There are two ways of writing the image. The first is to use a
dedicated utility such as TI's Serial Boot and Flash Loading
Utility for OMAP-L137. The second is to set up a JTAG
emulator. This can then be used to run a RAM-resident RedBoot
which will allow the flash to be programmed. The recommended JTAG
emulator is the Ronetix PEEDI, but other JTAG emulators will
involve a similar setup.
Caution
The L137 powers up with the ARM processor disabled, and the ARM
does not start up until the primary bootloader has executed the
AIS script and the secondary bootloader has run to completion.
Until that time it will not be possible to attach a PEEDI or other
ARM JTAG emulator. If a bogus image is programmed into the flash
such that the AIS script or secondary bootloader are missing or
corrupt, it will not be possible to recover the board via JTAG.
Recovery should still be possible by using the TI utilities and
uart2.
Programming RedBoot into SPI NOR flash using the TI Flash Utility
A RedBoot image file has been provided that combines the required
L137 AIS script, DSP and ARM bootloaders, along with RedBoot itself.
The redboot_ROM.img file can be found in the
loaders/sd_l137
subdirectory of your eCosPro installation.
The basic bootloader installation process is to set the board into a bootstrap update mode,
use the TI utility to download and write the provided image to the flash, and then restore
the board to normal operational mode.
Install the TI tools on your workstation.
Make a note of the boards current SW2 BOOT switch pin configuration
and then configure SW2 to enable bootstrap update mode. The required
pin configuration for your specific board revision can be found in the
TI documentation. For example, on revision "C" and later boards:
pin 7 ON, pin 2 OFF, pin 1 ON, pin 0 OFF, pin 3 OFF.
Connect a serial cable between the board's DB9 serial connector
and the host PC. Run a serial terminal emulator (Putty, Hyperterm or
minicom) on the host, connecting at 115200 baud 8N1 with no flow
control. When the board is reset you should see "BOOTME" output
on the serial line.
Use the TI sfh_OMAP-L137 utility to install the
redboot_ROM.img on the board.
You will need to modify the example command
sfh_OMAP-L137 -p com2 -flash_noubl redboot_ROM.img
used in the example output below,
substituting "com2" with the serial port corresponding to your setup,
and by adding appropriate path prefixes to
sfh_OMAP-L137 and redboot_ROM.img
corresponding to their installed location on your workstation.
Once the flash utility starts running you will need
to reset the board almost immediately as directed by the utility.
Until you do this the benign message
"(Serial Port): Read error! (The operation has timed out.)"
will be output continously.
You will also need to be patient as the initial "Loading section..."
phase can take many minutes to complete with no obvious output or
other signs of life.
C:>sfh_OMAP-L137 -p com2 -flash_noubl redboot_ROM.img
-----------------------------------------------------
TI Serial Flasher Host Program for OMAP-L137
(C) 2010, Texas Instruments, Inc.
Ver. 1.67
-----------------------------------------------------
[TYPE] Single boot image
[BOOT IMAGE] redboot_ROM.img
[TARGET] OMAPL137_v2
[DEVICE] SPI_MEM
Attempting to connect to device com4...
Press any key to end this program at any time.
(AIS Parse): Read magic word 0x41504954.
(AIS Parse): Waiting for BOOTME... (power on or reset target now)
(Serial Port): Read error! (The operation has timed out.)
(AIS Parse): BOOTME received!
(AIS Parse): Performing Start-Word Sync...
(AIS Parse): Performing Ping Opcode Sync...
(AIS Parse): Processing command 0: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 14912-Byte section to address 0x80000000.
(AIS Parse): Processing command 1: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 784-Byte section to address 0x80004240.
(AIS Parse): Processing command 2: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 32-Byte section to address 0x80004550.
(AIS Parse): Processing command 3: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 20-Byte section to address 0x80004590.
(AIS Parse): Processing command 4: 0x58535906.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Performing jump and close...
(AIS Parse): AIS complete. Jump to address 0x800034C0.
(AIS Parse): Waiting for DONE...
(AIS Parse): Boot completed successfully.
Waiting for SFT on the OMAP-L137...
Flashing application redboot_ROM.img (206288 bytes)
100% [ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ]
Image data transmitted over UART.
100% [ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ ]
Application programming complete
Operation completed successfully.
Power off the board and restore the SW2 BOOT switch to it's normal
"RUN" configuration. Power on the board again and you should see
the following output on the serial port from RedBoot.
+**Warning** FLASH configuration checksum error or invalid key
Use 'fconfig -i' to [re]initialize database
Ethernet eth0: MAC address 00:0e:99:03:13:ee
IP: 10.1.1.147/255.255.255.0, Gateway: 10.1.1.241
Default server: 0.0.0.0
RedBoot(tm) bootstrap and debug environment [ROM]
eCosCentric certified release, version v3_1_10 - built 11:59:59, Jun 23 2011
Copyright (C) 2000-2009 Free Software Foundation, Inc.
Copyright (C) 2003-2011 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: Spectrum Digital OMAP-L137 Evaluation Module (ARM9)
RAM: 0xc0000000-0xc4000000 [0xc003be80-0xc3fed000 available]
FLASH: 0x70000000-0x703fffff, 64 x 0x10000 blocks
RedBoot>
The flash configuration warning is expected. The
ethernet MAC address will have come from the serial EEPROM on
the I2C0 bus. The IP and gateway addresses will have been
provided by a BOOTP (DHCP) server.
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 0x703f0000-0x703fffff: .
... Program from 0xc3ff0000-0xc4000000 to 0x703f0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0x70000000 0x70000000 0x00040000 0x00000000
FIS directory 0x703F0000 0x703F0000 0x0000F000 0x00000000
RedBoot config 0x703FF000 0x703FF000 0x00001000 0x00000000
RedBoot>
If desired the fconfig settings can be initialized at this time
using the fconfig -i command. Most of
the settings relate to ethernet, for example the IP address
that RedBoot should use.
The RedBoot installation is now complete. The board is now
ready for development using arm-eabi-gdb,
RedBoot's gdb stubs, and eCos applications configured for RAM
startup.
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 the full image including the AIS script and bootloaders,
and write this image to the flash.
Set up the PEEDI as described in the Ronetix documentation. The
peedi.sd_l137.cfg file in the platform
HAL's misc subdirectory
contains the required hardware initialization support. Other
parts of this file will need to be edited, for example the
license key details.
Connect a serial cable between the boards DB9 serial connector
and the host PC. Run a serial terminal emulator (Hyperterm or
minicom) on the host, connecting at 115200 baud 8N1 with no flow
control.
Use arm-eabi-gdb to run the
redboot.elf executable from the
loaders/sd_l137
subdirectory of your eCosPro installation. Substitute the
appropriate TCP/IP address and port number corresponding to
your PEEDI setup.
Address 0xffff0000 corresponds to the ARM reset vector. At this
point the primary and secondary bootloaders have run and the
processor would be about to start the tertiary bootloaders, but
the PEEDI will have halted the processor and run its hardware
initialization macro instead. RedBoot will start running after
the continue command, and the following
should be sent out of the serial line.
+**Warning** FLASH configuration checksum error or invalid key
Use 'fconfig -i' to [re]initialize database
Ethernet eth0: MAC address 00:0e:99:03:13:ee
IP: 10.1.1.147/255.255.255.0, Gateway: 10.1.1.241
Default server: 0.0.0.0
RedBoot(tm) bootstrap and debug environment [ROM]
eCosCentric certified release, version v3_1_10 - built 11:59:59, Jun 23 2011
Copyright (C) 2000-2009 Free Software Foundation, Inc.
Copyright (C) 2003-2011 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: Spectrum Digital OMAP-L137 Evaluation Module (ARM9)
RAM: 0xc0000000-0xc4000000 [0xc003cbd8-0xc3fed000 available]
FLASH: 0x70000000-0x703fffff, 64 x 0x10000 blocks
RedBoot>
The flash configuration warning is expected at this stage. The
ethernet MAC address will have come from the serial EEPROM on
the I2C0 bus. The IP and gateway addresses will have been
provided by a BOOTP server.
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 0x703f0000-0x703fffff: .
... Program from 0xc3ff0000-0xc4000000 to 0x703f0000: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0x70000000 0x70000000 0x00040000 0x00000000
FIS directory 0x703F0000 0x703F0000 0x0000F000 0x00000000
RedBoot config 0x703FF000 0x703FF000 0x00001000 0x00000000
RedBoot>
If desired the fconfig settings can be initialized at this time
using the fconfig -i command. Most of
the settings relate to ethernet, for example the IP address
that RedBoot should use.
Next the full RedBoot image should be loaded into RAM.
RedBoot> load -r -m y -b %{freememlo}
C
From the terminal emulator upload the
redboot.img file from the loaders/sd_l137 directory
using Y-Modem protocol. When the upload is complete you should
see something similar to the following output.
RedBoot> fis create RedBoot
An image named 'RedBoot' exists - continue (y/n)? y
... Erase from 0x70000000-0x7003ffff: .....
... Program from 0xc003cc00-0xc006ff27 to 0x70000000: .....
... Erase from 0x703f0000-0x703fffff: .
... Program from 0xc39f0000-0xc3a00000 to 0x703f0000: .
RedBoot>
The RedBoot installation is now complete. Terminate the
arm-eabi-gdb session by hitting ctrl-C and
then running the quit command. Detach the
PEEDI and power cycle the board. RedBoot should now start
running after the primary, secondary and tertiary bootloaders
and output a banner similar to the one above. The board is now
ready for development using arm-eabi-gdb,
RedBoot's gdb stubs, and eCos applications configured for RAM
startup.
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.
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 this board are:
$ mkdir redboot_sdl137_rom
$ cd redboot_sdl137_rom
$ ecosconfig new sd_l137 redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/arm/arm9/sd_l137/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.elf and
redboot.img.
redboot.elf can be executed on the board
using arm-eabi-gdb and a JTAG emulator.
redboot.img is an image containing the
AIS script for the primary bootloader, the secondary and tertiary
bootloaders, and RedBoot. It is this image which should be
programmed into flash to install or update RedBoot.