New IT forum Follow us on Twitter
23 May 2012, 04:51:04 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: EFIKA MX now in stock!
 
   Home   SHOP Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Won't boot - 'magic number' time....  (Read 1700 times)
rcrowther
Newbie
*
Posts: 14


« on: 07 January 2011, 03:52:07 pm »

Putting in boot forum 'cause that's the place to start.

A few hours after I unpack and try the SheevaPlug (feel the pain), I'm jambed. Basic devel kit, jffs2. A1 processor according to the label and printout.

The SheevaPlug booted ok on about the third effort. I used PuTTY to get into it, via the mini-USB, from a Hardy Linux box.

I then used the plug to format a SD card so going good at that point.

Then I tried to update uBoot via a USB memory stick. The stick worked ok, and the plug reported nothing. Believe it or not, despite the commands working. A bit annoyed, I tried setting up a tftp server, but ran into the usual problems of free sofware vis. which one, has it set up right, what addresses is it using, can I wire it past the router, or must I set up the router? Too many questions unanswered. Deciding this wasn't for me I tried a few uBoot images on other sticks, found the SheevaPlug now booting, switching uBoots, but complaining about magic numbers. Here's the info,
Code:

 ** MARVELL BOARD: SHEEVA PLUG LE

U-Boot 1.1.4 (Sep 14 2009 - 15:36:37) Marvell version: 3.4.19

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

Soc: 88F6281 A1 (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
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:512 MB
Flash:  0 kB

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
Marvell>> <INTERRUPT>
Note I reverted to uBoot 3.4.19. NewIT image. Still able to swap uBoots. All report magic number errors.

Here's my current environment. This matches, close as I can,

http://www.newit.co.uk/forum/index.php/topic,134.0.html

factory version. Though some settings seem either not on that list or new.
Code:
Marvell>> printenv
autoload=no

baudrate=115200

bootargs_root=root=/dev/mtdblock2 ro

bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw
bootargs_end=:::DB88FXX81:eth0:none ip=10.4.50.4:10.4.50.5:10.4.50.5:255.255.255.0:DB88FXX81:eth0:none

bootcmd=nand read.e 0x800000 0x100000 0x400000; bootm 0x800000

bootdelay=3

CASset=min

cesvcid=ULULULULULULPPULULULULULDA

console=ttyS0,115200

disaMvPnp=no
disL2Cache=no

disL2Prefetch=yes

enaAutoRecovery=yes

enaCpuStream=no

enaDCPref=yes

enaICPref=yes

enaMonExt=no

enaWrAllo=no

ethact=egiga0

ethaddr=00:50:43:75:19:19

ethmtu=1500

ethprime=egiga0

image_name=uImage

ipaddr=10.10.0.1

loadaddr=0x02000000

loads_echo=0

mainlineLinux=no

MALLOC_len=1

mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500

mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs

nandEcc=1bit

nandEnvBase=5200

netbsd_en=no

netmask=255.255.255.0

netretry=no

pcieTune=no

pexMode=RC

rcvrip=169.254.100.100

rootpath=/mnt/ARM_FS/

run_diag=yes

sata_dma_mode=yes

serverip=10.10.0.2

setL2CacheWT=yes

standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;

stderr=serial

stdin=serial

stdout=serial

usb0Mode=host

vxworks_en=no

yuk_ethaddr=00:00:EE:51:81



Or did I inherit these when the boot failed and went into default? Here's what happens when I boot,
Code:
Environment size: 1322/131068 bytes
Marvell>> boot

NAND read: device 0 offset 0x100000, size 0x400000

Reading data from 0x4ff800 -- 100% complete.
 4194304 bytes read: OK
## Booting image at 00800000 ...
Bad Magic Number
Marvell>>


Questions

Are these env settings the right set? And some of the envs seem to have changed? New envs? What should they be?

Is this a likely fix anyhow? I thought the magic number would here refer to the address start of the image file. All's good there, surely? Not been near the image.

Or am I looking at a full scale effor at reimaging and so forth?

Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #1 on: 07 January 2011, 07:07:10 pm »

Many of the environment variables don't matter for "normal" NAND booting. Those relating to IP addresses, to give a simple example. There are some settings that I've never seen explained nor needed to research (enaWrAllo, for example). (If you do want to look them all up, U-Boot help / manuals are easily found via google).

The ones that matter most are those that set the boot parameters / arguments, however I can't spot any problems there.

On the other hand, you do have run_diag set to "yes", which runs a series of tests, instead of attempting a normal boot.

There are 2 other possible explanations; that you upgraded the kernel prior to tinkering with the environment variables, or that you purchased (or received) a UBIFS plug, not a JFFS2 one. And for the sake of completeness perhaps you can confirm whether you have an eSATA plug or a non-eSATA plug.
Logged
rcrowther
Newbie
*
Posts: 14


« Reply #2 on: 09 January 2011, 11:52:35 am »

Good call -> not an eSATA.

UBIFS: here's a good suggestion. Can't remember what filesystem I ordered, though the invoice said jffs2. Tried this set, sorted for you all,
Code:
arcNumber=2097

autoload=no

baudrate=115200

bootargs_console=console=ttyS0,115200

bootargs_end=:::DB88FXX81:eth0:none

bootargs_root=ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs

bootargs=console=ttyS0,115200 ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs

bootcmd=setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000

bootdelay=3

CASset=min

console=a0000

disaMvPnp=no

disL2Cache=no

disL2Prefetch=yes

e=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)

