NSLU2-Linux
view · edit · print · history

UpSlug is a (Linux / MacOS? X / but not Windows - Windows users use SercommFirmwareUpdater) tool to flash your NSLU2 from an external computer on the same subnet (direct Ethernet access is needed; it won't work if you have routers or NAT devices between you and the NSLU2, though WiFi? via a wireless router is OK).

UpSlug has been verified to work with the NAS200, but you will have to use a NAS200 image of course, and you will have to use the -f option because NAS200 images don't have the SerComm signature (if you make a mistake, you can always do it again because the Redboot area in memory will not be overwritten as long as you use -u, not -U). This is great if you flashed the NAS200 with a bad image but you can still access Redboot through the serial port or via Telnet. Unfortunately it will not save you if you bricked your NAS200 by typing "flash" at the command prompt.

UpSlug2 is a completely rewritten version of this tool which is more robust and flexible, though it still requires an ethernet connection to the NSLU2.

The UpSlug firmware upload tool is now in alpha phase. The code can be found in the upslug module of the nslu.sf.net CVS repository

Instructions to build are found here

The release at the time this page was last updated is 1.17 (of upslug.c).

Command Line Options
-i [interface name]Interface is set to the interface specified. Defaults to eth0.
-s [slug_id]Will communicate with the slug specified instead of letting the user choose. Format: 00:11:22:33:44:55
-u [image_name]Uploads the firmware specified.
-U [image_name]Same as -u but erases the entire contents of the flash (including redboot). Please confirm JTAG support before testing this.
-rResets the slug.
-fForce the reflash. Suppress prompts.

UpSlug must be run as root or with the sudo command.

Switch the nslu2 into Upgrade mode

UseTheResetButtonToEnterUpgradeMode

If you want to upgrade your slug without letting your NSLU2 reach the "running" state, you need to enter RedBoot upgrade mode. There are two ways to do this. First, you can interrupt RedBoot in the normal way described here and then type upgrade at the RedBoot prompt. If this fails (it can be difficult to get the timing right):

  1. Power off the slug.
  2. Hold the reset button in (the button is behind the small hole in the back of the case.)
  3. Press and release the power button to turn the slug on (while still holding the reset button on.)
  4. Wait about 10 seconds until the ready/status LED turns from amber to red, immediately release the reset button.

After these steps the slug will be in upgrade mode - the ready/status LED will flash alternately red and green. This continues until the slug is reset by the upload software.

UpSlug status and problems

The changes in release 1.14 of upslug.c are believed to fix the following problems:

  1. UpSlug hangs (the download stops) in the presence of high levels of network activity.
  2. Some upslug commands could get ignored by the NSLU2 because the network packet containing the command is lost and upslug was not checking for successful receipt.
  3. Some error conditions were not detected.

Verification of the flash image is non-functional in this version, however this is fixed in 1.17 and later.

1.16 (and later) also fixes a problem on heavily loaded networks when responses from the NSLU2 may get dropped.

Even in 1.17 there are probably still errors in the protocol handling. UpSlug2 should fix all of these since the protocol return codes are verified correctly.

Upslug output

During download upslug outputs a progress indicator every 128KBytes. The indicator is a hexadecimal digit, thus the indicator goes through 4 cycles 0 to f for the 8MByte flash image.

The data is transmitted in 512 byte packets. If the NSLU2 does not acknowledge receipt of a packet it is retransmitted and a single * character is output.

Because the erase takes a long time a number of * characters are output initially (while upslug waits for response to the first write packet), then upslug outputs the message Writing flash and starts outputting progress digits.

If NSLU2 response packets are duplicated (resulting in an out of sequence response) upslug will output a + character and continue looking for the expected response packet (changed in 1.16).

The importance of upgrade mode

With the current OpenSlug, new (> v4.20 beta) Unslung versions the NSLU2 must be in upgrade mode before UpSlug can see it. This is because OpenSlug does not currently listen for the packets used in the upgrade protocol.

Problems with upslug

The following entries refer to problems with upslug which should now all be fixed. Please report any occurence of these problems with the latest (1.17) version, as well as any new problems!


This tool has worked consistently for several people. The support for multiple slugs seems to work as well.

  • UpSlug now has support for multiple slugs
  • Sometimes the slug ignores the reset command even though it has been received. If upslug says it is done and the slug does not reboot within a couple of minutes then you must manually reset the slug. Do not try to reflash the slug if this occurs as it will not flash correctly. Upslug can recover from this but it is better to just reset and try again.

Please post any issues that you have with this tool here

  • I must use the --upload force option always. (dyoung)
 (messages)
Verifying File Contents...
Counted Blocks:1073851176
Needed Blocks:16384
Error: File not large enough, use --upload-force to override

The image being loaded is built by oe.
This should be fixed now, please test. Works for me (devil26)

  • 13 Jan 2005: mikeb reports a bug on his system: upslug dies with an error (upslug version:1.12, from CVS. Gentoo Linux, kernel v2.6.9-r1, gcc v3.3.4) Here's a section of the output:
 Do you really want to upgrade the slug(y/n)? y
 Requesting upgrade...comfirmed
 Erasing Flash...upslug: Resource temporarily unavailable

I tracked this message down to the first call to recvfrom() in the write_image() routine, but I don't know beans about Unix socket programming so I stopped there.
This issue has been resolved in version 1.13.

My slug was hosed after upslug crashed (blinking red light; I presume it was waiting for more data) but after spending a couple minutes emerging TFTP and fiddling with ifconfig (to move my server to the 192.168.0.* subnet where it was visible to the slug) I got unslung installed using the TFTP instructions. My thanks to all of you for figuring out all these methods! (mikeb)

  • 8 May 2005: upslug suddenly stopped detecting my nslu2 even though I could still arping it. With access to the RedBoot prompt, putting RedBoot into upgrade mode with "upgrade" allowed upslug to detect the nslu2 and proceed with the upload. Thanks jbowler for the tip. (corys)
  • 10 Aug 2007; while uploading di-nslu2.bin (Debian 4.0), upslug2 (v11-1) would repeatedly time out at:
    * 5bd87f+0005c0 ...UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU*------------------

Switching from a wireless NIC to a wired one fixed it. (dharple)

Feature Requests

  • It might be nice to have upslug only talk to slugs. Right now it detects other stuff on my net like print server. (dyoung)

I'm not sure how we can do that...

  1. Maybe by product ID (though that wont for for me since I stuffed mine up a while back)
  2. By MAC Address 00:04:5a:xx:yy:zz

[jbowler: UpSlug2 does this by checking the hardware ID - this comes out of the tail of the RedBoot partition when it is written by LinkSys?. This may cause UpSlug2 to fail to recognise some slugs, if they have a different ID.]

Got upslug to work

Even I used version 1.13 I still got Erasing Flash...upslug: Resource temporarily unavailable

I decided to fix it myself since my NSLU2 is not bootable anyway. I made some changes and it worked. upslug restored the firmware without any trouble. The major change is to ignore the error and let it continue to write.

I hacked upslug.c a little bit, below are the changes:

  • Change strcmp to strcasecmp so it can identify Mac address in upper case
  • Change all &pkt to pkt. I am wondering why it works for others because from a standard C point of view, memset(&pkt, 0, ...) seems not right.
  • Ignore recvfrom() error in write_image

I compiled upslug under Redhat 7.2 and used it to flash firmware for my NSLU2 and it worked. I tar and gzip binary and source files to http://ctsai.erinna.com/upslug.tar.gz(approve sites). Would someone merge my changes to the source!

(jbowler: these changes, plus others, are in upslug 1.14)

For upslug -r to work, the download process must be running. /etc/rc.d/rc.1 should start it, but - at least in my environment - this is commented out. I did this a long time ago because I don't like the idea of an unsecured service that will reboot (and reflash) hardware. I think this is also true in the current release. In any case, if upslug reports

Finding Slugs... 0 found upslug: no slugs found, turkey problems?

and you have routes and cables properly configured, telnet into the slug and do a ps | grep download. If it's not running, ru /sbin/download to start it.

--tlhackque

I tried using upslug2, and it didn't work for me. Upslug couldn't find the slug. I had the two machines connected directly via the ethernet port (no hub or router), and the slug was flashing red/green.

--bcrowell

Page last modified on February 13, 2009, at 11:17 PM