Jan 5, 2006
Setup and Configuration of
Motorola Single Board Processors
Linac Coherent Light Source ¥ Stanford Synchrotron Radiation Laboratory
The LCLS Control System will make use of different processors for IOCs, including Motorola processors. This document describes how to setup and configure an mvme5500 or mvme6100 processor for use with RTEMS and EPICS. We'll refer to the Motorola processor being configured as the SBC (Single Board Computer.)
The RTEMS/EPICS boot process has two stages; once the processor is setup correctly, it will execute the netBoot program that is stored in its flash memory. The netBoot program then reads the rest of the software from the network, specifically the EPICS server software that you need to run on the IOC. It loads it in memory and starts it running.
Quick Summary of Steps
1. Install the SBC into a VME chassis.
2. Connect the console and ethernet cables.
3. Download the NetBoot software to flash memory in the SBC.
4. Configure the boot parameters.
5. Test the boot process.
6. Set the SBC's default boot behavior.
1. Inventory; make sure you have the pieces that you'll need:
1. Get a network address for your SBC. For the time being, please come see me to get a number allocated. We will have this available online at some point.
2. Get an SBC, either the mvme5500 or an mvme6100.
3. A VME enclosure with power for the SBC.
4. Two Ethernet cables, and an Ethernet to Serial adapter. You might also need a DB9 to USB adapter; see below.
1. The Ethernet to Serial Adapter physically connects the wires from the RJ45 connector of the ethernet cable to the pins of a female 9-pin serial connector, as shown in Figure 1 below.
2. The DB9 to USB adapter will be needed if your computer doesn't have a 9-pin male serial connection. Some computers use USB exclusively for serial communication, such as the Mac.
Figure 2. DB9 to USB Adapter; The Keyspan USA-19HS for the Mac.
5. You'll need network access to the LCLS Development server (lcls-dev.slac.stanford.edu)
6. A computer running UNIX (Linux, MacOS X, Solaris, etc.) or Microsoft Windows.
The computer must have an available serial port. If the computer has only USB connections with no DB9-type serial ports, you'll need a serial DB9 to USB adapter. For MacOS X, we use the Keyspan model USA-19HS.
Setup; if you're using
an mvme550, you should disable the ability to overwrite the firmware
monitor. If the MOTLoad software
is accidentally overwritten, Motorola will charge around $90 to restore it.
1. Remove the J9 jumper, which is installed by default from the mvme5500 CPU, as shown in Figure 3 below.
2. Write down the ethernet (MAC) addresses from the SBC. They are typically visible on white labels attached to the top of the board, near the front faceplate.
3. Assembly; the next step is to put it all together. The goal is to end up with something that looks like this:
Figure 4. Basic IOC Setup for Development
1. Insert the mvme5500 or mvme6100 CPU into the VME enclosure.
2. Connect the serial cable for the IOC Console.
Figure 5 shows the bottom of the front panel of an mvme6100 SBC, and the jack labeled DEBUG is for the serial console cable. The mvme5500 looks similar, but the console jack is labeled COM1 instead of DEBUG.
Figure 5. SBC Front Panel Connections for the mvme6100.
Insert an ethernet cable to the bottom RJ45 connector on the CPU. Insert the other end into the RJ45 to DB9 adapter, and plug that adapter into the serial port on your computer.
3. Connect the second ethernet cable to the RJ45 jack that is second from the bottom on the CPU. On the mvme6100, it is labeled LAN1; on the mvme5500, it is (incorrectly) labeled ENET2. Insert the other end into an ethernet data port in your office.
Download and Store;
now we'll get the software that the SBC will need to boot, and write it to
flash memory. In the example
output that follows, the text that you need to enter is highlighted and in bold italics. When
the mvme5500 requires commands different from the mvme6100, both will be shown.
1. Login to your computer, and run a terminal emulation program. The terminal emulation software allows you to see the output from the SBC, and to type commands to the firmware monitor.
1. On Linux, you can use minicom. On MacOS X use zterm. On Windows, TeraTerm is popular. You might need to have administrative privilege to use these programs on certain platforms.
2. Make sure the settings for the connection are correct; 8 data bits, 1 stop bit, no parity, 9600 baud. Also make sure that you're accessing the correct serial COM port on the computer.
Power up the crate or enclosure holding the SBC. After a few seconds, some text will
appear in the terminal emulation window.
You'll be prompted to enter a command, in this example
3. First, set the time of day using the set command. The time is of the format MMDDYYHHMMSS. So, November 3, 2005 at 2:27 PM would be set like this:
download the NetBoot program into the IOC. To do this, you'll need your IOC's network address. To see the currently assigned
addresses, you can visit
Note this is a SLAC-only website.
In this example, we'll assume its 18.104.22.168. Do not use this address, it's currently assigned to Sheng, and you can't take it; you must have your own. It needs to be entered after the "-c" for client on the command line. Note that the backslash (\) is put at the end of the line as a continuation marker. You can simply type the remainder of the command without the backslash.
The "-s" parameter allows us to specify the server address, which is 22.214.171.124, the address of lcls-dev, the LCLS Development server. The "-m" parameter indicates a netmask to use to access the server.
Finally, the "-f" parameter indicates the name of the file containing the sequence of values to be loaded into memory.
For the mvme6100 processor, the command is identical. The same version of the NetBoot program is downloaded, although the output on the screen will be slightly different.
5. At this point, we'll disable the network activity on all adapters, to ensure nothing interrupts us while we copy the image to flash memory. This is not essential, because it is not likely that any network activity would have an effect on the system at this point.
6. Now we can actually copy the memory image that we downloaded in step 4 above from RAM into Flash. That is, we're copying it from temporary memory into a more permanent memory that will last after power failures or restarts. If you notice in the tftpGet output, it tells us the load address, in this example for the mvme5500, it was 005C3000. The load address is the location to which the file was copied. We'll copy this file from that memory location into the Flash memory, so it won't be lost. In this example, the flashProgram command is used; the "-s" parameter indicates the source of the data to be copied, in our example 0x005C3000. The "-v" parameter tells the software to be verbose about what it's doing. It prints a few lines, then asks you to confirm.
For the mvme6100, the load address is 006B7000. Accordingly, for that processor, the command would be:
Test the Boot Process;
you've "flashed" the processor.
Now, you can emulate the boot process to test that it will work.
1. First, we're going to confirm that the flash memory was written correctly, and test the boot procedure at the same time. The bmw command performs a Block Move Word request, and it ensures that the data being copied is word aligned. The idea is to do exactly what the normal boot procedure will do with each subsequent reboot of the processor; it will copy the contents of the persistent flash memory into main memory using the bmw command.
We could easily just tell the processor to boot from the downloaded image that is still in memory, at address 5C3000 (for the mvme5500). But using bmw to copy the memory from flash will ensure that the flash memory contains the right stuff.
If we look back to the output from the flashProgram command in step 4.6 above, we see that the "Destination Starting/Ending Addresses" was printed out. This is the address in Flash memory that has the copy we need. This is handy, since the bmw command needs the start and end addresses (rather than the number of bytes, as one might expect.)
The "-a" and "-b" parameters indicate the start and end addresses of where we want to copy from (the source of the copy.) The "-c" parameter indicates the location to which the data will be copied. In this example, we'll copy the data to location 4000000 in main memory.
First, for the mvme5500 processor, you would type:
For the mvme6100 processor, you would type:
After copying the data, we can use the go command to start executing the instructions represented by that data. Shortly after the program begins, it will attempt to load the rest of the RTEMS software into memory from the network.
Instead of allowing that to happen, we can press any character on the keyboard to interrupt the process. You only have a couple of seconds to interrupt the process, but at that point, you will have the attention of the netBoot software, and can change its configuration parameters. Keep in mind that the prompt only stays there for a few seconds, so pay close attention and press any key when you see that prompt.
This process is the same for the mvme5500 and 6100.
2. At this point, you've confirmed the flash memory contains the right data. The netBoot software will recognize several commands from your keyboard, and it's listed them after you've interrupted its boot process.
Normally when it runs, netBoot attempts to download the software that you ultimately want to use. To do so, it keeps several parameters in non-volatile memory (NVRAM.)
Now you're going to set those various parameters and record them in NVRAM. Press "c" to change the parameters that netBoot will use to download software. Keep in mind that your own processors IP address must be entered under "My IP", just as it's name.
Typically, only the fields marked "My IP" and "My name" will have values unique to your processor. All other fields should be entered as you see here. If you have questions, please ask someone.
Now you can continue with the boot process. When you're done setting the values in the previous step, you'll be given the list of netBoot commands again. Type "m" to continue with the boot process to make sure everything is correct.
You'll see a very long set of messages come from the processor console, ending in a prompt that says "Cexp>". RTEMS has successfully started running on your processor.
6. Saving an Automatic Boot Script; those few steps that you took before changing the NVRAM are all that are needed to reboot the computer again. Now, we can save those steps so the processor can perform them automatically each time it restarts.
The MOTLoad firmware in Motorola processors makes use of environment variables to do various things. These variables retain their values between restarts, and when the power is off. They are stored in a reserved area of NVRAM.
In particular, the environment variable named mot-script-boot contains a string of characters that are interpreted as commands. These commands are executed each time the processor starts.
The gevEdit command is used to create or change an environment variable. These are different for each type of processor, because of the Flash memory address. So, for the mvme5500, you would type the following:
On the mvme6100, you would type:
Confirm that the mot-script-boot variable is set correctly. You can type gevShow, and the contents of the environment variables will be printed.
7. Reboot the Processor; you can power cycle the crate or if you have a "cExp>" prompt, you can type rtemsReboot() and the processor will restart. It will boot up automatically, loading the rtems.exe file specified in the NVRAM. Change that filename to boot another file as your IOC development proceeds.