sheevaplug 作業メモ

sheevaplugをあまりいじってなかったのでいじることにする。
いまいちよくわからんのだが、うまいこと起動しなくなってしまったので、いろいろやりなおすことにする。

母艦はfedora12

とりあえずsheevaplugと母艦をUSBでつないで、
# screen /dev/ttyUSB1 115200
そのあとでsheevaplugのリセットスイッチをツマヨウジか何かでおす。

さて、うまいこと起動しない。

起動時にチェックが入って、badblockがたくさんあるよと起こられる。
DDR2 data bus test PASSED

DDR2 address bus test PASSED

DDR2 device test PASSED

Device: 0, Size: 512 MB, Page Size: 2 KB, Block Size: 128 KB
NAND detection test PASSED

Bad Block: 00320000
Bad Block: 00340000
Bad Block: 00360000
Bad Block: 00380000
Bad Block: 003a0000
Bad Block: 003c0000
Bad Block: 003e0000
Bad Block: 00400000
Bad Block: 00420000
Bad Block: 00440000
Bad Block: 0dbc0000
Bad Block: 17ba0000
NAND bad-block detection test PASSED

Speed: 100 Mbps, Duplex: Full, Link: up
GbE link detect test PASSED

RTC test PASSED


fedora12でのtftpサーバの起動は
# yum install tftp-server
# /sbin/chkconfig –level345 xinetd on /sbin/chkconfig –level345 tftp on

nfsサーバも用意しないとダメ。
# yum install nfs-utils
# /etc/init.d/nfs restart

fedoraのソフトウェアファイアウォールでnfsとtftpdを有効にしておく
↑これを忘れて時間がかかった、、、

とりあえずは
http://mizupc8.bio.mie-u.ac.jp/pukiwiki/index.php?SheevaPlug%2FU-Boot
に従ってubootの更新。

やれやれうまくきそうだ。

plugforumの掲示板におちていたuboot3.4.27(pacthed)をひろってきて入れる。

http://lglinux.blogspot.com/2009/09/recovering-bad-sheevaplug-kernel-flash.html
にしたがってkernel2.6.32を起動させようとするが

Looking up port of RPC 100003/2 on 192.168.0.2
eth0: link up, 100 Mb/s, full duplex, flow control disabled
rpcbind: server 192.168.0.2 not responding, timed out
Root-NFS: Unable to get nfsd port number from server, using default
Looking up port of RPC 100005/1 on 192.168.0.2
rpcbind: server 192.168.0.2 not responding, timed out
Root-NFS: Unable to get mountd port number from server, using default
Root-NFS: Server returned error -5 while mounting /tftpboot/rootfs
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device “nfs” or unknown-block(2,0)
Please append a correct “root=” boot option; here are the available partitions:
1f00 1024 mtdblock0 (driver?)
1f01 4096 mtdblock1 (driver?)
1f02 519168 mtdblock2 (driver?)
Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[<c0032d04>] (unwind_backtrace+0x0/0xe0) from [<c0044304>] (panic+0x54/0x12c)
[<c0044304>] (panic+0x54/0x12c) from [<c0008f10>] (mount_block_root+0x1d4/0x214)
[<c0008f10>] (mount_block_root+0x1d4/0x214) from [<c00091b8>] (prepare_namespace+0x16c/0x1c4)
[<c00091b8>] (prepare_namespace+0x16c/0x1c4) from [<c0008764>] (kernel_init+0xe0/0x114)
[<c0008764>] (kernel_init+0xe0/0x114) from [<c002e444>] (kernel_thread_exit+0x0/0x8)

こんなことを吐いて落ちる。母艦側の設定かなぁ。

母艦のファイアウォール無効化したらちょっと進んだ。ってか、何番ポート使ってるんだろう。後でググろう。(fedoraのfirewall設定のguiのやつで、適用押してなくていろいろなやんだのはナイショ)

で、なんとかsheevaplugでlinuxが立ち上がったようだ。やれやれ。
次なにするんだっけ??

pdfの説明書のSheevaPlug -Writing Jaunty Filesystem on the NAND flash
に従って先に進む

-sh-3.2# bash
bash-3.2# find . -name flash_eraseall
./usr/sbin/flash_eraseall
bash-3.2# find . -name nandwrite
./usr/sbin/nandwrite
bash-3.2# cat /proc/mtd
dev: size erasesize name
mtd0: 00100000 00020000 “u-boot”
mtd1: 00400000 00020000 “uImage”
mtd2: 1fb00000 00020000 “root”
bash-3.2# flash_eraseall /dev/mtd1
Erasing 128 Kibyte @ 200000 — 50 % complete.
Skipping bad block at 0x00220000

Skipping bad block at 0x00240000

Skipping bad block at 0x00260000

Skipping bad block at 0x00280000

Skipping bad block at 0x002a0000

Skipping bad block at 0x002c0000

Skipping bad block at 0x002e0000

Skipping bad block at 0x00300000

Skipping bad block at 0x00320000

Skipping bad block at 0x00340000
Erasing 128 Kibyte @ 3e0000 — 96 % complete.
bash-3.2# flash_eraseall -j /dev/mtd2
Erasing 128 Kibyte @ d6a0000 — 42 % complete. Cleanmarker written at d6a0000.
Skipping bad block at 0x0d6c0000
Erasing 128 Kibyte @ 17680000 — 73 % complete. Cleanmarker written at 17680000.
Skipping bad block at 0x176a0000
Erasing 128 Kibyte @ 1fae0000 — 99 % complete. Cleanmarker written at 1f
bash-3.2# nandwrite -p /dev/mtd1 uImage
open input file: No such file or directory

あれ?説明が間違っているっぽい。
母艦で
# cp /tftpboot/uImage /path/to/rootfs/folder/.

bash-3.2# nandwrite -p /dev/mtd1 sheeva-2.6.32-uImage
Writing data to block 0
Writing data to block 20000
Writing data to block 40000
Writing data to block 60000
Writing data to block 80000
Writing data to block a0000
Writing data to block c0000
Writing data to block e0000
Writing data to block 100000
Writing data to block 120000
Writing data to block 140000
Writing data to block 160000
Writing data to block 180000
Writing data to block 1a0000
Writing data to block 1c0000
Writing data to block 1e0000
Writing data to block 200000
Writing data to block 220000
Bad block at 220000, 1 block(s) from 220000 will be skipped
Writing data to block 240000
Bad block at 240000, 1 block(s) from 240000 will be skipped
Writing data to block 260000
Bad block at 260000, 1 block(s) from 260000 will be skipped
Writing data to block 280000
Bad block at 280000, 1 block(s) from 280000 will be skipped
Writing data to block 2a0000
Bad block at 2a0000, 1 block(s) from 2a0000 will be skipped
Writing data to block 2c0000
Bad block at 2c0000, 1 block(s) from 2c0000 will be skipped
Writing data to block 2e0000
Bad block at 2e0000, 1 block(s) from 2e0000 will be skipped
Writing data to block 300000
Bad block at 300000, 1 block(s) from 300000 will be skipped
Writing data to block 320000
Bad block at 320000, 1 block(s) from 320000 will be skipped
Writing data to block 340000
Bad block at 340000, 1 block(s) from 340000 will be skipped
Writing data to block 360000
Writing data to block 380000
Writing data to block 3a0000
Writing data to block 3c0000
Writing data to block 3e0000
bash-3.2# nandwrite -p /dev/mtd2 generic.jffs2
Writing data to block 0
Writing data to block 20000
Writing data to block 40000
Writing data to block 60000

Writing data to block 7f40000
Writing data to block 7f60000
Writing data to block 7f80000
Writing data to block 7fa0000
Writing data to block 7fc0000
Writing data to block 7fe0000
Writing data to block 8000000
bash-3.2# mount -t jffs2 /dev/mtdblock2 /mnt
CLEANMARKER node found at 0x00000000 has totlen 0xc != normal 0x0
CLEANMARKER node found at 0x00020000 has totlen 0xc != normal 0x0
CLEANMARKER node found at 0x00040000 has totlen 0xc != normal 0x0
CLEANMARKER node found at 0x00060000 has totlen 0xc != normal 0x0
CLEANMARKER node found at 0x00080000 has totlen 0xc != normal 0x0
CLEANMARKER node found at 0x000a0000 has totlen 0xc != normal 0x0
CLEANMARKER node found at 0x000c0000 has totlen 0xc != normal 0x0
CLEANMARKER node found at 0x000e0000 has totlen 0xc != normal 0x0

で、おわってからreboot
ubootの設定を書き換える。
ちなみに書き換え前後の設定は次の記事。


openocdがうごかない?
firewallとは関係ないところでネットワーク関連のえらー?
libftdi、openocdをmakeしてもだめだった。libusbはエラーでmakeできず。
yumでいれたやつもだめ。なぜだ??

結局firewallは、rpcbindの111番と、
# rpcinfo -p
でmountdになってるポートを開放すればOKだった。

コメントを残す