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.