Unbrick SheevaPlug

by Mike Levin on September 8, 2010

Dorothy, you’re not in BIOS anymore. Yep, I bricked my SheevaPlug. This happened somewhere along the line of debootstrapping onto an SD card, a process which in all other ways went butter smooth. I posted that video to make the details of interacting with these silly embedded system more clear.

I have two five SheevaPlugs, and am experimenting around with them figuring out how best to guide people on turning them into general purpose “Shank Servers” and a nice bare-bones minimal system. There is a lot to work out. First of all, it’s on the ARM architecture as opposed to Intel-style x86 architecture. That means everything is just a little bit different. We are specifically on the Kirkwood version of the ARM technology purchased by the company called Marvell from Intel, when Intel divested itself of the XScale technology, previously created by DEC called StrongARM, licensed from ARM, founded in a collaboration between Acorn, VLSI and Apple as a response to Commodore’s 6502 domination over low-end CPUs, which they acquired from MOS, a chip-provider to HP that hired a Chuck Peddle who previously worked for Motorola to make a $25 CPU-for-the-masses alternative to the $300 Motorola 6800 chip.

Pshwew! So there’s some quick history of the direct and indirect legacy of the hardware of that little SheevaPlug. It represents an alternative, computers for the masses—not the classes, branch of computing, today picked up by Raspberry Pi as a charity-type thing in the UK by which an actual computer that encourages hacking and learning is cheaper than a textbook. The SheevaPlug was the precursor to this, and still quite viable as a “headless” tiny computer.

We are on a processor with a rich history, currently being sold by Marvell as “embedded systems”. I think it’s a great system to be on, because a whole bunch of stuff uses it, and the open source community are familiar with it. But things are different right down to the bootloader, so there’s some new stuff to learn. Making matters worse, there’s all these “embedded systems people” in the forums who already understand this stuff–making those of us just making the transition feel stupid. Even a basic system install is a struggle.

But I am on a mission to help others make this transition with a little less pain. I’m making a switch as a developer to open source embedded systems, and the SheevaPlug is the perfect way to do it.

On x86 hardware, the common bootloaders to get Linux loaded are Lilo and Grub. Lilo is the simple one that I chose for ShankServer on x86 hardware, and Grub is the fancy one that handles more operating systems and multi-boot situations. But on embedded systems, there’s another popular one called Das U-Boot (Universal Boot Loader). And just as with x86 hardware, the moment that the lightning hits the Frankenstein monster, the bootloader is responsible for breathing that spark of life into your hardware. After that, comes the loading of the Linux kernel, and after that, all the things that activate the device’s particulars, and I/O for network communication and the like.

Now because generic embedded systems like the SheevaPlug are designed to be turned into factory-prepared turnkey systems for other things (like the Pogoplug), they’re not designed to be particularly easy to use as general servers, which puts us plug computer users on the bleeding edge. Things aren’t all that stable yet, and there’s a fairly high chance you’re going to screw something up. So, it is necessary to know the process of re-installing or “flashing” a new bootloader into the solid-state internal hard drive, or NAND. At the time I am writing this, the newest Marvell version of U-Boot for the SheevaPlug is 3.4.27 and can be found at SheevaPlug U-Boot Upgrade page—probably the most authoritative guy writing on the subject these days, Martin Michlmayr. Read the comments below for more detailed instructions.

The next thing you need to know is that there are 3 ways of getting things onto the device: the network port, the SD card port, or USB. Of course the enormous temptation is to use the USB port with a thumb-drive, but the big thing to know here is that not all thumb-drives are made equal. In fact, I had to go through 5 until I found a good one. It’s an older 512MB one given out at a trade-show, which are of course hard to come by these days. I’m not sure if it’s how old the drive is or how small it is that makes it work, but the trail of periods that are the user feedback for success when flashing a new bootloader just zip by with this thumb-drive, and they get stuck and time-out with every other drive I’ve tried. Martin suggests using the network port, specifically having a TFTP server set up. And in the end this may be the easiest and most reliable method, and as I do more and more with embedded systems, I will be sure to set up a TFTP server.

Okay, so basically just like Martin says, you download the latest compiled U-Boot for SheevaPlug, rename it uboot.bin, put it on the smallest, oldest USB thumb-drive you have, put it into the USB port of the SheevaPlug, connect over serial, and type off a few commands. Be sure to type version before and after to be sure that it took. For me right now, the line indicating that I did it correctly is:

U-Boot 1.1.4 (Dec 23 2009 – 13:32:43) Marvell version: 3.4.27

I’ve literally spent days trying to unbrick SheevaPlugs, Googling and combing over the results for the magic instructions, trying to avoid buying things and setting up new computers just to have the right operating system for running external tools. Theoretically, all you should need is any external system that can write to a FAT32 formatted USB stick, and can run serial terminal software like PuTTY. But the “official” SheevaPlug 1.0 installer page only tells you how to copy the correct files to the USB and either running a .exe or a .php file from a Windows or Linux host, respectively. That seems pretty friggin ridiculous to me, and I’m putting dissecting the runme.php on my to-do list, so I can do the process manually in the future.

But right now, because unbricking these things is such a compelling priority, I’m going to go with the graphical user interface that’s becoming popular these days for embedded systems in general to save you all this typing. It’s called ESIA at sourceforge.net, or Embedded System Easy Installer. http://sourceforge.net/projects/esia/ The thing to be sure of here (with the SheevaPlug) is that you’ve already updated the U-Boot bootloader, and I would suggest doing it manually (not through ESIA) by way of testing the reliability of your USB drive. If all goes well, you should see the line above, or else you will get an error about being stuck at 8% Starting on-board installer (turns out you’ll get it anyway, but no matter). After 3 days of struggling with these things, this ESIA thing was about the fortieth thing I tried, and being stuck at 8% with only vague answers at the plugcomputer.org forums is what got me to take a step back and systematically build it up, evaluating every weak link in the chain right down to the quality of the USB drives.

Okay, so you absolutely need a solid, tested, proven USB drive on the SheevaPlug. You can confirm this with a successful bootloader upgrade, per these instructions which was supposed to take care of having the latest bootloader to fix the problem being stuck in ESIA at 8%, but it didn’t. However, the install still succeeds. So, if you get suck at 8%, don’t despair!

[Update: refer to the comment below for a solution to this 8% problem]

Next, be sure to get the Linux distro you want. It seems that the trend is towards Debian Squeeze, even though the SheevaPlug ships with Ubuntu. But the instructions for the official installer rely on running an .exe that always fails, or a .php that always fails. And until I dissect the php to trigger these commands over serial, ESIA appears to be the best bet. And I’m totally cool with going with Debian over Ubuntu, in the spirit of staying closest to the basis for all other distributions. Chances are much higher that support for things hits Debian before Ubuntu, since Ubuntu is based on Debian.

So download and unarchive Debian Squeeze from sourceforge.net which is the file Debian_Squeeze_usb_app.tar.bz2 Copy Devbian directory onto your reliable USB drive. Keeping the Deiban_Squeeze directory is important for ESIA to detect is as an “Application”. Download the ESIA installer file setupESIA-2.0.5.exe from sourceforge.net. Connect your SheevaPlug to your PC and confirm you have a serial connection using PuTTY or such. Quit out of PuTTY so that you’re not locking ESIA out from serial port access, and run ESIA. If you forgot to quit out of PuTTY, no big deal. Just quit, and tell ESIA to rescan. You should be able to click on the MAC number that it shows, and confirm that even ESIA knows your U-Boot version 3.4.27.

If so, pop in your prepared USB stick containing the Debian files. Hit Rescan.

And now, go ahead and tell it to install onto Nand. Whatever it’s doing here is the ESIA alternative to running the runme.exe or runme.php from the official installer. It’s surely just triggering off a series of bootloader commands, and learning how to do this manually will eliminate the need for any special tools other than a serial terminal.

If it goes correctly, it will barely take an instant…

Ugh! Still stuck at 8%. But the threat at http://plugcomputer.org/plugforum/index.php?topic=1400.90 says that only U-Boot Marvell version 3.4.16 is known to get 8% in the ESIA requestor, but if you just let it sit for like 5 minutes, you can quit out of ESIA and go back into PuTTY, connect, and hit Enter on your keyboard… and voila! There you have it, the unbricked SheevaPlug.

nosoup4u

Enhanced by Zemanta
VN:F [1.9.17_1161]
Rating: 7.0/10 (2 votes cast)
Unbrick SheevaPlug, 7.0 out of 10 based on 2 ratings

