Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Flashing 16MB uC5282 BPM Card - rtems-4.9.1

Overview of Steps

Create a 'cramfs' file system image of the netboot binary image. Store this on a machine with a tftp server that can access your target.

Connect the target BPM chassis to your desktop or laptop. Set the IP address environment variable and run the tftp server.
Transmit the file system image to the target. Program it into flash memory.

Using the uC5282 uCbootloader, set the environment variables.

Boot the image.

(Much of this document is from an email from Till, 13 March 2008)

Commands

The syntax to set variables is:
B$ setenv ENVVAR value

To clear an environment variable:
B$ setenv ENVVAR

To show a list of all variables:
B$ printenv

To show the value of a single variable:
B$ printenv ENVVAR

Detailed Steps

1 Generate directory hierarchy on host computer. Simplest case - just a root directory containing the 'netboot' binary

^h1. How-to setup the ColdFire uC5282 to run EPICS and RTEMS

To FLASH the uC5282:

If the CPU has already been flashed, skip to step 5.

STEP 1: Set the uC5282 IP address (in this example, it is 172.27.9.232):
B$ setenv IPADDR0 172.27.9.232

STEP 2: Start the the tftp server running on the ColdFire:

B$ tftp
uCTFTP Console 1.0 is running ...
IPADDRESS is 172.27.9.232
Downloading...

STEP 3: Next generate a cramfs image on your host (need the mkcramfs utility on the host):

...

image:

mkdir cramfs_top
cp /usrafs/localslac/lclspackage/rtems/rtems-4.9.1/target/ssrlApps/m68k-
rtems/uC5282/img/netboot.flashimg.bin cramfs_top/netboot.bin

...

2 Generate cramfs image (need mkcramfs utility) on host computer

...

mkcramfs cramfs_top cramfs.img

STEP 4: Next run the tftp client on your host and copy the image to the ColdFire:

$ tftp 172.27.9.232
tftp> bin
tftp> verbose
tftp> put cramfs.img

NOTE: in spite of the coldfire being a big-endian machine and cramfs internal data structures being susceptible to endianness, uCbootloader seems to expect a LITTLE-endian cramfs image (which is directly created by mkcramfs on a little-endian machine such as a x86 box)

...

3 Connect port 1 on BPM chassis to a network port.

...

Connect serial port on BPM chassis to serial port on your computer. (It must be a straight-through cable.) Connect to your local serial port using a terminal emulation program (Tera Term Pro on Windows works).

Power up the BPM chassis.

...

4 At the uCbootloader prompt B$, set the IP address environment variable, for example:

...

B$ setenv IPADDR0 134.79.219.81

Start the tftp program:

B$ tftp-- Now you should see the following on the coldfire's console:
uCTFTP Console 1.0 is running ... IPADDRESS is 172.27.9.232

...

5 Copy the cramfs.img to uc5282 target. (Your host must have a tftp server and must be able to access your target.)

...

(These instructions are for using tftp. To use the serial connection,
use the uCdimm Coldfire 5282 manual)

From your host:

hostname$tftp 134.79.219.81
tftp> verbose
Verbose mode on.
tftp> binary
mode set to octet
tftp> put cramfs.img

You will see messages like these in your host session:

Wiki Markup
putting cramfs.img to 134.79.219.81:cramfs.img [octet]
Sent 270336 bytes in 20.2 seconds \[\]
tftp>

You will see messages like these on your serial session:

........................
donePress the ESC key once you see that it is done.
Next you need to actually program and verify it

In your serial session, press ESC to exit tftp and return to the B$ prompt

...

6 Program the image into flash memory using 'program' command at B$ prompt:

...

B$ program
erase... done.
write... done.

Select boot file:

B$ verifysetenv KERNEL 0:netboot.flashimg.bin

The board has now been flashed. Next you can do one of three things (four things counting nothing):
(7a) Test that you can boot the netboot image.
(7b) Set up for production. (Do this only if you feel confident that the
flashing worked.)
(7c) Boot up to test on development.


...

7a To boot the netboot image, set the necessary environment variables and type 'go' at the B$ prompt:

...


verify...
done.
B$Next select the boot file:
B$ setenv KERNEL 0:netboot.flashimg.bin

STEP 5: Once the uC5282 is flashed, you will need to set the environment variables.

--To show your current environment variables, type:

B$ printenv

--To change an environment variable, type:

B$ setenv VARIABLE_NAME VARIABLE_VALUE

for example:

setenv BP_SRVR 134.79.19.29
setenv BP_FILE afsnfs2:/afs/slac:package/rtems/4.9.1/target/ssrlApps/m68k-rtems/uC5282/bin/rtems.ralf
setenv NETMASK 255.255.252.0

B$ printenv
FACTORY=Arcturus Networks Inc.
REVISION=uC5282 Rev 1.1 16MB External Flash
SERIAL=X49E5FA37-01080
CONSOLE=ttyS0
KERNEL_ARGS=root=/dev/mtdblock0 quiet
HWADDR0=00:06:3B:00:F0:80
FW_VERSION=010808012
_0=10000000:1000000:RW
CACHE=on
KERNEL=0:netboot.flashimg.bin
BP_SRVR=134.79.19.29
BP_FILE=afsnfs2:/afs/slac:package/rtems/4.9.1/target/ssrlApps/m68k-rtems/uC5282/bin/rtems.ralf
IPADDR0=134.79.219.113
NETMASK=B$ setenv NETMASK 255.255.252.0

B$ go
uncompress... go! 0x40000

RTEMS bootloader by Till Straumann <strauman@slac.stanford.edu>
$Id: netboot.c,v 1.33 2009/02/05 08:39:20 strauman Exp $
CVS tag $Name: rtems-4-9-1-p2 $

Press 's' for showing the current NVRAM configuration
Press 'b' for manually entering filename/cmdline parameters only
Press '@' for continuing the netboot (BOOTP flag from NVRAM)
Press 'd' for continuing the netboot; enforce using BOOTP
Press 'p' for continuing the netboot; enforce using BOOTP
but use file and cmdline from NVRAM
Press 'm' for continuing the netboot; enforce using NVRAM config
Press 'R' to reboot now (you can always hit <Ctrl>-x to reboot)
Press any other key for this message

...

7b To set up for production and using DHCP/BOOTP, set these environment variables:

...

-Set the following environment variables for LCLS production (some of these will already be set; use printenv to see which need to be set): This example is a 4MB uC5282 named eioc-in20-bp221 that is not using DHCPB$ printenv
FACTORY=Arcturus Networks Inc.
REVISION=uC5282 Rev 1.0 4MB 1 16MB External Flash
SERIAL=X4436BE72-018A9 (this value may be different)X4747745D-01DC9
CONSOLE=ttyS0
KERNEL=0:netboot.flashimg.bin*
KERNEL_ARGS=root=/dev/mtdblock0 (this probably doesn't matter)quiet
HWADDR0=00:06:3B:00:68:A9 (this value may be different)AD:C9
FW_VERSION=180008 (this value may be different)010808004
_0=10000000:4000001000000:RW
CACHE=on
(next three are optional; depends whether you want the ioc to boot up on its own the first time; also depends on whether or not dhcp will be set up in advance)
DO_BOOTP=Y
AUTOEXEC=2
AUTOBOOT=2

...

7c To boot up and test on dev, at the uCbootloader prompt B$, set the rest of your environment variables.

...

B$ printenv
FACTORY=Arcturus Networks Inc.
REVISION=uC5282 Rev 1.1 16MB External Flash
SERIAL=X4747745D-01DC9
CONSOLE=ttyS0
(this value may be different)
KERNEL=0:netboot.flashimg.bin
RAMIMAGE=yes
CACHE=on
NETMASK=255.255.252.0
DO_BOOTP=N
AUTOBOOT=5
BP_SRVR=172.27.8.11 KERNEL_ARGS=root=/dev/mtdblock0 quiet
HWADDR0=00:06:3B:00:AD:C9
FW_VERSION=010808004
_0=10000000:1000000:RW
CACHE=on
IPADDR0=134.79.219.81
DNS_SERVER=134.79.151.11
NTP_SERVER=134.79.151.11
GATEWAY NETMASK=172255.27255.8252.10
IPADDR0 GATEWAY=172134.2779.9219.2321
HOSTNAME=eioclclsdev-in20-bp22136
BP_PARM=INIT=/boot/g/lcls/epics/iocCommoniocTop/Bpm/Bpm-R1-0-10/iocBoot/eioc-in20bsy0-bp221bp51/startupst.cmd
LOGHOST=syslog-host
DNS_DOMAIN=slac.stanford.edu
BP_FILE=afsnfs2:/afs/slac:/package/rtems/4.9.1/target/ssrlApps/m68k-rtems/uC5282/bin/rtems.ralf
DNS BP_DOMAINSRVR=slac134.79.stanford19.edu

A 16 MB uC5282 is the same except that RAMIMAGE=no.

References

^29
DO_BOOTP=N