Saturday, September 26, 2009

Recovering bad sheevaplug kernel flash

After having flashed a "bad" kernel onto the sheevaplug that doesn't boot anymore, not all is lost. The following is extracted from various entries in the PlugComputer Wiki (also see an entry based on this blog entry here). It assumes that the U-Boot boot loader is still working.

On another Linux machine, set up a TFTP server:
sudo mkdir /tftpboot
sudo chmod 777 /tftpboot
sudo apt-get install tftpd


Edit /etc/inetd.conf:
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot

Restart the TFTP server:
sudo /etc/init.d/openbsd-inetd restart

Put a "good" (i.e. usually older) kernel uImage file into /tftpboot. You can get such an image e.g. from here.

Connect to the sheevaplug using the serial console:
sudo modprobe ftdi_sio vendor=0x9e88 product=0x9e8f
screen /dev/ttyUSB1 115200

(Or use /dev/ttyUSB0, this depends.)

Reset the sheevaplug by pushing a needle or paper-clip into the small hole near the serial port connector. Stop the boot sequence by pressing a key.

Connect the sheevaplug to the ethernet network. Set own and the TFTP server IP address:
setenv ipaddr 192.168.1.77
setenv serverip 192.168.1.2


Load the kernel image:
tftpboot 0x2000000 sheeva-2.6.31-uImage

Set needed bootargs, e.g.
setenv arcNumber 2097
setenv mainlineLinux yes
setenv bootargs rootfstype=jffs2 console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=192.168.1.77:192.168.1.2:192.168.1.1:255.255.255.0:sheevaplug:eth0:none


Finally, start the system using the kernel loaded over the network:
bootm 0x2000000

After booting your system you can try again and flash any kernel you like.

6 comments:

Anonymous said...

After three days of trying and thinking I had wrecked my shiney new plug this guide was the one the worked for me.

Thank you SOO much!!!

Note I had to change the root=/dev/mtdblock2

other than that copy and paste

Thanks again!

leo said...

You're very welcome! Glad it helped somebody!

Anonymous said...

Thank you soooo much!!! :-)

Very good work. Short description but very helpful.

BTW: http://sheeva.with-linux.com/sheeva/ makes my life much easier!

leo said...

You're welcome!

The link you posted is indeed _the_ place for kernels. I can highly recommend those kernels from cbxbiker61 (also see the Kernel category in http://plugcomputer.org/plugforum/)

cyclop5 said...

this was the final piece I needed to solve the mess of a puzzle I had gotten myself into this week with my guruplug. Thanks a ton!

leo said...

cyclop5, you're welcome! Thanks for the feedback!