Soekris BIOS upgrade using MacOSx Snow Leopard
I've been working with soekris hardware for quite some time now, but I didn't need to upgrade the firmware/BIOS of any soekris box until today. Even if the process is well documented in the soekris wiki, I've found that it was a little bit tricky to do it using a MacBook running Snow Leopard. So let me explain how I managed to do it.
First let's do some inventory for this small tutorial. We will need:
3- A usb-to-serial adapter (we need this, because the MacBook does not have a serial connector)
6- Some utilities to send the firmware files to the soekris using the RS-232 link. The easiest way to install them is using MacPorts (so if you don't have MacPorts installed on your system go ahead and install them now):
sudo port -v install lrzsz
Ok, now that we've everything we need, let's go for it!
First we have to attach one end of the RS-232 cable to the soekris box (I don't have pictures of this but you can use google to see how to do it with some pictures) and then we have to attach the other end to the usb-to-serial adapter. Then we have to connect the usb adapter to the MacBook.
ls -l /dev/tty.PL2303-*
You should see something like /dev/tty.PL2303-00001004 (the number after the - will be probably different, as it changes depending on the OSx version and the usb-to-serial adapter itself). If the device does not exist, OSx does not recognize the hardware and you need to install some stuff before using it. Just get the needed drivers from here:
Install the needed stuff and repeat the process until you find the device in the correct place.
screen /dev/tty.PL2303-00001004 19200
we can use cu:
sudo cu -l /dev/tty.PL2303-00001004 -s 19200
and there are even more options, like minicom and some others.
sudo cu -l /dev/tty.PL2303-00001004 -s 19200
and we plug the power cord in the soekris power socket. As soon as it boots up, we will see something like this in the screen where we are running cu:
POST: 012345689bcefghips1234ajklnopqr,,,tvwxy comBIOS ver. 1.32 20070606 Copyright (C) 2000-2007 Soekris Engineering. net5501 0256 Mbyte Memory CPU Geode LX 434 Mhz Slot Vend Dev ClassRev Cmd Stat CL LT HT Base1 Base2 Int ------------------------------------------------------------------- 0:01:2 1022 2082 10100000 0006 0220 08 00 00 A0000000 00000000 10 0:06:0 1106 3053 02000096 0117 0210 08 40 00 0000E101 A0004000 11 0:07:0 1106 3053 02000096 0117 0210 08 40 00 0000E201 A0004100 05 0:08:0 1106 3053 02000096 0117 0210 08 40 00 0000E301 A0004200 09 0:09:0 1106 3053 02000096 0117 0210 08 40 00 0000E401 A0004300 12 0:17:0 1814 0301 02800000 0117 0410 08 40 00 A0008000 00000000 15 0:20:0 1022 2090 06010003 0009 02A0 08 40 80 00006001 00006101 0:20:2 1022 209A 01018001 0005 02A0 08 00 00 00000000 00000000 0:20:4 1022 2094 0C031002 0006 0230 08 00 00 A0010000 00000000 07 0:20:5 1022 2095 0C032002 0006 0230 08 00 00 A0011000 00000000 07 3 Seconds to automatic boot. Press Ctrl-P for entering Monitor.
Good, this is the usual information we will see when booting a soekris board. If we look carefully, we will see the version of the current firmware running in that board:
comBIOS ver. 1.32 20070606 Copyright (C) 2000-2007 Soekris Engineering.
This time it is version 1.32, a little bit outdated as latest version is 1.33c.
Ok, we have to press ctrl+p when the BIOS asked us to do it (otherwise the boot process will go on, trying to boot from an attached CompactFlash card, a hardrive or using PXE Boot). Once we've pressed the shortcut, we will see a command prompt where we can use some commands to interact with the soekris BIOS. There is even a small help containing a list of available commands:
comBIOS Monitor. Press ? for help. > ? comBIOS Monitor Commands boot [drive][:partition] INT19 Boot reboot cold boot download download a file using XMODEM/CRC flashupdate update flash BIOS with downloaded file time [HH:MM:SS] show or set time date [YYYY/MM/DD] show or set date d[b|w|d] [adr] dump memory bytes/words/dwords e[b|w|d] adr value [...] enter bytes/words/dwords i[b|w|d] port input from 8/16/32-bit port o[b|w|d] port value output to 8/16/32-bit port run adr execute code at adr cmosread [adr] read CMOS RAM data cmoswrite adr byte [...] write CMOS RAM data cmoschecksum update CMOS RAM Checksum set parameter=value set system parameter to value show [parameter] show one or all system parameters ?/help show this help >
For the purpose of upgrading the firmware/BIOS, we need two of those commands, download (to get a copy of the new firmware) and flashupdate (to perform the upgrade).
This is the tricky part. In the prompt, we run the following command:
> download -
We will see a message like this one:
Start sending file using XMODEM/CRC protocol.
And we will have some time to send the new firmware file using XMODEM. As we can read in the official docs, we are supposed to press ~+ and then write a command (lsz -X) that will send the firmware files to the soekris.
But, as I found out after so many tries, it doesn't work. I tried using so many key strokes and combinations and I wasn't able to do it, until I tried one hell of a dirty trick: I just wrote the whole command somewhere else (in another tab of Terminal.app for example):
~+sz -X b5501_133c.bin
> download - Start sending file using XMODEM/CRC protocol. ~+sz -X b5501_133c.bin Sending b5501_133c.bin, 784 blocks: Give your local XMODEM receive command now. Bytes Sent: 100352 BPS:961 Transfer complete File downloaded succesfully, size 784 Blocks.
Two important things here:
I had the firmware file (b5501_133c.bin) in the directory from where I was running cu. If the firmware file is somewhere else in the filesystem, we've to use the full path to the file.
$ port contents lrzsz Port lrzsz contains: /opt/local/bin/rb /opt/local/bin/rx /opt/local/bin/rz /opt/local/bin/sb /opt/local/bin/sx /opt/local/bin/sz /opt/local/share/man/man1/rz.1.gz /opt/local/share/man/man1/sz.1.gz $
Fine, now that a copy of the new firmware file is in the soekris we only have to install it, using flashupdate:
> flashupdate Updating BIOS Flash ,,,,,,,,,,,,,,,,,,,,,,,,,,,,..,,,,.... Done.
Once the BIOS has been updated, we just have to reboot the soekris box:
And we will see the updated BIOS version on boot:
comBIOS ver. 1.33c 20080626 Copyright (C) 2000-2008 Soekris Engineering.
And et voilá, we've done the firmware upgrade. As I told you at the beginning of this small article, it was difficult at first, because I was getting on my nerves trying to reproduce the steps from the official docs one time and another. I still don't know what the problem is, and why it is not working just writing the command, but the copy&paste trick just worked fine.
I hope you will find this small tutorial useful some day.