Setup

Name

Setup -- Preparing the CSB337 board for eCos Development

Overview

In a typical development environment, the CSB337 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
ROMRAMRedBoot running from RAM, but contained in the board's flash boot sector.redboot_ROMRAM.ecmredboot_ROMRAM.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

The CSB337 boards are shipped from Cogent with a version of Micromonitor installed.

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

Connect a serial cable between the CSB337 board serial port 0 and a host computer and start a terminal emulator such as HyperTerminal. Experiments indicate that the version of the Xmodem protocol used by Micromonitor is incompatible with that used by the Linux minicom program. It does work with HyperTerminal, so at present RedBoot must be installed from a Windows host.

When Micromonitor starts up you will see something similar to this:

TFS Scanning //FLASH/...                                                        
EMAC: Auto-Negotiate Complete, Link = 100MBIT, Full Duplex.                     
MICRO MONITOR                                                                   
CPU: AT91RM9200 ARM920T                                                         
Platform: Cogent CSB337 - AT91RM9200 SBC                                        
Built: Jan_29,2004 @ 11:42:57                                                   
Monitor RAM: 0x20000000-0x2001a044                                              
Application RAM Base: 0x20100000                                                
MAC: 00:23:31:37:00:01                                                          
IP: 192.168.254.210                                                             
uMON>

Start the download by giving the following command to Micromonitor:

uMON>xmodem -d -a 0x20040000

You may get a sequence of binary characters, which indicate that Micromonitor is waiting for the download to start. Use HyperTerminal's X-Modem file transfer option to send the file redboot_RAM.bin.

When the transfer is finished you will see something like:

Rcvd 868 pkts (111104 bytes)
EMAC: Auto-Negotiate Complete, Link = 100MBIT, Full Dupex.
uMON>

Start RedBoot with the call command, which should result in RedBoot starting up.

uMON>call 0x20040040
+Ethernet eth0: MAC address 00:23:31:37:00:1c
IP: 10.0.0.210/255.255.255.0, Gateway: 10.0.0.1
Default server: 10.0.0.102, DNS server IP: 10.0.0.1

RedBoot(tm) bootstrap and debug environment [RAM]
Non-certified release, version v2_0_11a1 - built 13:21:01, Feb 12 2004

Platform: Cogent CSB337 (ARM9)
Copyright (C) 2000, 2001, 2002, Free Software Foundation, Inc.

RAM: 0x00000000-0x02000000, [0x00065e40-0x01fdd000] available
FLASH: 0x60000000 - 0x60800000, 64 blocks of 0x00020000 bytes each.
RedBoot>

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

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

Again, use HyperTerminal's Xmodem support to send the file redboot_ROMRAM.bin. This should result in something like the following output:

Raw file loaded 0x00030000-0x0004d15f, assumed entry at 0x00030000      
xyzModem - CRC mode, 932(SOH)/0(STX)/0(CAN) packets, 3 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
2299507324 119136 redboot_ROMRAM.bin

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

RedBoot> cksum -b %{FREEMEMLO} -l 119136
POSIX cksum = 2299507324 119136 (0x890fb27c 0x0001d160)

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 -f
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0x60020000-0x607e0000: ..................................
... Erase from 0x60800000-0x60800000:
... Unlock from 0x607e0000-0x60800000: .
... Erase from 0x607e0000-0x60800000: .
... Program from 0x01fe0000-0x02000000 at 0x607e0000: .
... Lock from 0x607e0000-0x60800000: .
RedBoot> fis create -b %{FREEMEMLO} RedBoot
An image named 'RedBoot' exists - continue (y/n)? y
... Erase from 0x60000000-0x60020000: .
... Program from 0x00100000-0x00120000 at 0x60000000: .                         
... Unlock from 0x607e0000-0x60800000: .                                        
... Erase from 0x607e0000-0x60800000: .                                         
... Program from 0x01fe0000-0x02000000 at 0x607e0000: .                         
... Lock from 0x607e0000-0x60800000: .                                          
RedBoot>

The CBS337 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 CSB337 are:

$ mkdir redboot_csb337_romram
$ cd redboot_csb337_romram
$ ecosconfig new csb337 redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/arm/arm9/csb337/VERSION/misc/redboot_ROMRAM.ecm
$ ecosconfig resolve
$ ecosconfig tree
$ make
    

To rebuild the RAM version of RedBoot:

$ mkdir redboot_csb337_ram
$ cd redboot_csb337_ram
$ ecosconfig new csb337 redboot
$ ecosconfig import $ECOS_REPOSITORY/hal/arm/arm9/csb337/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. This is the case for both the above builds, take care not to mix the two files up, since programming the RAM RedBoot into the ROM will render the board unbootable.

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