Setup -- Preparing the SDK7780 board for eCos Development
Overview
In a typical development environment, the SDK7780 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 sh-elf-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 running from the board's flash
redboot_ROM.ecm
redboot_ROM.bin
RAM
Used for upgrading ROM version
redboot_RAM.ecm
redboot_RAM.bin
For serial communications, all versions run with 8 bits, no parity, and
1 stop bit at 115200 baud. This baud rate can be changed via the
configuration option
CYGNUM_HAL_SH_SH4_SCIF_BAUD_RATE and rebuilding
RedBoot. RedBoot also supports ethernet communication and flash
management.
Initial Installation
Flash Installation
This process makes use of the ETS software programmed into flash bank
A in order to write RedBoot into flash bank B. To do this you will
need to set up a TFTP server on a machine that is accessible from the
development board.
Before downloading and programming the RedBoot image, ETS and the TFTP
Bootloader must be configured. Full details for doing this are
available in the documentation that accompanies the board. The
following steps should be read in conjunction with that.
The first step is to connect an RS232 cable between the upper of the SDK7780
serial ports and the host PC. Next start a terminal emulation application such as
HyperTerminal or minicom on the host PC and set the serial
communication parameters to 115200 baud, 8 data bits, no parity, 1 stop
bit (8N1) and no flow control (handshaking). Also connect an ethernet
cable that is on the same network as the TFTP server.
Apply power to the SDK7780 and press the power button. The board
should boot automatically into ETS and after an initial report of the
board configuration should display the ETS MAIN
MENU. Select option 2 Boot Configuration
Menu and then option 1 Change
Configuration. Now select option 1 TFTP
and accept the default 5s delay. Check that SW4-4&5 are off and answer
Y to the remaining questions. Once the process is finished, reset the
board to restart.
On restart the board will boot into the TFTP Boot Loader after a 5s
delay. It will immediately drop into a configuration dialog. Decide
whether to use DHCP or static IP. Static IP is recommended for which
you will need to enter this board's IP address and that of the TFTP server.
For the kernel filename enter redboot.bin; answer Y
to download to flash bank B; enter B for the file format; accept the
default load address; answer N for the disk image and command line;
enter F to select the flash boot option and Y for SW4-4 state. The
output should look something like this:
Press 'SPACE Bar' key or wait for 5 seconds to enter TFTP Boot Loader.
Press any other key to start ETS.
Starting TFTP Boot Loader...
Renesas SDK7780 (Little Endian Mode)
SH TFTP Bootloader Version 2.30
Copyright (C) 2000 Free Software Foundation, Inc.
Copyright (C) 2004 Renesas Technology Europe Limited
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under
under the terms of the GNU Lesser General Public License version 2.1 or later.
Platform MAC Address - 0000:87D6:3EB2
No configuration found in flash, entering setup...
Setup TFTP Bootloader Configuration:
At any prompt press 'Enter' to leave unchanged or 'Esc' key to quit.
Use DHCP to setup network?(Default=Static IP)[Y/N]: n
Enter board IP address [NNN.NNN.NNN.NNN] : 10.0.3.2
Enter server IP address [NNN.NNN.NNN.NNN] : 10.0.1.2
Enter kernel (user program) filename : redboot.bin
Download to flash Bank B?(Default=Bank A) [Y/N] : y
Download file format Binary/S-record? [B/S] : b
Binary load address [default=H'88210000] :
Load a disk image? [Y/N] : n
Setup kernel command line? [Y/N] : n
Boot option: TFTP, Flash, Don't Boot(TFTP Bootloader Main Menu)? [T/F/N]: f
Is flash Bank A write protect switch SW4-4 = 'OFF'? [Y/N] : y
Updating Boot Flash - Do not switch-off, reset or disconnect until complete.
Please wait, saving the new Boot configuration...
Successfully saved new TFTP Bootloader configuration.
TFTP Bootloader Main Menu
-------------------------
1. Boot from network
2. Boot from flash
3. Boot from FAT32 format MMC card
4. Load program into flash
5. Display configuration
6. Change configuration
Command:>
The bootloader will now drop into its main menu. We are now ready to
download and program the RedBoot image. Locate the file
redboot_ROM.bin in the release loaders directory and copy it to the TFTP
server's directory naming it redboot.bin. At the TFTP bootloader
select option 4 which should it to fetch the redboot.bin file from the
server. Answer Y for the SW4-5 state and wait for the flash to be
written. The output should look something like this:
TFTP Bootloader Main Menu
-------------------------
1. Boot from network
2. Boot from flash
3. Boot from FAT32 format MMC card
4. Load program into flash
5. Display configuration
6. Change configuration
Command:>4
Board IP address : 10.0.3.2
Server IP address: 10.0.1.2
Downloading redboot.bin to flash bank B
Downloaded 175144 bytes, crc 471083609
Is flash Bank B write protect switch SW4-5 = 'OFF'? [Y/N] : y
Flash: S29GL256M (67108864 bytes)
Sectors: 1024 (131072 bytes each)
Writing to flash...
b 00000001 add A4000000
Toggle flash bank select switch to boot from bank B
TFTP Bootloader Main Menu
-------------------------
1. Boot from network
2. Boot from flash
3. Boot from FAT32 format MMC card
4. Load program into flash
5. Display configuration
6. Change configuration
Command:>
Toggle SW4-1 to select bank B for booting and reset the board. The
following output should appear:
+**Warning** FLASH configuration checksum error or invalid key
Use 'fconfig -i' to [re]initialize database
Ethernet eth0: MAC address 00:00:d6:87:b2:3e
IP: 10.0.2.4/255.0.0.0, Gateway: 10.0.0.3
Default server: 0.0.0.0
RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version UNKNOWN - built 13:52:55, Jan 22 2007
Platform: Renesas SDK7780 (SH7780)
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Copyright (C) 2003, 2004, 2005, 2006, 2007 eCosCentric Limited
RAM: 0x88000000-0x8a000000, [0x8800b758-0x89fc1000] available
FLASH: 0x80000000-0x83ffffff, 512 x 0x20000 blocks
RedBoot>
At this stage the RedBoot flash management initialization has not yet
happened so the warning about the configuration checksum error is
expected. To perform this initialization use the
fis init -f command:
RedBoot> fis init -f
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0x83fe0000-0x83ffffff: .
... Program from 0x89fd0000-0x89ff0000 to 0x83fe0000: .
RedBoot>
At the end, the block of flash at
location 0x83FE0000 holds information about the various flash blocks,
allowing other flash management operations to be performed.
Flash Configuration
The next step is to set up RedBoot's non-volatile configuration values:
RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)? y
Run script at boot: false
Use BOOTP for network configuration: true
Default server IP address:
Console baud rate: 115200
DNS server IP address:
Set eth0 network hardware address [MAC]: false
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0x83fe0000-0x83ffffff: .
... Program from 0x89fd0000-0x89ff0000 to 0x83fe0000: .
RedBoot>
For most of these configuration variables, the default value is
correct, although you may wish to provide a default server used for
TFTP retrieval, and default DNS server. If there is no suitable BOOTP or DHCP
service running on the local network then BOOTP should be disabled and,
instead, RedBoot will prompt for a fixed IP address, netmask, and addresses
for the local gateway and DNS server.
Once you have set appropriate RedBoot flash configuration values you may
reset the board. When RedBoot issues its prompt, it is ready to accept connections
from sh-elf-gdb, allowing applications to be downloaded and
debugged. Connections can be made via either serial port, or by TCP
to port 9000 (or an alternative port if manually set by the fconfig
command).
Occasionally it may prove necessary to update the installed RedBoot
image. This can be done simply by repeating the above process by
toggling SW4-1 back to boot ETS and the TFTP
bootloader. Alternatively, the existing RedBoot install can be used to
load the RAM-resident version in which case the standard RAM RedBoot
build can be used. See
the RedBoot documentation for instruction on how to do this.
Rebuilding RedBoot
Should it prove necessary to rebuild a 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 the RAM version of RedBoot are:
$ mkdir redboot_ram
$ cd redboot_ram
$ ecosconfig new sdk7780 redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/sh/sdk7780/VERSION/misc/redboot_RAM.ecm
$ ecosconfig resolve
$ ecosconfig tree
$ make
At the end of the build the install/bin subdirectory should contain
the file redboot.bin.
Rebuilding the ROM version involve basically the same process. The ROM
version uses the file redboot_ROM.ecm and
generates a file named redboot.bin. Make sure you
don't mix up the different redboot.bin files; rename them to something
more memorable such as redboot_RAM.bin and
redboot_ROM.bin.