Related posts:

  1. Getting SheevaPlug Onto The Network But is deboostrap there? Oops, no. Okay, then we have to expand our plans. I didn’t want to touch the default...
  2. Connecting to SheevaPlug Over Serial With PuTTY Okay, let’s log into this thing. We can either connect through a network connection, assuming you have a DHCP server on...
  3. Unboxing SheevaPlug (video) Well, here were are getting past the virtual part of our Linux indoctrination, and into hardware. And some kooky little hardware...
  • Martin

    Nice guide!

    I recently struggled with unbricking my Sheevaplug which I bought used. I managed to get it done, even though I am not quite sure how I did it :-)

    I will bookmark your guide for later use.

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • http://dammuozz.selfip.com dammuozz

    when you say:

    The thing to be sure of here (with the SheevaPlug) is that you’ve already updated the U-Boot bootloader, and I would suggest doing it manually (not through ESIA)

    what do you mean?? I’ve got a sheevabrick with no u-boot workin and need to get it back to life…

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • admin

    Okay, so how in the heck do you know you have a non-flaky USB drive? How can you test it when you basically have no OS?

    You can try to update your bootloader. This involves getting a files and typing in a few commands (or using ESIA) to write that file into the internal memory of the SheevaPlug.

    Specifically, you download this one recommended by Martin Michlmayr and rename it uboot.bin and put it on the USB flash drive (all from your PC or Mac).

    Then, you plug it into your SheevaPlug, do the reboot with a serial terminal window open to interrupt reboot, and then type this (line by line) after the Marvell>> prompt:

    usb start
    fatload usb 0:1 0×0800000 uboot.bin
    nand erase 0×0 0xa0000
    nand write 0×0800000 0×0 0xa0000

    After the write command, you will see a bunch of progress indicator dots go by and then a message about writing successfully.

    If you have a bad USB flash drive, it will never finish, or time out with an error message. Sometimes you see “T’s” instead of periods, which is also bad.

    If this process succeeds, then you just successfully re-flashed your Das U-Boot bootloader AND proved that you have a good USB flash drive to work with–the necessary first step to unbricking!

    VN:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • odoll

    Mike,

    saw you post.
    However what’s a bit misleading in your article here: IMHO the U-Boot 3.4.27 version you mention here is not an “official” Marvel version, but just based on it and patched by pingtoo?

    IMHO the U-Boot reveals it’s true identity only if you enter

    Marvell>> version

    at the U-Boot prompt CLI.

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • admin

    Hi odoll,

    Yes, that’s completely fair feedback. However, I have diverged from the official Marvell version the moment I went away from their official installer, right down to choosing Debian Squeeze over Ubuntu. It was frustration with the official stuff that led me down this route. I even petitioned the keepers of the 1.0 installer in the forum on the original announcement thread to update it as a superior alternative to what I’m recommending here.

    …however… in the desperation to unbrick the SheevaPlug, I went about looking at the credentials of the people I’m taking advice from, and there’s this pretty highly credentialed guy–quite humbling actually–named Martin Michlmayr who’s giving out the link to that pingtoo uboot binary. I trust him. It worked.

    VN:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • Henny

    Hi

    I also had the 8% problem and waited a bit….
    And indeed when i connect with the serial connection i get a login prompt…
    The nosoup4you does not work ………..

    HennyZ

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • Olab

    Hi,

    I have encountered a good deal of problems unbricking a sheevaplug (actually U-boot was still ok), in particular, the same problem with USB sticks, of which I have flavours ranging from 128MB to 4GB. Only one of them looked fine but I had random CRC errors at boot.
    Eventually, I managed to reflash everything from a SD card with runme.php after having edited several files including rcS, inside initrd. Pretty interesting and time consuming !
    I ‘ve written an account (sort of) about it but it’s a bit too lengthy to publish here unless the admin is willing to devote one page to it. Just let me know. ;)

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • Shaar-Lun

    Thank you very much.

    Thanks to you I have unbrick easily my SheevaPlug

    Greetings.

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • http://dammuozz.selfip.com dammuozz

    Is there any way to reinstall u-boot, maybe using the JTAG port, if the U-Boot on the sheeva is not working?? Basically when I reboot I have nothing at all on the serial connection, and so no “Marvell>>” prompt.

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • Graviton

    I have same issue, Sheeva bricked after trying to update U-boot, cannot get Marvell prompt.
    __________________
    usb start
    fatload usb 0:1 0×0800000 uboot.bin
    nand erase 0×0 0xa0000
    nand write 0×0800000 0×0 0xa0000
    __________________

    This was what caused my Sheeva to brick …

    ESIA says “Device Information not available, please turn device off and on again” …

    Already opened a thread on plugcommunity but no answer, looking for a “hold hands” kind of explanation how to reinstall U-boot when no serial connection is available …

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • http://colundrum.free.fr Florent

    I have same issue, Sheeva bricked after trying to update U-boot, cannot get Marvell prompt.

    How can we flash uboot from ssh (ubuntu) ?

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • mike

    I am having the same issue. Can not connect via serial and the ESIA says the device is not available.

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • Ding Dong

    Fantastic guide – thought I had lost my sheeva forever! thanks again

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • http://blog.rafaeltorrales.info Rafael Torrales

    I just want to say: you save my sheeva, what a great post!!!!, you create easy step so looks like an easy task.

    thank u.

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • George Fendler

    I have tried several things to try to get my sheevabrick to come back to life.
    The last thing I tried looked like it was going to work. All the steps I followed behaved as expected except when I reset it at the end, I don’t even have a serial connection.
    There is no Marvel prompt. Not even an error message.
    The only difference between the device when it is unplugged and when it is plugged in is the LEDs light up. The ethernet port flickers with traffic on my LAN and the blue and yellow LEDs light up shortly after the unit is powered up.
    Should I call this a failed experiment?

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • Fleachy

    Hello Mike!

    Thanks for this excellent post. It definitely helped me a lot to understand how this tinny little plug works.

    In order to give something back, here’s how I solved the 8% stuck problem:

    Download the last kernel from http://sheeva.with-linux.com/sheeva/
    Today, July 5th it’s:
    http://sheeva.with-linux.com/sheeva/2.6.39/2.6.39.2/sheeva-2.6.39.2-uImage

    You can now change your ESIA installation file and/or your Pendrive USB files or as I did, both! If you are paranoid, first backup this file.

    ESIA default installation directory:
    Windows: C:Program FilesESIA
    Linux: /usr/share/esia/

    So, rename the downloaded file to ‘uImage’ and copy it to the correct directory.
    If you want to update it on the USB Pendrive, rename it to ‘instImg’ and copy it to /.

    Start ESIA again, and voilà!

    I will also like to mention that when copying a new rootfs to the plug you can tick the ‘backup’ checkbox, because it works just fine!

    I will keep on reading your posts!

    Cheers!

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • admin

    nosoup4u (sorry, just noticed this)

    VN:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • admin

    I supposed there are various degrees of bricking. I get the feeling that some are unrecoverable.

    Also, be sure to understand that there is a trick to connecting via serial with PuTTY that I document here.

    VN:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • admin

    Thanks, Fleachy! I put an update in the article to read this comment.

    VN:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • James

    This page is frustrating as hell.

    If you get a Marvell>> prompt, your Plug is NOT bricked. Please stop calling it bricked when it is still functional and responding to commands.

    There are no ‘degrees’ to bricking. Brick = Can’t do anything at all.

    Consequentially, it was this page and the exact directions that I followed here… when trying to update the uBoot on my SheevaPlug that CAUSED the bricking. No prompt, no change in LED lights beyond a single green when powered on, nothing on serial… Completely dead.

    Thanks!

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • admin

    James,

    You’re the first negative feedback I received. Are you sure you used the correct uboot.bin file? If you got that wrong, that would be bad.

    Regarding your definition of bricked as completely binary, I disagree. To most users, screwing up the Linux installation is bricked. It’s what they Google on. So there most certainly are degrees of bricked, and it’s only your level of expertise that differentiates one from the other. If you screwed up your uboot.bin bootloader file, you can certainly install a new one… it’s just harder. But if your hardware’s not fried from a short circuit or something, then yours isn’t bricked in your sense either.

    Maybe post your problem in the U-Boot stuff forum at PlugComputer. http://www.plugcomputer.org/plugforum/index.php?board=4.0

    Good luck.

    VN:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)
  • http://mikelev.in/ Mike Levin

    I just switched to the Disqus comment system, and am doing a test-post on my most most commented-on polst to test it.

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)

Previous post:

Next post: