• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: alpha 6 insists on using tftp - Solved  (Read 3133 times)
erflol
Newbie
*

Karma: 0
Posts: 6


View Profile
« on: August 16, 2009, 08:06:48 PM »

Hello all,
I wanted to use a serial device (via usb to serial cable) with my sheevaplug, and in order to do so I have to upgrade to the newest kernel (2.6.30).
I set out to use the alpha6 installer. I can run the installer just fine, and it says "U-boot should be up and running now. Open your console..."

When I go to boot the device it completely ignores any USB drives I have connected to it (I've tried 4 different drives). It says:

Code:
TFTP from server 10.4.50.5; our IP address is 10.4.50.165
Filename 'uImage'.
Loading address 0x2000000
Loading: T T T T T T T T T T
retry count exceeed; starting again
## Booting image at 02000000 ...
Bad Magic Number
Unknown command '<NULL>' - try 'help'
Marvell>>

I know some users have had problems with USB devices not being recognized but unless I manually start the USB (usb start) it doesn't bother to recognize any drives.

I have tried the instructions at http://www.cyrius.com/debian/kirkwood/sheevaplug/unpack.html and can read the uImage and initrd however the sheevaplug simply restarts and attempts to tftp again when all is said and done.

Initially I had not made any changes to the alpha6 files, then after poking around I have made two changes. I changed the MAC address, and changed Orion_NAND to Orion_mtd

If anyone has any insight it would be greatly appreciated since currently my device is completely unusable

Cheers
eRflol
« Last Edit: August 18, 2009, 07:35:21 AM by erflol » Logged

rooster
Guest
« Reply #1 on: August 17, 2009, 04:57:13 AM »

do you have a spare USB Disk On Key? I would format it to FAT and try it out.
Be sure to use a DOK less than 2GB in size
Logged

erflol
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #2 on: August 17, 2009, 01:45:36 PM »

I have tried 3 usb keys, and an USB external hard drive. I have tried both Fat16 and Fat32 as well as ext2. None of them work, seemingly because it ignores the USB and goes straight to tftp.

Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #3 on: August 17, 2009, 02:32:13 PM »

Before trying alpha-6, plug your thumb drive into the USB port of your Plug.  (Plug it directly in; do not go through a USB hub.)  Then power-cycle the Plug and brak out into the Uboot "Marvell>>" prompt.  (BTW, your Uboot should indicate a May address, not March, right?)  Issue a "usb start" command, "usb info", and "usb tree", and tell us exactly what output they produce.

Were you *ever* able to recognize a USB device in the original OS that came with the Plug?

You/we need to understand what's going on with the USB subsystem before delving into the alpha-6 load.
Logged

erflol
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #4 on: August 17, 2009, 02:53:41 PM »

I have been plugging the drives directly into the device while I am doing this. I have had the drive for a few weeks and it has served as a file server until my desire to upgrade. I had two external hard drives, a thumb drive plugged into a hub and was able to read/write to them no problem.

Here's the rest of the info you're looking for:

When I boot this is what I receive (which shows yes, a may date, not a march date):
Code:
         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|
 ** MARVELL BOARD: SHEEVA PLUG LE

U-Boot 1.1.4 (May 13 2009 - 13:10:52) Marvell version: 3.4.16

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CF100

Soc: 88F6281 A0 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 256MB
DRAM CS[1] base 0x10000000   size 256MB
DRAM Total size 512MB  16bit width
Flash:  0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:512 MB
*** Warning - bad CRC or NAND, using default environment


CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0
Using egiga0 device
TFTP from server 10.4.50.5; our IP address is 10.4.50.165
Filename 'uImage'.
Load address: 0x2000000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
## Booting image at 02000000 ...
Bad Magic Number
Unknown command '<NULL>' - try 'help'
Marvell>>

As I mentioned in my first post, I can manually start the USB drives. I currently have a single USB key plugged into the device  (an 8 gig, but I tried with a 512mb and a 2 gig as well). usb start gives:
Code:
Marvell>> usb start
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found

usb info is as follows:
Code:
Marvell>> usb info
1: Hub,  USB Revision 2.0
 - Marvell EHCI
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Settings 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Mass Storage,  USB Revision 2.0
 - Kingston DataTraveler 2.0 5B870F000128
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x13fe  Product 0x1f00 Version 1.16
   Configuration: 1
   - Interfaces: 1 Bus Powered 200mA
     Interface: 0
     - Alternate Settings 0, Endpoints: 2
     - Class Mass Storage, Transp. SCSI, Bulk only
     - Endpoint 1 In Bulk MaxPacket 512
     - Endpoint 2 Out Bulk MaxPacket 512


Finally usb tree :
Code:
Marvell>> usb tree

Device Tree:
  1  Hub (480MBit/s, 0mA)
  |  Marvell EHCI
  |
  +-2  Mass Storage (480MBit/s, 200mA)
       Kingston DataTraveler 2.0 5B870F000128
     

As you can see everything is recognised no problem, it's just getting it to actually work, and not tftp that's the problem

Cheers
eRflol
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #5 on: August 17, 2009, 03:15:08 PM »

I'd be somewhat concerned about the
Code:
*** Warning - bad CRC or NAND, using default environment

Although I've never encountered it before, I think this is likely the root cause of your problems.
Logged

erflol
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #6 on: August 17, 2009, 04:34:12 PM »

Well if anyone can help solve that little issue fantastic, however I was still able to access my flash drive on the previous uboot, and can still access flash on this uboot as demonstrated.

perhaps it's a problem with running the runme.sh

Here is the output from my most recent runme.sh run:

Code:
sudo sh ./runme.sh
 **** Preparing environment variables file ...
./runme.sh: 12: Syntax error: Bad fd number
./runme.sh: 13: Syntax error: Bad fd number
 **** 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'
wrote file uboot-env.bin to NAND flash 0 up to offset 0x000a0000 in 0.000113s
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'
wrote file uboot.bin to NAND flash 0 up to offset 0x00073000 in 131.633026s
 **** U-boot should be up and running now. Open your console ...

And the resulting uboot:
Code:
         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|
 ** MARVELL BOARD: SHEEVA PLUG LE

U-Boot 1.1.4 (May 13 2009 - 13:10:52) Marvell version: 3.4.16

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CF100

Soc: 88F6281 A0 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 256MB
DRAM CS[1] base 0x10000000   size 256MB
DRAM Total size 512MB  16bit width
Flash:  0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:512 MB
*** Warning - bad CRC or NAND, using default environment


CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0
Using egiga0 device
TFTP from server 10.4.50.5; our IP address is 10.4.50.165
Filename 'uImage'.
Load address: 0x2000000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
## Booting image at 02000000 ...
Bad Magic Number
Unknown command '<NULL>' - try 'help'

Cheers
eRflol
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #7 on: August 17, 2009, 05:45:17 PM »

Again, I cannot say I've encountered this before, but here's what I'd try:

(I'm presuming you've run the alpha-6 loader multiple times with the same result.  If not, I'd run it again.)

1.  Do a 'printenv' and verify what the environment actually is.  (And, publish the actual 'printenv' here -- I'd like to know what the default environment looks like.

2.  Create a file of 'setenv's that recreates the environment that the alpha-6 loader uploads, and copy-and-paste them into the Uboot program.  Then do a 'saveenv' and see if that works.

I'm hoping one of the guys who knows more about the NAND, and how the Uboot interacts with it, can shed more light on this.
Logged

erflol
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #8 on: August 17, 2009, 07:16:28 PM »

I ran the runme.sh again, just for fun.. although I've done it many times.

Here's what the default environment looks like:

Code:
printenv
baudrate=115200
loads_echo=0
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)
mainlineLinux=no
CASset=min
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
MALLOC_len=1
ethprime=egiga0
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
bootcmd=tftpboot 0x2000000 $(image_name);setenv bootargs $(console) $(bootargs_root) nfsroot=$(serverip):$(rootpath) ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvNetConfig) $(mvPhoneConfig);  bootm 0x2000000;
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
bootdelay=3
disaMvPnp=no
ethaddr=00:50:43:62:14:2b
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
enaAutoRecovery=yes
ethact=egiga0
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root) root=/dev/nfs rw nfsroot=10.4.50.5:/mnt/ARM_FS/ ip=10.4.50.165:10.4.50.5:::DB88FXX81:eth0:none mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500 mv_phone_config=dev0:fxs,dev1:fxs