enaAutoRecovery=yes

enaCpuStream=no

enaDCPref=yes

enaICPref=yes

enaMonExt=no

enaWrAllo=no

ethact=egiga0

ethaddr=00:50:43:75:19:19

ethmtu=1500

ethprime=egiga0

filesize=32062A

image_name=uImage

ipaddr=10.4.50.165

loadaddr=0x02000000

loads_echo=0

mainlineLinux=yes

MALLOC_len=1

mdtpartitions=mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)

mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500

mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs

nandEcc=1bit

nandEnvBase=a0000

netbsd_en=no

netmask=255.255.255.0

netretry=no

pcieTune=no

pexMode=RC

rcvrip=169.254.100.100

real_bootcmd=setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000

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) root=/dev/ram0 rw ramdisk=0x01100000,8M install_type=nand;

recover3=run recover4; nand erase clean 0x00100000 0x00400000; nand write.e 0x00800000 0x00100000 0x00400000

recover4=usb start; fatload usb 0 0x00800000 uImage; fatload usb 0 0x01100000 initrd

rootpath=/mnt/ARM_FS/

run_diag=no

sata_dma_mode=yes

serverip=10.4.50.5

setL2CacheWT=yes

standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;

stderr=serial

stdin=serial

stdout=serial

usb0Mode=host

vxworks_en=no

yuk_ethaddr=00:00:00:EE:51:81


Environment size: 2122/131068 bytes
Marvell>>
Aside from a complaint about the recover2 having too many arguments, looked ok, but still,
Code:

NAND read: device 0 offset 0x100000, size 0x400000

Reading data from 0x4ff800 -- 100% complete.
 4194304 bytes read: OK
## Booting image at 00800000 ...
Bad Magic Number
Marvell>>
Is there any way of external booting via USB to look at the filesystems? I looked for any mention of a system I could boot from the USB, since I've got a working bootloader I could point at it, but couldn't find one.

With that, I could verify the filesystem for a start. Even try hacking in a new image?

Also, what's the purpose of the 'recover' set? Recover4 fatloads and initrd and uImage from USB. Could I work from there with a suitable image set?

Logged
NewIT_Marcus
Administrator
Hero Member
*****
Posts: 960


« Reply #3 on: 09 January 2011, 09:24:14 pm »

If you can't boot from NAND, you might be able to boot from SD card, mount the NAND data, and learn its format that way. Evidently that's not going to be practical this time.

The recover variables are used during writing of the UBIFS data to NAND. In theory, one only uses these variables once, during the reflashing process, but they can be useful for re-flashing in the event of any problems.

Under the circumstances, you may be as well to rewrite the NAND as UBIFS via the following procedure. Note that if the original environment variables did not include any recover* variables, you had a JFFS2 system. If there were recover* variables, you had UBIFS. Based on what you've said, it does indeed sound like you have a JFFS2 system.

So, to execute the reflashing process:
  • Upgrade U-Boot (we recommend 3.4.23)
  • Download the installer
  • Copy the files described in the installer readme to a FAT formatted USB stick
  • Prepare your environment variables according to our multi-boot setup *
  • Interrupt booting and execute run recover1 from the U-Boot prompt

* Note that for environment variables that have many space characters within their value, you will not be able to type the data in one line. But you can do:

Code:
setenv a 'this is the first part of the value'
setenv b 'this is the first part of the value'
setenv c $a $b

I might not have the syntax 100% here; it might be necessary to use single quotation marks again.

If you get any critical environment variable wrong, it won't work. So don't ignore any errors.

Right now you wont' be able to boot because your arcNumber and mainlineLinux are set up for a non-original kernel, and according to your report, you have a JFFS2 system with original kernel.
Logged
rcrowther
Newbie
*
Posts: 14


« Reply #4 on: 11 January 2011, 12:03:28 am »

My word. Not by your method, but thanks for the help Marcus. This is excellent support. More to come when I've really assessed where I've got up to.
Logged
rcrowther
Newbie
*
Posts: 14


« Reply #5 on: 13 January 2011, 07:14:00 pm »

This turned into a pretty wild adventure.  I never found a way of booting a system or getting the args to work. I had to use the installer and crack in with a netbook. It was not in my plans to have a multiboot SheevaPlug... Ah well. I've dropped my notes into a new post for anyone who needs the base material.

Is there a way of closing a topic? Because this one is done.
Logged
rcrowther
Newbie
*
Posts: 14


« Reply #6 on: 14 January 2011, 08:05:57 pm »

For the many people who are viewing this post, in the case you're here due to 'bad magic number',

This would seem to be one of those enigmatic computer error messages. This one could be glossed as "uBoot is trying to boot from something it can't read, or the file (in this case, the kernel image) it finds is corrupted".

Code:
http://en.wikipedia.org/wiki/Magic_number_%28programming%29

See my notes in the followup post.
 
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!