Imbrium Logo

How to Download an Image File to the uCdimm

The Basics

Usually, Arcturus Networks ships a fresh uCdimm with a 2.0.38-something kernel pre-installed. Since we all want to use the current 2.4.x linux kernel (don't we?) and the elf tools together with the uClibc, the need to know how to download a new image file to the uCdimm is required.

Firstly, upon booting up the uCdimm, only the serial console (on /dev/ttyS0) will be active, therefore a serial terminal program that can do vt100 is required to talk to the module.

I would suggest the use of minicom because this program is usually installed in most Linux distributions and most importantly, it can handle the so-called Xmodem protocol that is used by the uCbootstrap on the uCdimm

Note: The uCbootstrap is a special bootloader program that resides in the first few sectors of the Flash. It handles a lot of things needed for booting and such including a simple way of loading a new image to RAM and programming that to the Flash.

I will take it for granted that you know what a serial port is, how to connect this to your PC and the uCdimm with a 1:1 9-pin cable of which pins 2 (TX), 3 (RX) and 5 (Gnd) are connected.

How to Start minicom

Before you start, make sure that the Xmodem program is properly linked to work. Some Linux distributions have it set up incorrectly. To make sure Modem works, go to /usr/bin and check to see if the programs rx and sx are present. If they are not, do the following:

	# ln -sf /usr/bin/rz /usr/bin/rx
	# ln -sf /usr/bin/sz /usr/bin/sx

For the first time ever, you should invoke minicom -s as root and set a default configuration that you can use as a normal user. Then go to Serial port setup , and select the Serial Device that you are using. This is usually /dev/ttyS0 or /dev/ttyS1 . Then set the Bps/Par/Bits to 19200 8N1 . Also, to avoid sending init strings to the uCdimm, go to Modem and dialing and set the init string to a simple ~^M . Save this a default and exit minicom via Ctrl-A Q (Leave without reset).

Now start minicom with your user account and hit Enter to get the bootloader prompt B$ . If that works, you can simply type go to boot the Linux kernel that is factory installed.

To load a new image with your setup, you must build an image file for the uCdimm which is usually called image.bin as resides in /opt/uClinux-dist/images, /tfpboot or the like. I usually copy this to my $HOME or from whereever I start minicom.

To enable a fast download, you can set the console speed to 115200 Baud, this makes downloads much faster. Sometimes I have seen that the uCdimm behave a bit silly when in this mode, I guess it depends on when you initiiate the Xmodem download...

To engage the fast mode, type fast at the boot prompt and then hit Ctrl-A P I in minicom to switch to 115200 baud. You should then see the boot prompt again. To download the image, type rx and then Ctrl-A S , select Xmodem and then the file image.bin from the directory list.

Now either the download works or it will fail with NAKs. In the latter case, you have to reset the uCdimm, switch minicom back to 19200 Baud via Ctrl-A P F and do the above process again. I sometimes have to do this 3 to 4 times and then it usually works fine. If you simply cannot download the image at fast speed, do it at 19200 Baud, although this will take a lot longer.

When download is finished, your image file will be loaded to RAM. Type program to load this image to Flash. This should look something like this:

	
	B$ rx                                                                               

	1967104 bytes buffered
	B$ program
	erase..done.
	write..done.
	B$

After the image is loaded, type go to see if it works.

In my next document, I will try to explain the /etc/rc file and show the changes that I've made to make an NFS connection work. This way, a download of an image to the uCdimm will be a lot simpler and much faster.

Good Luck!