• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1] 2
Author Topic: Sheevaplug installer - alpha-5 release - Testers needed  (Read 7903 times)
Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« on: May 21, 2009, 07:23:58 AM »

All,

We have developed a new installer to the plug. The version now is alpha-5.
The installer now automatically installs uboot, kernel, modules, configures uboot env variables and install ubuntu 9.04.

Please refer to the wiki page about it -

http://www.plugcomputer.org/plugwiki/index.php/SheevaPlug_Installer

Also please provide feedbacks on the missing features, what needs to be enhanced etc...

Regards,
Rabeeh
« Last Edit: May 21, 2009, 08:03:11 AM by Rabeeh Khoury » Logged

David Avital
Administrator
Newbie
*****

Karma: 5
Posts: 19


View Profile
« Reply #1 on: May 21, 2009, 07:27:00 AM »

Awesome!

Thanks
Logged

peterpan
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #2 on: May 22, 2009, 11:34:52 AM »

Hi, here are my first-time experiences with the installer:

I formattet a USB-Stick and copied the files from the installer directory.
Connected the Terminal-Cable and USB-Stick and turned on the Plug.
I started "sudo ./runme.sh" and everything went fine.
After opening the console as advised, there was lots of stuff going on including erasing and writing until it ended with:

Code:
...
Writing data at 0x4f5800 --  99% complete.
Writing data at 0x4ff800 -- 100% complete.
 4194304 bytes written: OK
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
## Booting image at 00200000 ...
Bad Magic Number
Marvell>>

What can I do to boot the new system?
I have attached my current environment, but let me know if you need more info.
Thanks,
Peter

Code:
baudrate=115200
loads_echo=0
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethact=egiga0
bootargs_root=ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs
mtdpartitions=mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)
ethaddr=00:62:81:a0:00:00
real_bootcmd=setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root); nand read.e 0x00200000 0x00100000 0x003ff000; bootm 0x00200000
bootargs_console=console=ttyS0,115200
recover1=setenv mainlineLinux yes; setenv arcNumber 2097; setenv bootcmd run recover2; saveenv; reset
recover2=run recover3; setenv bootcmd $(real_bootcmd); saveenv; setenv bootargs $(bootargs_console) $(mtdpartitions); bootm 0x00200000 0x01100000
recover3=run recover4; nand erase clean 0x00100000 0x00400000; nand write.e 0x00200000 0x00100000 0x00400000
recover4=usb start; fatload usb 0 0x00200000 uImage; fatload usb 0 0x01100000 initrd
arcNumber=2097
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=yes
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
bootcmd=setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root); nand read.e 0x00200000 0x00100000 0x003ff000; bootm 0x00200000
bootargs=console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)
Logged

peterpan
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #3 on: May 22, 2009, 12:11:30 PM »

While looking around, it seemed to me, that usb does not work at all:

Code:
Marvell>> usb start

(Re)start USB...
USB:   scanning bus for devices... 1 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
Marvell>> fatload usb 0 0x00200000 uImage

** Can't read from device 0 **

** Unable to use usb 0:1 for fatload **
Logged

peterpan
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #4 on: May 22, 2009, 03:08:15 PM »

ok, it seems that uboot on my plug will only talk to my usb-stick if i put a powered usb hub inbetween and plug it all in before booting.
Now I see that installation copies and flashes the files, but now there is another error:

Code:
ubiformat: formatting eraseblock 4054 -- 99 % complete 
ubiformat: formatting eraseblock 4055 -- 100 % complete 
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "rootfs"
UBI: MTD device size:            507 MiB
UBI: number of good PEBs:        4040
UBI: number of bad PEBs:         16
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             3996
UBI: total number of reserved PEBs: 44
UBI: number of PEBs reserved for bad PEB handling: 40
UBI: max/mean erase counter: 4/1
UBI: background thread "ubi_bgt0d" started, PID 556
UBI device number 0, total 4040 LEBs (521256960 bytes, 497.1 MiB), available 3996 LEBs (515579904 bytes, 491.7 MiB), LEB size 129024 bytes (126.0 KiB)
Set volume size to 515579904
Volume ID 0, size 3996 LEBs (515579904 bytes, 491.7 MiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "rootfs", alignment 1
**** Mounting root filesystems
mount: mounting /dev/sda1 on /mnt1 failed: Device or resource busy
UBIFS: default file-system created
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   513644544 bytes (501606 KiB, 489 MiB, 3981 LEBs)
UBIFS: journal size:       25675776 bytes (25074 KiB, 24 MiB, 199 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: lzo
UBIFS: reserved for root:  4952683 bytes (4836 KiB)
****** ERROR - no rootfs.tar.gz file found on USB stick
UBIFS: un-mount UBI device 0, volume 0

The system is going down NOW!

[.....]

usb 1-1: new high speed USB device using orion-ehci and address 2
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
[<c00309c0>] (unwind_backtrace+0x0/0xe0) from [<c003db20>] (panic+0x50/0x120)
[<c003db20>] (panic+0x50/0x120) from [<c002b53c>] (init_post+0xd4/0xfc)
[<c002b53c>] (init_post+0xd4/0xfc) from [<c0008738>] (kernel_init+0xc4/0xec)
[<c0008738>] (kernel_init+0xc4/0xec) from [<c0040b18>] (do_exit+0x0/0x6ac)



I attached the complete log of this command line
( sudo ./runme.sh ; cu --nostop -s 115200 --line /dev/ttyUSB1 ) 2>&1 | tee install.log

* install.log (468.7 KB - downloaded 262 times.)
Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #5 on: May 23, 2009, 05:27:44 AM »

Seems the problem is either in -

Code:
mount: mounting /dev/sda1 on /mnt1 failed: Device or resource busy

or

Code:
****** ERROR - no rootfs.tar.gz file found on USB stick

The first one seems to be ok since there is no /dev/sda1, but only /dev/sda (no partitions on the USB stick).

The second error seems to be causing the issue - this means that you didn't copy the rootfs.tar.gz file that is in the 'installer' directory to the root directory of the USB stick.
You only need to copy the tarball itself, don't extract it.

The rootfs.tar.gz is the actual Ubuntu 9.04 tarball; without it there wouldn't be any rootfs on the ubifs volume.

Thanks,
Rabeeh
Logged

mossroy
Newbie
*

Karma: 0
Posts: 30


View Profile
« Reply #6 on: May 23, 2009, 10:49:03 AM »

Hi,

first of all, I think this is a great idea to make an installer.

Anyway, I didn't manage to make it work on my computer & sheevaplug.
Maybe I did something wrong.

My computer is running Ubuntu 9.04 desktop (x86).
I followed the README.txt in the tar.gz : formatted an USB stick, and put the files in it.
I plugged the mini-USB to the computer, and connected via Putty on /dev/ttyUSB1
Then I ran runme.sh on the computer :

Code:
sudo ./runme.sh
 **** Preparing environment variables file ...
 **** Burning uboot and environment variables ... This will take few minutes ...
Open On-Chip Debugger 0.2.0-in-development (2009-05-17-10:32) svn:1800M


BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS


$URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $
2000 kHz
dcc downloads are enabled
Error: JTAG communication failure, check connection, JTAG interface, target power etc.
Error: trying to validate configured JTAG chain anyway...
Error: Could not validate JTAG scan chain, IR mismatch, scan returned 0x3F. tap=feroceon.cpu pos=0 expected 0x1 got 3
Warn : Could not validate JTAG chain, continuing anyway...
Warn : value captured during scan didn't pass the requested check:
Warn : captured: 0x0F check_value: 0x01 check_mask: 0x0F
Warn : no telnet port specified, using default port 4444
Warn : no gdb port specified, using default port 3333
Warn : no tcl port specified, using default port 6666
Error: Target not examined yet
Runtime error, file "../scripts-linux/openocd/config/board/sheevaplug.cfg", line 21:
   
 **** openocd FAILED
 **** Is the mini USB cable connected?
 **** Try powering down, then replugging the Sheevaplug

The sheevaplug reboots at this moment, but nothing has been flashed.

The README explains that we should in this case disconnect/reconnect the sheevaplug, or even unplug/plug back it.
I did it several times, and even restarted the computer : the same error happens.

It seems that line 20 of sheevaplug.cfg is executed (which restarts the sheevaplug), but line 21 fails ("halt 0")

I tried with or without putty connected, with or without an OS launched on the sheevaplug : always the same error.

Any ideas?
Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #7 on: May 23, 2009, 03:41:48 PM »

Looks like the connection to the processor JTAG interface didn't happen.

I would expect the following on the log -
Code:
dcc downloads are enabled
Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (Manufacturer: 0x1e9, Part: 0x0a02, Version: 0x2)
Info : JTAG Tap/device matched

Instead of -

Code:
dcc downloads are enabled
Error: JTAG communication failure, check connection, JTAG interface, target power etc.
Error: trying to validate configured JTAG chain anyway...
Error: Could not validate JTAG scan chain, IR mismatch, scan returned 0x3F. tap=feroceon.cpu pos=0 expected 0x1 got 3


The only thing I can think of is that you haven't properly detected the FTDI chip serial port using -

modprobe ftdi_sio vendor=0x9e88 product=0x9e8f

But on the other hand if you haven't done the proper 'modprobe' then you would never get /dev/ttyUSB0 and /dev/ttyUSB1 first place.

I tried the process on Ubuntu 8.10 - do you have that installed by a chance? Or you have other distro installer?
The only difference would be the FTDI kernel driver, since all the other bits of libftdi and friends are statically compiled part of openocd binary.

One other thing, might it be that you have other usb to serial cables in the system? (Besides the mini USB cable that goes to the plug)?
The reason i'm asking is that there is a possibility that you have if you have that then openocd is trying to communicate with the wrong FTDI chip.

Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #8 on: May 23, 2009, 03:45:27 PM »

One other thought - can you please locate the 2000khz in the sheevaplug.cfg file and try lowering that?

This is the bandwidth that mandates the communication speed between the FTDI chip and the processor. Maybe 1000KHz or even lower solve the issue.

You can confirm the new frequency while looking in the log. For example in your log file -

Code:
2000 kHz
dcc downloads are enabled
Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #9 on: May 24, 2009, 02:46:14 AM »

mossroy -

I just got an update from the openocd developer about an issue he found. Please try the following

Edit the file -./scripts-linux/openocd/config/board/sheevaplug.cfg
and add -
Code:
feroceon.cpu arp_examine
So the code will look like -

Code:
        jtag_reset 0 1
        feroceon.cpu arp_examine
        halt 0
        jtag_reset 0 0
        wait_halt


BTW - The patch for openocd was submitted upstream and reflected in revision 1905 -
Code:
diff --git a/src/target/board/sheevaplug.cfg b/src/target/board/sheevaplug.cfg
index 276d6f2..d1a0cce 100644
--- a/src/target/board/sheevaplug.cfg
+++ b/src/target/board/sheevaplug.cfg
@@ -17,7 +17,13 @@ proc sheevaplug_init { } {

        # We need to assert DBGRQ while holding nSRST down.
        # However DBGACK will be set only when nSRST is released.
+       # Furthermore, the JTAG interface doesn't respond at all when
+       # the CPU is in the WFI (wait for interrupts) state, so it is
+       # possible that initial tap examination failed.  So let's
+       # re-examine the target again here when nSRST is asserted which
+       # should then succeed.
        jtag_reset 0 1
+       feroceon.cpu arp_examine
        halt 0
        jtag_reset 0 0
        wait_halt

Please update us on success / failure.

Thanks,
Rabeeh

Logged

mossroy
Newbie
*

Karma: 0
Posts: 30


View Profile
« Reply #10 on: May 24, 2009, 02:51:05 AM »

Thanks a lot for your answers.

Changing the frequency was the right thing to do : it worked with 500kHz (but it didn't work with 1000kHz). Maybe it's worth changing this for next version.
See the log below : there seems to be some warnings anyway

Code:
sudo ./runme.sh  **** Preparing environment variables file ...
 **** Burning uboot and environment variables ... This will take few minutes ...
Open On-Chip Debugger 0.2.0-in-development (2009-05-17-10:32) svn:1800M


BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS


$URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $
500 kHz
dcc downloads are enabled
Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (Manufacturer: 0x1e9, Part: 0x0a02, Version: 0x2)
Info : JTAG Tap/device matched
Error: unknown EmbeddedICE version (comms ctrl: 0x00000018)
Warn : no telnet port specified, using default port 4444
Warn : no gdb port specified, using default port 3333
Warn : no tcl port specified, using default port 6666
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x000000d3 pc: 0xffff0000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
0 0 1 0: 00052078
NAND flash device 'NAND 512MiB 3,3V 8-bit' found
successfully erased blocks 5 to 6 on NAND flash device 'NAND 512MiB 3,3V 8-bit'
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1241). Workaround: increase "set remotetimeout" in GDB
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1020). Workaround: increase "set remotetimeout" in GDB
wrote file uboot-env.bin to NAND flash 0 up to offset 0x000c0000 in 52.464920s
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x000000d3 pc: 0xffff0000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
0 0 1 0: 00052078
NAND flash device 'NAND 512MiB 3,3V 8-bit' found
successfully erased blocks 0 to 4 on NAND flash device 'NAND 512MiB 3,3V 8-bit'
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1024). Workaround: increase "set remotetimeout" in GDB
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1178). Workaround: increase "set remotetimeout" in GDB
wrote file uboot.bin to NAND flash 0 up to offset 0x00073000 in 188.052399s
 **** U-boot should be up and running now. Open your console ...


After that, the sheevaplug reboots, flashes, reboots... and it works.

First thing that surprises me : it seems that it boots much faster than before. Is this due to UBIFS?
The rootfs is also directly useable : no patch needed for apt or dns lookups, and only 3 update with apt-get upgrade.

I love this installer, because it really eases all the process of flashing, and modifying the uboot parameters. And you get a working and up-to-date OS, with an up-to-date kernel.
Thank you for the good job!
Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #11 on: May 24, 2009, 02:57:10 AM »

It definitely boots faster because of ubifs.
JFFS2 is an old rootfs that was built for few tens of MByte of storage; it doesn't scale good enough the hundreds of MByte and GByte storage because of all sort of technological limitations in the filesystem architecture.

Anyhow; I need last favor - can you please revert it back to 2000khz and try the latest patch i posted? (adding feroceon.cpu arp_examine)
I think that you hit some timing issue that the 500khz solves it, but the 'feroceon.cpu arp_examine' which adds additional delay might solve it too.

I'm glad you like the installer. Once it's stable enough I hope the community will take it as standard installer for the plug to switch between ubuntu, debian, gentoo, openwrt and all others.

Thanks,
Rabeeh

Logged

mossroy
Newbie
*

Karma: 0
Posts: 30


View Profile
« Reply #12 on: May 24, 2009, 08:25:30 AM »

OK I tried again with the "feroceon.cpu arp_examine" line, and with 2000kHz, as requested.
It works too, even if the same kind of warnings appear (see log below)

Code:
sudo ./runme.sh  **** Preparing environment variables file ...
 **** Burning uboot and environment variables ... This will take few minutes ...
Open On-Chip Debugger 0.2.0-in-development (2009-05-17-10:32) svn:1800M


BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS


$URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $
2000 kHz
dcc downloads are enabled
Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (Manufacturer: 0x1e9, Part: 0x0a02, Version: 0x2)
Info : JTAG Tap/device matched
Error: unknown EmbeddedICE version (comms ctrl: 0x00000018)
Warn : no telnet port specified, using default port 4444
Warn : no gdb port specified, using default port 3333
Warn : no tcl port specified, using default port 6666
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x000000d3 pc: 0xffff0000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
0 0 1 0: 00052078
NAND flash device 'NAND 512MiB 3,3V 8-bit' found
successfully erased blocks 5 to 6 on NAND flash device 'NAND 512MiB 3,3V 8-bit'
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1049). Workaround: increase "set remotetimeout" in GDB
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1110). Workaround: increase "set remotetimeout" in GDB
wrote file uboot-env.bin to NAND flash 0 up to offset 0x000c0000 in 32.932339s
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x000000d3 pc: 0xffff0000
MMU: disabled, D-Cache: disabled, I-Cache: disabled
0 0 1 0: 00052078
NAND flash device 'NAND 512MiB 3,3V 8-bit' found
successfully erased blocks 0 to 4 on NAND flash device 'NAND 512MiB 3,3V 8-bit'
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1002). Workaround: increase "set remotetimeout" in GDB
wrote file uboot.bin to NAND flash 0 up to offset 0x00073000 in 117.655731s
 **** U-boot should be up and running now. Open your console ...
Logged

peterpan
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #13 on: May 24, 2009, 08:41:49 AM »

It works!

I tried a different usb stick, that does work with uboot without putting a powered hub inbetween. And that worked.
The contents (the files from the installer directory) and partition type (W95 FAT32 LBA) are exactly the same. I don't really know what the difference is  Undecided. The alternative stick was 512mb while the former was 4gb, but this can't be it.

The first one seems to be ok since there is no /dev/sda1, but only /dev/sda (no partitions on the USB stick).

Are you sure that there are no partitions on the USB stick? I tried to make a USB stick without partition table, but uboot seems to need one.

While installing it now says:
mount: mounting /dev/sda on /mnt1 failed: Invalid argument
instead of:
mount: mounting /dev/sda1 on /mnt1 failed: Device or resource busy

Thanks for your help. If you are interested in more information regarding my sticks or if I can try something for you, let me know.
Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #14 on: May 24, 2009, 09:01:57 AM »

OK.
So, I found the bug in the initrd.

First - as you said uboot doesn't support an unpartitioned usb stick; so we need to solely use unpartitioned usb stick.
Second - there is a bug in the installer script in the initrd (/etc/init.d/rcS) where the script tries to mount /dev/sda1 to /mnt1 and then tried to mount /dev/sda to /mnt1.
The assumption was that ONLY one of those will success, but the reality was if you use USB stick that was formatted under Linux then /dev/sda1 will mount AND /dev/sda will mount (but won't have any files).
On the other hand a Windows formatted USB stick will mount /dev/sda1, but will never mount /dev/sda; which is the expected behaviour.

Anyhow, I fixed the script (attached initrd, please replace the one you are using), please try it with the non-working USB stick.

Once this is confirmed, I'll have alpha-6 ready.

Thanks,
Rabeeh

* initrd (1835.61 KB - downloaded 221 times.)
« Last Edit: May 24, 2009, 09:04:38 AM by Rabeeh Khoury » Logged

Pages: [1] 2
Print
Jump to: