Setup

Name

Setup -- Preparing the DNP/5280 board for eCos Development

Overview

In a typical development environment the DNP/5280 board boots from flash into the RedBoot ROM monitor. eCos applications are configured for a RAM startup, and then downloaded and run on the board via the debugger m68k-elf-gdb. Boards may be shipped with one of two ROM monitors in the flash, either RedBoot or dBUG. If the latter, dBUG must be replaced so preparing the board involves programming a suitable RedBoot image into flash memory.

The following RedBoot configurations are supported:

ConfigurationDescriptionUseFile
ROMRedBoot running from the board's flashredboot_ROM.ecmredboot_rom.bin
dBUGUsed for initial setupredboot_DBUG.ecmredboot_dbug.srec
RAMUsed for upgrading ROM versionredboot_RAM.ecmredboot_ram.bin

For serial communications all versions run with 8 bits, no parity, and 1 stop bit. The dBUG version runs at 115200 baud. The ROM and RAM versions usually run at 38400 baud, but this can be changed via a RedBoot fconfig option or by manipulating the configuration option CYGNUM_HAL_M68K_MCFxxxx_DIAGNOSTICS_BAUD and then rebuilding RedBoot. By default RedBoot will use the board's terminal port, corresponding to uart0, but this can also be changed via the configuration option CYGHWR_HAL_M68K_MCFxxxx_DIAGNOSTICS_PORT. On the DNP/5280 and DNP/5282 platforms RedBoot also supports ethernet communication and flash management.

Initial Installation

This process assumes that the board currently has the dBUG ROM monitor in flash and does not require any special debug hardware. Programming the RedBoot rom monitor into flash memory requires an application that can manage flash blocks. RedBoot itself has this capability. Rather than have a separate application that is used only for flash management during the initial installation, a special RAM-resident version of RedBoot is loaded into memory and run. This version can then be used to load the normal flash-resident version of RedBoot and program it into the flash.

The first step is to connect an RS232 cable between the DNP/5280 terminal port and the host PC. A suitable cable is supplied with the board. 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). Make sure that the RCM jumper is set to boot into dBUG rather than directly into uCLinux. Apply power to the board and you should see a dBUG> prompt.

Once dBUG is up and running the RAM-resident version of RedBoot can be downloaded:

dBUG> dl
Escape to local host and send S-records now...
    

The required S-records file is redboot_dbug.srec, which is normally supplied with the eCos release in the loaders directory. If it needs to be rebuilt then instructions for this are supplied below. The file should be sent to the target as raw text using the terminal emulator:

S-record download successful!
dBUG>
    

It is now possible to run the RAM-resident version of RedBoot:

dBUG> go 0x10000
+**Warning** FLASH configuration checksum error or invalid key
Use 'fconfig -i' to [re]initialize database
... waiting for BOOTP information
Ethernet eth0: MAC address 00:00:00:00:00:03
Can't get BOOTP info for device!

RedBoot(tm) bootstrap and debug environment [DBUG]
Non-certified release, version UNKNOWN - built 21:15:10, Mar 16 2004

Platform: DNP/5280 (Freescale MCF5280)
Copyright (C) 2000, 2001, 2002, Free Software Foundation, Inc.
Copyright (C) 2003, 2004, eCosCentric Limited

RAM: 0x00000000-0x01000000, 0x0002f4c8-0x00fed000 available
FLASH: 0xff800000 - 0x00000000, 128 blocks of 0x00010000 bytes each.
RedBoot>
    

At this stage the RedBoot flash management initialization has not yet happened so the warning about the configuration checksum error is expected. There will also be a delay while RedBoot tries to contact a local BOOTP server. To perform the flash 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 0xffff0000-0xffffffff: .
... Program from 0x00ff0000-0x00100000 at 0xffff0000: .
RedBoot>
    

At this stage the block of flash at location 0xFFFF0000 holds information about the various flash blocks, allowing other flash management operations to be performed. 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
Console baud rate: 115200
DNS server IP address:
GDB connection port: 9000
Force console for special debug messages: false
Network hardware address [MAC]: 0x00:0x00:0x00:0x00:0x00:0x03
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xffff0000-0xffffffff: .
... Program from 0x00ff0000-0x01000000 at 0xffff0000: .
RedBoot>
    

For most of these configuration variables the default value is correct. If there is no suitable BOOTP 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. The other exception is the network hardware address, also known as MAC address. All boards should be given a unique MAC address, not the one in the above example. If there are two boards on the same network trying to use the same MAC address then the resulting behaviour is undefined.

It is now possible to load the flash-resident version of RedBoot. Because of the way that flash chips work it is better to first load it into RAM and then program it into flash.

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

The file redboot_rom.bin should now be uploaded using the terminal emulator. The file is a raw binary and should be transferred using the Y-modem protocol.

Raw file loaded 0x0002f800-0x0004613f, assumed entry at 0x0002f800
xyzModem - CRC mode, 726(SOH)/1(STX)/0(CAN) packets, 6 retries
RedBoot>
    

Once RedBoot has been loaded into RAM it can be programmed into flash:

RedBoot> fis create RedBoot -b %{freememlo}
An image named 'RedBoot' exists - continue (y/n)? y
... Erase from 0xff800000-0xff820000: .
... Program from 0x0002f800-0x0004f800 at 0xff800000: .
... Erase from 0xffff0000-0xffffffff: .
... Program from 0x00ff0000-0x01000000 at 0xffff0000: .
RedBoot>
    

The flash-resident version of RedBoot has now programmed at location 0xFF800000, and the flash info block at 0xFFFF0000 has been updated. The initial setup is now complete. Reset the board:

+Ethernet eth0: MAC address 00:00:00:00:00:03
Can't get BOOTP info for device!

RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version UNKNOWN - built 20:52:02, Mar 16 2004

Platform: DNP/5280 (Freescale MCF5280)
Copyright (C) 2000, 2001, 2002, Free Software Foundation, Inc.
Copyright (C) 2003, 2004, eCosCentric Limited

RAM: 0x00000000-0x01000000, [0x0000d3c8-0x00fed000 available
FLASH: 0xff800000 - 0x00000000, 128 blocks of 0x00010000 bytes each.
RedBoot>
    

When RedBoot issues its prompt it is also ready to accept connections from m68k-elf-gdb, allowing eCos applications to be downloaded and debugged.

Occasionally it may prove necessary to update the installed RedBoot image. This can be done by loading a RAM-resident version of RedBoot, redboot_ram.bin, rather than the DBUG version of RedBoot used above. The ROM version can then be loaded into memory using RedBoot's load command, and the flash version can be updated using fis create 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 dBUG version of RedBoot are:

$ mkdir redboot_dbug
$ cd redboot_dbug
$ ecosconfig new dnp5280 redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/m68k/mcf52xx/mcf5282/dnp5280/current/misc/redboot_DBUG.ecm
$ ecosconfig resolve
$ ecosconfig tree
$ make
    

At the end of the build the install/bin subdirectory should contain the required file redboot_dbug.srec.

Rebuilding the RAM and ROM versions involves basically the same process. The RAM version uses the file redboot_RAM.ecm and generates a file redboot_ram.bin. The ROM version uses the file redboot_ROM.ecm and generates a file redboot_rom.bin.

2017-02-09
Documentation license for this page: eCosPro License