Environment size: 1542/131068 bytes

I'll try your suggestion tomorrow

Cheers
eRflol
Logged

Rabeeh Khoury
Administrator
Full Member
*****

Karma: 5
Posts: 218


View Profile
« Reply #9 on: August 17, 2009, 11:28:27 PM »

It looks like you have the default environment variables (which does TFTP) and not the custom env variables for the plug.

It's weird since the installer tells you that it was able to write the custom env variables -
Code:
successfully erased blocks 5 to 6 on NAND flash device 'NAND 512MiB 3,3V 8-bit'
wrote file uboot-env.bin to NAND flash 0 up to offset 0x000a0000 in 0.000113s


I suggest setting the env variables manually. You need to do the following (this is taken from uboot-custom.txt file from the installer, which is downloaded to the plug via jtag automatically) -

Code:
setenv bootargs_root 'ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs'
setenv mtdpartitions 'mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)'
setenv ethaddr '00:62:81:a0:00:00'
setenv real_bootcmd 'setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000'
setenv bootargs_console console=ttyS0,115200
setenv bootcmd 'run recover1'
setenv recover1 'setenv mainlineLinux yes; setenv arcNumber 2097; setenv bootcmd run recover2; saveenv; reset'
setenv recover2 'run recover3; setenv bootcmd $(real_bootcmd); saveenv; setenv bootargs $(bootargs_console) $(mtdpartitions); bootm 0x00800000 0x01100000'
setenv recover3 'run recover4; nand erase clean 0x00100000 0x00400000; nand write.e 0x00800000 0x00100000 0x00400000'
setenv recover4 'usb start; fatload usb 0 0x00800000 uImage; fatload usb 0 0x01100000 initrd'
saveenv

Then plug your USB stick and reset the plug and take a dump on what's happening.

Logged

erflol
Newbie
*

Karma: 0
Posts: 6


View Profile
« Reply #10 on: August 18, 2009, 07:27:29 AM »

That seemed to have done the trick. I'm not sure why the variables weren't written properly from the script. Setting them all manually worked without a hitch.

For anyone in the future with this problem, run the runme.sh script. Then connect to the plug via serial and manually set the environment variables from your uboot-custom.txt file (or from above. Don't forget to change the MAC address to the one that's on the back of your device. )  Then simply type reset. After that your plug will restart itself and run through the installation.

Cheers guys, I now have a working plug Smiley
eRflol
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #11 on: August 18, 2009, 12:25:22 PM »

Thanks for the info, and congrats on getting your Plug back up and running.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #12 on: August 18, 2009, 02:42:40 PM »

Quote
./runme.sh: 12: Syntax error: Bad fd number
./runme.sh: 13: Syntax error: Bad fd number
Don't these error messages worry anyone?  They come from the lines that are running fw_setenv.  And the problem was a result of the environment vars not being set.,
Logged

Pages: [1]
Print
Jump to: