Welcome! Log In Create A New Profile

Advanced

[SOLVED]NSA325 v2: stuck on Bad Magic Number

Posted by davdav 
[SOLVED]NSA325 v2: stuck on Bad Magic Number
December 27, 2018 08:31AM
Hi Forum!
what a pity I found you only a few hours ago.
I have a NSA 325 v2: a friend told me that I can put Debian on it..
googling NSA325 debian I went to the wrong wiki :( (zyxel.nas-central.org/wiki/Debian_on_325, which is outdated).

What I did:
At the Marvell>> Prompt
Marvell>> resetenv
Marvell>> reset
The device rebooted.

At the Marvell>> Prompt again
Marvell>> saveenv
Marvell>> reset

Now I have the Bad Magic Number message.

I cannot proceed there since files are missing (create boot partition, create rootfs partition). I tried to replace the missing files with the files found here: the system boot, but then stops loading linux due to some incompatibility.

I tried then to follow your how to (creating 1 partion ext3 and so on), but again I have the bad magic number message.

Is there a way to reset back to stock, so that I can start from scratch using your tutorials?

thanks a lot



Edited 1 time(s). Last edit at 01/05/2019 03:38AM by davdav.
Re: NSA325 v2: stuck on Bad Magic Number
December 27, 2018 04:20PM
davdav Wrote:
-------------------------------------------------------
> Hi Forum!
> what a pity I found you only a few hours ago.
> I have a NSA 325 v2: a friend told me that I can
> put Debian on it..
> googling NSA325 debian I went to the wrong wiki :(
> (zyxel.nas-central.org/wiki/Debian_on_325, which
> is outdated).
>
> What I did:
> At the Marvell>> Prompt
>
> Marvell>> resetenv
> Marvell>> reset
>
> The device rebooted.
>
> At the Marvell>> Prompt again
>
> Marvell>> saveenv
> Marvell>> reset
>
>
> Now I have the Bad Magic Number message.
>
> I cannot proceed there since files are missing
> (create boot partition, create rootfs partition).
> I tried to replace the missing files with the
> files found here: the system boot, but then stops
> loading linux due to some incompatibility.
>
> I tried then to follow your how to (creating 1
> partion ext3 and so on), but again I have the bad
> magic number message.
>
> Is there a way to reset back to stock, so that I
> can start from scratch using your tutorials?
>
> thanks a lot


Please boot and inerrupt serial console at count down.
printenv
boot
And post the entire serial console log until the error

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 12/27/2018 04:23PM by bodhi.
Re: NSA325 v2: stuck on Bad Magic Number
December 28, 2018 11:41AM
Hi bodhi, thanks for your reply.

Here are the outputs:

printenv
Quote

bootcmd_stock=setenv bootargs $(bootargs_stock); nand read.e $(loadaddr) $(kernel_addr) 0xA00000; bootm $(loadadr)
to_stock=setenv mainlineLinux no; setenv bootcmd \'run bootcmd_stock\'; saveenv; reset
to_linux=setenv mainlineLinux yes; setenv bootcmd \'run bootcmd_linux\'; saveenv; reset
bootcmd='run bootcmd_linux'
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
disaMvPnp=no
enaAutoRecovery=yes
kernel_addr=0x4640000
pcieTune=no
pcieTune1=no

Environment size: 2498/131068 bytes

boot (without usb)
Quote

Marvell>> boot
(Re)start USB...
USB: scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found
** Bad partition 1 **
** Bad partition 1 **
## Booting image at 02000000 ...
Bad Magic Number

boot with usb inserted
Quote

Marvell>> boot
(Re)start USB...
USB: scanning bus for devices... 1 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found
** Bad partition 1 **
** Bad partition 1 **
## Booting image at 02000000 ...
Bad Magic Number

Currently I have no disks, I have the board disassembled..
Re: NSA325 v2: stuck on Bad Magic Number
December 28, 2018 05:42PM
davdav Wrote:
-------------------------------------------------------
> Hi bodhi, thanks for your reply.
>
> Here are the outputs:
>
> printenv
>
Quote

> bootcmd_stock=setenv bootargs $(bootargs_stock);
> nand read.e $(loadaddr) $(kernel_addr) 0xA00000;
> bootm $(loadadr)
> to_stock=setenv mainlineLinux no; setenv bootcmd
> \'run bootcmd_stock\'; saveenv; reset
> to_linux=setenv mainlineLinux yes; setenv bootcmd
> \'run bootcmd_linux\'; saveenv; reset
> bootcmd='run bootcmd_linux'
> 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
> disaMvPnp=no
> enaAutoRecovery=yes
> kernel_addr=0x4640000
> pcieTune=no
> pcieTune1=no
>
> Environment size: 2498/131068 bytes
>
>
> boot (without usb)
>
Quote

Marvell>> boot
> (Re)start USB...
> USB: scanning bus for devices... 2 USB Device(s)
> found
> Waiting for storage device(s) to settle before
> scanning...
> 0 Storage Device(s) found
> ** Bad partition 1 **
> ** Bad partition 1 **
> ## Booting image at 02000000 ...
> Bad Magic Number
>
>
> boot with usb inserted
>
Quote

> Marvell>> boot
> (Re)start USB...
> USB: scanning bus for devices... 1 USB Device(s)
> found
> Waiting for storage device(s) to settle before
> scanning...
> 0 Storage Device(s) found
> ** Bad partition 1 **
> ** Bad partition 1 **
> ## Booting image at 02000000 ...
> Bad Magic Number
>
>
> Currently I have no disks, I have the board
> disassembled..

I’ll find the post about the solution to fix this.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325 v2: stuck on Bad Magic Number
December 29, 2018 09:14AM
davdav,

See this post for explanation and how to fix the problem:

https://forum.doozan.com/read.php?3,38889,40034#msg-40034

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325 v2: stuck on Bad Magic Number
December 29, 2018 11:59AM
thanks again..
but I cannot proceed:

I've downloaded the scr file and put it into boot folder
run the commands like below

Marvell>> usb start
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found
Marvell>> ext2load usb 0:1 0x800000 /boot/uboot.2016.05-tld-1.environment.scr
** Bad partition 1 **
Usb created with the gui way (kde partition editor) and the shell way (with root user, no sudo).. same result

fdisk -l
Disk /dev/sdc: 14,5 GiB, 15504900096 bytes, 30283008 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 4BE265C1-26F2-46D7-809F-F1ED344B7CB0

Device     Start      End  Sectors  Size Type
/dev/sdc1   2048 30282974 30280927 14,4G Linux filesystem

tune2fs
tune2fs 1.44.1 (24-Mar-2018)
Filesystem volume name:   rootfs
Last mounted on:          /media/davdav/rootfs
Filesystem UUID:          79c803fb-7b33-47c3-9ced-d08885362b27
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              946560
Block count:              3785115
Reserved block count:     189255
Free blocks:              3579679
Free inodes:              932107
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      924
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8160
Inode blocks per group:   510
Filesystem created:       Sat Dec 29 18:40:05 2018
Last mount time:          Sat Dec 29 18:43:56 2018
Last write time:          Sat Dec 29 18:50:26 2018
Mount count:              1
Maximum mount count:      -1
Last checked:             Sat Dec 29 18:40:05 2018
Check interval:           0 (<none>)
Lifetime writes:          491 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     32
Desired extra isize:      32
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      fa0b193d-1923-4964-b360-57905f153a63
Journal backup:           inode blocks
Re: NSA325 v2: stuck on Bad Magic Number
December 29, 2018 12:12PM
tried another USB pen, same result.. :(
Re: NSA325 v2: stuck on Bad Magic Number
December 30, 2018 08:09AM
davdav Wrote:
-------------------------------------------------------
> thanks again..
> but I cannot proceed:
>
> I've downloaded the scr file and put it into boot
> folder
> run the commands like below
>
>
> Marvell>> usb start
> (Re)start USB...
> USB:   scanning bus for devices... 2 USB Device(s)
> found
> Waiting for storage device(s) to settle before
> scanning...
> 0 Storage Device(s) found
> Marvell>> ext2load usb 0:1 0x800000
> /boot/uboot.2016.05-tld-1.environment.scr
> ** Bad partition 1 **
>
> Usb created with the gui way (kde partition
> editor) and the shell way (with root user, no
> sudo).. same result
>
> fdisk -l
>
> Disk /dev/sdc: 14,5 GiB, 15504900096 bytes,
> 30283008 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512
> bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: gpt
> Disk identifier:
> 4BE265C1-26F2-46D7-809F-F1ED344B7CB0
> 
> Device     Start      End  Sectors  Size Type
> /dev/sdc1   2048 30282974 30280927 14,4G Linux
> filesystem
> 
>
>
> tune2fs
>
> tune2fs 1.44.1 (24-Mar-2018)
> Filesystem volume name:   rootfs
> Last mounted on:          /media/davdav/rootfs
> Filesystem UUID:         
> 79c803fb-7b33-47c3-9ced-d08885362b27
> Filesystem magic number:  0xEF53
> Filesystem revision #:    1 (dynamic)
> Filesystem features:      has_journal ext_attr
> resize_inode dir_index filetype sparse_super
> large_file
> Filesystem flags:         signed_directory_hash 
> Default mount options:    user_xattr acl
> Filesystem state:         clean
> Errors behavior:          Continue
> Filesystem OS type:       Linux
> Inode count:              946560
> Block count:              3785115
> Reserved block count:     189255
> Free blocks:              3579679
> Free inodes:              932107
> First block:              0
> Block size:               4096
> Fragment size:            4096
> Reserved GDT blocks:      924
> Blocks per group:         32768
> Fragments per group:      32768
> Inodes per group:         8160
> Inode blocks per group:   510
> Filesystem created:       Sat Dec 29 18:40:05
> 2018
> Last mount time:          Sat Dec 29 18:43:56
> 2018
> Last write time:          Sat Dec 29 18:50:26
> 2018
> Mount count:              1
> Maximum mount count:      -1
> Last checked:             Sat Dec 29 18:40:05
> 2018
> Check interval:           0 (<none>)
> Lifetime writes:          491 MB
> Reserved blocks uid:      0 (user root)
> Reserved blocks gid:      0 (group root)
> First inode:              11
> Inode size:               256
> Required extra isize:     32
> Desired extra isize:      32
> Journal inode:            8
> Default directory hash:   half_md4
> Directory Hash Seed:     
> fa0b193d-1923-4964-b360-57905f153a63
> Journal backup:           inode blocks
>

Please post the entire serial console log of your attempt above:
https://forum.doozan.com/read.php?3,75724,75839#msg-75839

A snippet of the log is not helpful.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325 v2: stuck on Bad Magic Number
January 02, 2019 11:23AM
hi Bodhi (& forum too), back again after some troubles with the new year. I hope you enjoyed these days.

here is the full log
 ** MARVELL BOARD: DB-88F6282A-BP LE 

U-Boot 1.1.4 (Jul 18 2013 - 10:47:29) Marvell version: 3.5.9

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

Soc: 88F6282 A1CPU running @ 1600Mhz L2 running @ 800Mhz
SysClock = 533Mhz , TClock = 200Mhz 

DRAM (DDR3) CAS Latency = 7 tRP = 8 tRAS = 24 tRCD=8
DRAM CS[0] base 0x00000000   size 512MB 
DRAM Total size 512MB  16bit width
Addresses 10M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (10M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)
Kernel address is 0x4640000.

Streaming disabled 
Write allocate disabled


USB 0: host mode
        [BlueDBG] reseting SoC Pex[0]  0 ...
PEX 0: PCI Express Root Complex Interface
PEX interface detected Link X1
        [BlueDBG] reseting SoC Pex[1]  0 ...
        [BlueDBG] reseting SoC Pex[1]  1 ...
        [BlueDBG] reseting SoC Pex[1]  2 ...
        [BlueDBG] reseting SoC Pex[1]  3 ...
        [BlueDBG] reseting SoC Pex[1]  4 ...
        [BlueDBG] reseting SoC Pex[1]  5 ...
        [BlueDBG] reseting SoC Pex[1]  6 ...
        [BlueDBG] reseting SoC Pex[1]  7 ...
        [BlueDBG] reseting SoC Pex[1]  8 ...
        [BlueDBG] reseting SoC Pex[1]  9 ...
        [BlueDBG] reseting SoC Pex[1]  10 ...
PEX 1: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 
Marvell>> usb start
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found
Marvell>> ext2load usb 0:1 0x800000 /boot/uboot.2016.05-tld-1.environment.scr
** Bad partition 1 **
Marvell>>

EDIT: adding again printenv command:
mvPhoneConfig=mv_phone_config=dev[0]:fxs,dev[1]:fxo
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
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
ethact=egiga0
arcNumber=4495
bootargs_stock=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=/dev/nfs rw init=/init
bootargs_linux=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=LABEL=rootfs loglevel=8
bootcmd_linux=setenv bootargs $(bootargs_linux); mw.l f1010100 0020c000; usb reset; ext2load usb 0:1 $(loadaddr) /uImage; ext2load usb 0:1 0x01100000 /uInitrd; bootm $(loadaddr) 0x01100000
bootcmd_stock=setenv bootargs $(bootargs_stock); nand read.e $(loadaddr) $(kernel_addr) 0xA00000; bootm $(loadadr)
to_stock=setenv mainlineLinux no; setenv bootcmd \'run bootcmd_stock\'; saveenv; reset
to_linux=setenv mainlineLinux yes; setenv bootcmd \'run bootcmd_linux\'; saveenv; reset
bootcmd='run bootcmd_linux'
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
disaMvPnp=no
enaAutoRecovery=yes
kernel_addr=0x4640000
pcieTune=no
pcieTune1=no

Environment size: 2498/131068 bytes
Marvell>>


thanks for your help.



Edited 1 time(s). Last edit at 01/02/2019 11:51AM by davdav.
Re: NSA325 v2: stuck on Bad Magic Number
January 02, 2019 10:46PM
davdav,

This script only works with the new u-boot, you are still on stock u-boot.

> Marvell>> ext2load usb 0:1 0x800000
> /boot/uboot.2016.05-tld-1.environment.scr
> ** Bad partition 1 **

It seems I might have misunderstood your problem, because your previous log has a mix of old and new envs.

=====

I've reread your 1st post. And I think since you did a reset at u-boot prompt, your stock envs are also messed up!

So now perhaps you should run a procedure that will get you boot into the latest Debian rootfs. And then install new u-boot once you get there.

This procedure was written for NS310S, but it will work for the NS325 just the same:

https://forum.doozan.com/read.php?3,51739,51919#msg-51919

Instead of kwboot with the image uboot.2017.07-tld-1.nsa310s.mtd0.kwb, you need to use the image uboot.2017.07-tld-1.nsa325.mtd0.kwb from the u-boot release thread:

https://forum.doozan.com/read.php?3,12381

Once kwboot started and you are in the new u-boot prompt, you can try to boot your current rootfs (which you might have created using NAScentral instruction),

Or create and boot a new rootfs using Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 tarball from the rootfs/kernel release thread:

https://forum.doozan.com/read.php?2,12096

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325 v2: stuck on Bad Magic Number
January 04, 2019 03:51AM
Now I want to be carefull..
  1. I downloaded uboot.2017.07-tld-1.nsa325.bodhi.tar (checksum ok)
  2. I downloaded kwboot-2016.05.tar (then understood that this was for ARM devices, I am on amd64 Ubuntu)
  3. installed u-boot tools from repo, with kwboot executable inside
I then run the command:
sudo kwboot  -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.nsa325.mtd0.kwb -p
the output
Sending boot message. Please reboot the target...\
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  6 % [......................................................................]
  8 % [......................................................................]
 10 % [......................................................................]
 11 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 23 % [......................................................................]
 25 % [......................................................................]
 27 % [......................................................................]
 29 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 34 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 44 % [......................................................................]
 46 % [......................................................................]
 47 % [......................................................................]
 49 % [......................................................................]
 51 % [......................................................................]
 53 % [......................................................................]
 54 % [......................................................................]
 56 % [......................................................................]
 58 % [......................................................................]
 59 % [......................................................................]
 61 % [......................................................................]
 63 % [......................................................................]
 64 % [......................................................................]
 66 % [......................................................................]
 68 % [......................................................................]
 70 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 75 % [......................................................................]
 76 % [......................................................................]
 78 % [......................................................................]
 80 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 85 % [......................................................................]
 87 % [......................................................................]
 88 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 95 % [......................................................................]
 97 % [......................................................................]
 99 % [....................................]
[Type Ctrl-\ + c to quit]
Stuck here since 1 hour.. Is it safe to quit and try again?
Re: NSA325 v2: stuck on Bad Magic Number
January 04, 2019 04:55AM
davdav,

> I then run the command:
>
> sudo kwboot  -t -B 115200 /dev/ttyUSB0 -b
> uboot.2017.07-tld-1.nsa325.mtd0.kwb -p
>

By the look of of the command above, I'm guessing it is from a x86 Linux box or a VM? it is often problemmatic to run old kwboot version from a x86 Ubuntu box.

If it is a x86 Linux box, you can try the latest x86_64 kwboot I've attached in this post:

https://forum.doozan.com/read.php?3,58144,74249#msg-74249

If it is ARM Linux box, use the latest ARM kwboot I've attached in this post:

https://forum.doozan.com/read.php?3,69499,72534#msg-72534

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325 v2: stuck on Bad Magic Number
January 04, 2019 09:23AM
ok, it works, thanks!!
I can now boot into your rootfs.

fw_printenv
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
device=0:1
devices=usb ide mmc
disks=0 1 2 3
ethact=egiga0
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb_addr=0x1c00000
load_initrd_addr=0x1100000
load_uimage_addr=0x800000
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset";  setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if load $dev $disknum:1 $load_uimage_addr /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.0.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
uenv_init_devices=setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices;  do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
usb_ready_retry=15
arcNumber=4495
ethaddr=28:28:5D:13:F2:C9
dtb_file=/boot/dts/kirkwood-nsa325.dtb
mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)

I can now proceed flashing the new Uboot (https://forum.doozan.com/read.php?3,12381)
1. Dumping NAND mtd0
nanddump --noecc --omitoob -l 0x80000 -f mtd0 /dev/mtd0
2. bad blocks?
root@debian:~# dmesg | grep -i 'bad'
[    5.869471] Scanning device for bad blocks
[    5.881678] Bad eraseblock 84 at 0x000000a80000
[    5.924175] Bad eraseblock 482 at 0x000003c40000
[    5.947658] Bad eraseblock 680 at 0x000005500000
[    5.958750] Bad eraseblock 748 at 0x000005d80000

it seems there are bad blocks..

What should I do now? I stopped because on the warning about bricking the device.

thanks again
Re: NSA325 v2: stuck on Bad Magic Number
January 04, 2019 11:48AM
> root@debian:~# dmesg | grep -i 'bad'
> [ 5.869471] Scanning device for bad blocks
> [ 5.881678] Bad eraseblock 84 at
> 0x000000a80000
> [ 5.924175] Bad eraseblock 482 at
> 0x000003c40000
> [ 5.947658] Bad eraseblock 680 at
> 0x000005500000
> [ 5.958750] Bad eraseblock 748 at
> 0x000005d80000


Those bad blocks are OK. They are far out from mtd0, where u-boot is, which is block 0 to 7.

However, you will need to adjust this env.

In serial console,

setenv mtdparts 'mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)'

Before flashing u-boot in Debian, check the mtds:

cat /proc/mtd

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325 v2: stuck on Bad Magic Number
January 04, 2019 11:58AM
bodhi Wrote:
-------------------------------------------------------
> > root@debian:~# dmesg | grep -i 'bad'
> > [ 5.869471] Scanning device for bad blocks
> > [ 5.881678] Bad eraseblock 84 at
> > 0x000000a80000
> > [ 5.924175] Bad eraseblock 482 at
> > 0x000003c40000
> > [ 5.947658] Bad eraseblock 680 at
> > 0x000005500000
> > [ 5.958750] Bad eraseblock 748 at
> > 0x000005d80000
>
>
> Those bad blocks are OK. They are far out from
> mtd0, where u-boot is, which is block 0 to 7.
>
> However, you will need to adjust this env.
>
> In serial console,
>
>
> setenv mtdparts
> 'mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)'
>
>
> Before flashing u-boot in Debian, check the mtds:
>
>
> cat /proc/mtd
>

Thanks bodhi.
Env fixed as suggested.

Here is cat /proc/mtd:
root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "uboot"
mtd1: 00080000 00020000 "uboot_env"
mtd2: 00080000 00020000 "key_store"
mtd3: 00080000 00020000 "info"
mtd4: 00a00000 00020000 "etc"
mtd5: 00a00000 00020000 "kernel_1"
mtd6: 02fc0000 00020000 "rootfs1"
mtd7: 00a00000 00020000 "kernel_2"
mtd8: 02fc0000 00020000 "rootfs2"
Re: NSA325 v2: stuck on Bad Magic Number
January 04, 2019 08:32PM
davdav,

> Here is cat /proc/mtd:
>
> root@debian:~# cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00100000 00020000 "uboot"
> mtd1: 00080000 00020000 "uboot_env"
> mtd2: 00080000 00020000 "key_store"
> mtd3: 00080000 00020000 "info"
> mtd4: 00a00000 00020000 "etc"
> mtd5: 00a00000 00020000 "kernel_1"
> mtd6: 02fc0000 00020000 "rootfs1"
> mtd7: 00a00000 00020000 "kernel_2"
> mtd8: 02fc0000 00020000 "rootfs2"
>

Looks good!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325 v2: stuck on Bad Magic Number
January 05, 2019 03:38AM
THANKS!

it works!!

Now I have the latest uboot and Debian running by default.

Thanks a lot bodhi, You really helped me.
andreas
Re: NSA325 v2: stuck on Bad Magic Number
February 06, 2019 02:07AM
Hi davdav,

i'm searching for the original uboot NAND mtd0. I forgot to make a backup when i install the new one.
Can you provide me your backup of mtd0?

Greets
Andreas
Re: NSA325 v2: stuck on Bad Magic Number
March 13, 2019 05:47PM
Moved to new topic



Edited 2 time(s). Last edit at 03/14/2019 04:07PM by FiLoU.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: