NSLU2-Linux
view · edit · print · history

What do we mean by a "Bad Flash" ?

This page describes how you can get your Slug working again after its internal flash memory has somehow become corrupt. It doesn't really matter how it became corrupt since the recovery procedure is the same; the most obvious cause, however, is disconnecting the power mid way through an attempt to program the flash, or something like that.

But there are plenty of ways in which you can make your Slug unbootable without having corrupted the internal flash. For example, you may have changed the IP configuration so that it is no longer accessible on your network. Apparently a "disk full" condition can also cause boot failure. In these cases you should probably try to find another solution before resorting to re-flashing.

The role of the bootloader

The very first portion of the Slug's internal flash contains a program called Redboot. This is a bootloader and is run before Linux starts. None of the software distributed by this project changes this portion of the flash in normal use.

Redboot provides an "upgrade mode" which is entered if you hold down the reset button for 10 seconds when powering on. The normal procedure for re-flashing involves communicating with the bootloader in this mode. So if you have somehow corrupted your bootloader, this procedure can't work. In this case you need to use special JTAG hardware to re-program the flash. This is described further here. But, as noted above, the software distributed by this project doesn't change the portion of the flash containing Redboot in normal use, so you are unlikely to find yourself in this position. Possible ways of corrupting Redboot that you ought to avoid include:

  • Using the Linksys EraseAll tool.
  • Using the -C option to upslug2 (this is disabled by default).
  • Writing to /dev/mtd0 or /dev/mtdblock0.
  • Typing the wrong thing at the RedBoot or APEX command line.
  • Forgetting to copy the APEX bootloader to RAM, and then trying to upgrade the flash while running from flash.

Re-Flashing using Upslug2

This is the normal procedure for recovering from a bad flash. It is a reasonably safe method. Basically you put the Slug into "upgrade mode" by holding down the reset button for ten seconds when powering it on, and then run the upslug2 program on a PC on the same network to send the new flash data. This is all described in great detail on this page: Main.UpSlug2. You should read that page now.

Mac Users

Apparently Upslug2 works on MacOS X. This is described on the Main.Upslug2 page.

Windows Users

I believe that the Upslug2 program is not available for Windows. So if you don't have a Linux PC you should get yourself a "Live" Linux CD (e.g. Knoppix or similar) and boot from that, and then use Upslug2.

You can also use a VMWare appliance which creates a virtual Linux box on your PC. You'll need the free player and free appliance image with Debian Etch, also available at this direct link. This worked great for me. You can then install the Upslug2 program and you're away!

If for some reason you don't want to run any form of Linux on your PC, there is another way of sending the new flash data to a Slug in upgrade mode - you can use the Sercomm program. This is described in detail on this page: Main.SercommFirmwareUpdater.

An alternative procedure

There is an alternative to using Upslug2 or Sercomm in combination with RedBoot's upgrade mode. However, you almost certainly don't want to use this alternative because:

  1. This mode still requires that you have a non-corrupt Redboot program in your flash, so it can only work in cases when Upslug2 or Sercomm would also have worked.
  2. It is possible for you to corrupt your Redboot program if you don't get the commands exactly right.
  3. It is more complicated than using Upslug2 or Sercomm.

If I have failed to discourage you, the details can be found on this page: HowTo.ReflashUsingRedbootAndTFTP.

Yet another procedure, which also has no benefits that I can see and is even more obscure, is described on HowTo.ReflashUsingApexAndXmodem.