Welcome! Log In Create A New Profile

Advanced

Bricked NSA320S during 2017.07 flash

Posted by zc5 
Re: Bricked NSA320S during 2017.07 flash
June 07, 2020 09:24PM
enki,

> It happened before all of latest DTS/init_sata
> also
with the 2.5'' disk on slot 2 indeed. It
> clicks when BUS1 activates and then after whenever
> it writes on the disk.

That's abnormal. I don't recall anybody has reported this. How old is the 2.5" HDD in the 2nd slot? have you tried swaping these two 1<-->2?

>
> Would it may be a diffrent bit from “Functional
> Specifications for Kirkwood's GPIO Data Out
> Register” to activate BUS1 in a mode which is
> appropiate and silent?

There should not be any click.

U-boot 2017.07-tld-1 activated the GPIO for the second HDD already. That's why you can use the 2.5" HDD. All Kirkwood boxes use the same SATA driver, and all we need to do is to set a GPIO to activate power. This box is GPIO 33 (as I recall from reading the GPL source).

Now with this command, does either of the two 3.5" HDDs making any click sound in Debian when you access them?
setenv init_sata 'mw.l f1010104 c70e0ffd; ide reset'

========

I'll post the envs for you in the next post.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked NSA320S during 2017.07 flash
June 07, 2020 09:56PM
Note: This mod only should be used for the NAS320S. It does not apply to other Kirkwood boxes.

Asuming the bootcmd env was unchanged from initial installation for U-boot 2017.07-tld-1.
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset

From power off, press the power button to power up, interrupt serial console and,
setenv init_sata_power 'mw.l f1010104 c70e0ffd'
setenv bootcmd 'run init_sata_power; run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset'
and then
boot

Observe serial console log to see if two 3.5" HDDs were initialized by the kernel (each showing the capacity of the disk). If all went well, log into Debian, and

fw_setenv init_sata_power 'mw.l f1010104 c70e0ffd'
fw_setenv bootcmd 'run init_sata_power; run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset'

Shutdown, and power up again, let it boot automatically , and then verify in Debian that the two HDDs still being initialized by the kernel correctly.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked NSA320S during 2017.07 flash
June 08, 2020 07:24PM
Bodhi

Quote

That's abnormal. I don't recall anybody has reported this. How old is the 2.5" HDD in the 2nd slot? have you tried swaping these two 1<-->2?

I have swapped in between 2.5inch disks as first happened. I completly agree there should be no clicks... It may be something particular with this NAS and more looking into this I start to believe this. I may restore stock software on it just to proove it. I shall ask how to use nandwrite adressess to restore it but after testing.

I shall get back to you later today with results of the latest tests.

Much apreciated
E/
Re: Bricked NSA320S during 2017.07 flash
January 14, 2021 05:13AM
Hi
I have same box, when I power on nothing happens, no post on setial console. if i boot from serial i get it up but i cant load debian from usb. What im thinkin i flashing of uboot went wrong and env have been reseted. 2 USB was pluged in, on both was loaded latest uboot, one is FAT and on the second is EXT4 with debian, 2 HDD are in, should I take them out?

sudo kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.kwb -p
Sending boot message. Please reboot the target...|
Sending boot image...

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:50:06 -0700)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server

SoC:   Kirkwood 88F6702_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
NSA3x0S> fatload usb 0 0x0 0x800000 uboot.kwb
** Bad device usb 0 **
NSA3x0S> fatload usb 1 0x0 0x800000 uboot.kwb
** Bad device usb 1 **
NSA3x0S> usb restart                         
USB is stopped. Please issue 'usb start' first.
NSA3x0S> usb start
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 
Use USB retry period from the environment: 15 second(s)

Use USB retry period from the environment: 15 second(s)
2 Storage Device(s) found
NSA3x0S> fatload usb 0 0x0 0x800000 uboot.kwb
** Unrecognized filesystem type **
NSA3x0S> fatload usb 1 0x0 0x800000 uboot.kwb
reading 0x800000
** Unable to read file 0x800000 **
NSA3x0S> fatls usb 1
            system volume information/
   131072   uboot.img 
   524288   uboot.kwb 

2 file(s), 1 dir(s)

NSA3x0S> fatload usb 1 0x0 uboot.kwb         
reading uboot.kwb
524288 bytes read in 102 ms (4.9 MiB/s)
NSA3x0S> ext2load usb 0 0x0 0x800000 uboot.kwb
** File not found 0x800000 **
NSA3x0S> ext2ls usb0
** No device specified **
NSA3x0S> ext2ls usb 0
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
       218212300 Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2
<DIR>       4096 proc
<DIR>       4096 sbin
<DIR>       4096 dev
<DIR>       4096 root
<DIR>       4096 usr
<DIR>       4096 opt
<DIR>       4096 boot
<DIR>       4096 bin
<DIR>       4096 etc
<DIR>       4096 tmp
<DIR>       4096 mnt
<DIR>       4096 var
<DIR>       4096 home
<DIR>       4096 media
<DIR>       4096 sys
<DIR>       4096 run
<DIR>       4096 lib
<DIR>       4096 srv
          524288 uboot.kwb
          131072 uboot.img

NSA3x0S> usbboot 10000 0:1

Loading from usb device 0, partition 1: Name: usbda1  Type: U-Boot
Error occured, error code = 49
** Unknown image type
NSA3x0S> usb part

Partition Map for USB device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	30717952  	00057363-01	83


Partition Map for USB device 1  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	976896    	007c1021-01	0e Boot

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
NSA3x0S> usbboot 10000 0:0

Loading from usb device 0, partition 0: Name: Whole Disk  Type: U-Boot
Error occured, error code = 49
** Unknown image type



Edited 1 time(s). Last edit at 01/14/2021 05:33AM by mervin.
Re: Bricked NSA320S during 2017.07 flash
January 14, 2021 05:30AM
in other post i found this

NSA310 is new enough so you can recover it easily with "kwboot" tool and serial (and a linux PC), see here.
http://forum.doozan.com/read.php?3,7852,7852

This is the command that should work in your case

./kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot.kwb -p

Then you need to flash the uboot as you tried before.
kwboot only loads u-boot in RAM.

fatload usb 0 0x1000000 uboot.bin
nand erase 0x00000 0x100000
nand write 0x1000000 0x00000 0x100000
reset
I was loading into
fatload usb 1 0x0 0x800000 uboot.kwb
reading 0x800000
** Unable to read file 0x800000 **
but later in same post you was telling guy to load into
usb start
fatload usb 0:3 0x2000000 lede-kirkwood-nsa310b-squashfs-factory.bin

Where I shoul load to get succes?
I have NSA320s



Edited 1 time(s). Last edit at 01/14/2021 05:34AM by mervin.
Re: Bricked NSA320S during 2017.07 flash
January 14, 2021 04:42PM
mervin,

So you want to flash u-boot in serial console? is that correct? if it is, use an Ext3 USB.

Remove all USB drives except one with u-boot.kwb on it

usb start
ext2load usb 0:1 0x800000 uboot.kwb

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked NSA320S during 2017.07 flash
January 15, 2021 03:07AM
bodhi Wrote:
-------------------------------------------------------
> mervin,
>
> So you want to flash u-boot in serial console? is
> that correct? if it is, use an Ext3 USB.
>
> Remove all USB drives except one with u-boot.kwb
> on it
>
>
> usb start
> ext2load usb 0:1 0x800000 uboot.kwb
>
Yes, I need to flash uboot and flash new enviroments and set enviroments to boot from USB

thanks
Re: Bricked NSA320S during 2017.07 flash
January 15, 2021 01:53PM
Thats worked well. its booting now. I flashed uboot.2017.07-tld-1.nsa310s.mtd0.kwb

now I will need to flash uboot.2016.05-tld-1.environment.img

the right way it will be this
ext2load usb 0:1 0x800000 uboot.img
nand erase 0x00000 0x1000000
nand write 0x800000 0xc00000x100000

or this
ext2load usb 0:1 0x800000 uboot.img
nand erase 0x0 0x1000000
nand write 0x800000 0xc0000 0x20000
Re: Bricked NSA320S during 2017.07 flash
January 15, 2021 02:04PM
enki


Hi can you send me your env and uEnvs

Thanks



Edited 1 time(s). Last edit at 01/15/2021 03:07PM by mervin.
Re: Bricked NSA320S during 2017.07 flash
January 15, 2021 04:21PM
mervin,

No need to flash it. The internal envs are almost the same as the one in the envs image.

So reboot, interrupt serial console and

printenv

If it looks good (you can post them here for me to look over if you like to do that before the next command).

Execute saveenv to let u-boot flash it automatically:
saveenv

There was some typos in the internal envs, and some adjustment need for this box, so I need to show you where to do that. After saveenv, list them again

printenv

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked NSA320S during 2017.07 flash
January 16, 2021 08:22AM
here are envs before save
NSA3x0S> printenv 
arcNumber=4931
baudrate=115200
bootcmd=run init_sata_power; run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
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_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
console=ttyS0,115200
device=0:1
devices=usb
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-nsa310s.dtb
ethact=egiga0
ethaddr=52:3b:20:9c:11:51
if_netconsole=ping $serverip
init_sata_power=mw.l f1010104 c70e0ffd
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env)
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=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
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
usb_ready_retry=15

Environment size: 2938/131068 bytes
and here are envs after save
NSA3x0S> saveenv 
Saving Environment to NAND...
Erasing NAND...
Erasing at 0xc0000 -- 100% complete.
Writing to NAND... OK
NSA3x0S> printenv 
arcNumber=4931
baudrate=115200
bootcmd=run init_sata_power; run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
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_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
console=ttyS0,115200
device=0:1
devices=usb
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-nsa310s.dtb
ethact=egiga0
ethaddr=52:3b:20:9c:11:51
if_netconsole=ping $serverip
init_sata_power=mw.l f1010104 c70e0ffd
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env)
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=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
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
usb_ready_retry=15

Environment size: 2938/131068 bytes
Re: Bricked NSA320S during 2017.07 flash
January 16, 2021 08:40AM
I have make a changes to load both HDDs
SA3x0S> setenv init_sata_power 'mw.l f1010104 c70e0ffd'
NSA3x0S> setenv bootcmd 'run init_sata_power; run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset'
NSA3x0S> setenv devices usb
NSA3x0S> boot

I have attached terminal with debian boot, im getting error
[   13.798119][    T1] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   13.807043][    T1] CPU: 0 PID: 1 Comm: swapper Not tainted 5.2.9-kirkwood-tld-1 #1
[   13.814665][    T1] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[   13.821626][    T1] [<c010f6ac>] (unwind_backtrace) from [<c010bb00>] (show_stack+0x10/0x14)
[   13.830047][    T1] [<c010bb00>] (show_stack) from [<c0119fa0>] (panic+0xe0/0x30c)
[   13.837598][    T1] [<c0119fa0>] (panic) from [<c0e01628>] (mount_block_root+0x1bc/0x2a4)
[   13.845747][    T1] [<c0e01628>] (mount_block_root) from [<c0e017f8>] (mount_root+0xe8/0x154)
[   13.854240][    T1] [<c0e017f8>] (mount_root) from [<c0e019b0>] (prepare_namespace+0x14c/0x18c)
[   13.862905][    T1] [<c0e019b0>] (prepare_namespace) from [<c0e011c8>] (kernel_init_freeable+0x270/0x2dc)
[   13.872438][    T1] [<c0e011c8>] (kernel_init_freeable) from [<c09dcee0>] (kernel_init+0x8/0x10c)
[   13.881284][    T1] [<c09dcee0>] (kernel_init) from [<c01010e0>] (ret_from_fork+0x14/0x34)
[   13.889507][    T1] Exception stack(0xcf88bfb0 to 0xcf88bff8)
[   13.895230][    T1] bfa0:                                     00000000 00000000 00000000 00000000
[   13.904062][    T1] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   13.912900][    T1] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   13.920183][    T1] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---

USB is formated to ext4 and its set in fstab
Attachments:
open | download - term 15.1.3 (42.7 KB)
Re: Bricked NSA320S during 2017.07 flash
January 16, 2021 03:45PM
mervin,

This USB drive has some problem being initalized by u-boot. This happens rarely but does with some USB brand/model. This 2017.07-tld-1 u-boot has a patch to fix that. But it does not work for all cases. So use a different USB flash drive brand (such as SanDisk) to get around this issue.

> I have make a changes to load both HDDs

The boot log looks good. But you need to restore the original uImage because you are booting with the new u-boot.

Mount the HDD rootfs on another Linux box. Assuming it is mounted at /media/sdb1

cd /media/sdb1/boot
cp -a uImage uImage.nsa320s
cp -a uImage.orig uImage
sync

And then unmount, bring it back to the NSA320s and boot again.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked NSA320S during 2017.07 flash
January 16, 2021 05:45PM
USB drive is Kingston DataTraveler 2.0 (PMAP) with MBR

boot with uImage worked well, I got another error

[   14.270690][    T1] Run /init as init process
Loading, please wait...
Starting version 241
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
[   37.245123][    C0] random: crng init done
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
done.
Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  LABEL=rootfs does not exist.  Dropping to a shell!


BusyBox v1.30.1 (Debian 1:1.30.1-4) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) 
Attachments:
open | download - term 16.1.4 (19.5 KB)
Re: Bricked NSA320S during 2017.07 flash
January 16, 2021 06:04PM
mervin,

> USB drive is Kingston DataTraveler 2.0 (PMAP) with
> MBR

Not bad. But not great either.


Since you are booting with all 3 drives plugged in. Make sure that only the USB drive has the rootfs on it. And only it has partition label rootfs.

When you want to set up booting with HDD rootfs, then the attached USB cannot be the one that has rootfs on it.

To check for the partition label on another Linux box, you need to use command line. For example,
e2label /dev/sdb1
And the USB partition should be formatted using command line fdisk. If Ext4 is used, it must be "finalized" immediately, the default for Ext4 is lazy_init, which will not work for rootfs drive.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked NSA320S during 2017.07 flash
January 16, 2021 06:18PM
Tomorrow I will create new debian usb and make it to ext3.

Anyway what I have spotted that the network and front leds are not working and HDD is making clicking sound repeatedly

Thanks
Re: Bricked NSA320S during 2017.07 flash
January 18, 2021 04:37AM
hi
when I plug usb with EXT3 I got same results. but when I pulled out both HDDs, than debian booted without errors. today I will try to plug in EXT4 usb and see what it will hapen.
should I now upgrade debian to newest or just leave?
What is best app to get it running as NAS again? omv?
Re: Bricked NSA320S during 2017.07 flash
January 18, 2021 10:05AM
mervin Wrote:
-------------------------------------------------------
> hi
> when I plug usb with EXT3 I got same results. but
> when I pulled out both HDDs, than debian booted
> without errors. today I will try to plug in EXT4
> usb and see what it will hapen.
> should I now upgrade debian to newest or just
> leave?
> What is best app to get it running as NAS again?
> omv?

its working with EXT4 as well. I add a bootlog.

Its might hapened its debian instaled on one of HDDs. I got it with bad enviroments setup, I tryed something to work. and then was sitting of shelf for couple years
Attachments:
open | download - term 18.1.1 (22.1 KB)
Re: Bricked NSA320S during 2017.07 flash
January 18, 2021 11:03AM
When I put in Hdds in debian didn't boot up. But when I deleted apparitions of Hdds I got debian running. I'm starting thinking if its not easier to get debian running from hdd as from USB stick.
Re: Bricked NSA320S during 2017.07 flash
January 18, 2021 05:15PM
mervin,

> When I put in Hdds in debian didn't boot up. But
> when I deleted apparitions of Hdds I got debian
> running.

Exactly. The problem could be fixed by adjusting the partition label of the HDD rootfs to something other than rootfs. For example, sata_rootfs.

> I'm starting thinking if its not easier
> to get debian running from hdd as from USB stick.

When you want to boot with HDD, the u-boot env should be:

setenv devices 'ide usb'

or just
setenv devices 'ide'

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked NSA320S during 2017.07 flash
February 02, 2021 09:11AM
I was changing values in envs an I got to this
asus@asus-X51L:~/Plocha/nsa32s$ sudo kwboot -t -B 115200 /dev/ttyUSB0
[sudo] heslo pre používateľa asus:     
[Type Ctrl-\ + c to quit]
�

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:50:06 -0700)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server

SoC:   Kirkwood 88F6702_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Using egiga0 device
host 192.168.100.127 is alive
Using egiga0 device
host 192.168.100.127 is alive
Using egiga0 device
host 192.168.100.127 is alive
Using egiga0 device
host 192.168.100.127 is alive
Using egiga0 device
host 192.168.100.127 is alive
Uncompressing Linux... done, booting the kernel.

Error: invalid dtb and unrecognized/unsupported machine ID
  r1=0x00001343, r2=0x00000100
  r2[]=05 00 00 00 01 00 41 54 00 00 00 00 00 00 00 00
Available machine support:

ID (hex)	NAME
ffffffff	Generic DT based system
ffffffff	Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.
I try nc but no luck
nc -l -u -p 6666 &
nc -u 192.168.1.100 6666

I got this only:

asus@asus-X51L:~$ 
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:50:06 -0700)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server

envs
arcNumber=4931
baudrate=115200
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
console=ttyS0,115200
device=0:1
devices=usb
disks=0 1 2 3
ethact=egiga0
ethaddr=4c:9e:ff:0b:73:72
if_netconsole=ping $serverip
init_sata_power=mw.l f1010104 c70e0ffd
ipaddr=192.168.100.11
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
partition=nand0,2
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
serveip=192.168.100.127
serverip=192.168.100.127
stderr=serial
stdin=serial
stdout=serial
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
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
usb_ready_retry=15
dtb_file=/boot/dts/kirkwood-nsa320s.dtb
bootcmd_exec=run load_uimage; if run load_initrd; then if run load_dtb; then bootm   ; else bootm  ; fi; else if run load_dtb; then bootm  - ; else bootm ; fi; fi
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec
start_netconsole=setenv ncip ; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
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)
uenv_init_devices=echo Initializing devices...; setenv init_usb usb start;  setenv init_ide ide reset;  for devtype in ; do run init_; done
uenv_read=echo Loading envs from  ...; if load   :1  /boot/uEnv.txt; then setenv uenv_loaded 1; echo ... envs loaded; fi
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in ; do for disknum in ; do if test  -eq 0; then setenv device_type ; setenv disk_number ; run uenv_read; fi; done; done;
preboot_nc=setenv nc_ready 0; for pingstat in 1 2 3 4 5; do; sleep 1; if run if_netconsole; then setenv nc_ready 1; fi; done; if test  -eq 1; then run start_netconsole; fi
preboot=run preboot_nc
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10


dont know what to do to fixit :(
Re: Bricked NSA320S during 2017.07 flash
February 02, 2021 04:33PM
mervin,

You have serial console so you should not enable netconsole. It is expected to run on the box wih IP 192.168.100.127. Is this the box where you also run serial console?

But it is not a real problem. You can run 2 terminals on 192.168.100.127, one with serial console and one with netconsole. And then you will see that the output coming out alternately in both terminals.

> Error: invalid dtb and unrecognized/unsupported
> machine ID

This error is a conflict where the DTB was not loaded properly. It is easy to fix.

But first I want to see the complete u-boot log. So do either:

1. Run 2 terminals, 1 with serial console, 1 with netconsole.
Or
2. Change the IP of 192.168.100.127 to some other number so that the NSA320S will not see it is running. In this case, the serial console will have the complete log.

And please post the entire log here (or 2 logs if you chose to do number 1).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked NSA320S during 2017.07 flash
February 03, 2021 01:39PM
serial console with disconnected nc
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:50:06 -0700)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server

SoC:   Kirkwood 88F6702_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.100.127 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.100.127 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.100.127 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.100.127 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.100.127 is not alive
Uncompressing Linux... done, booting the kernel.

Error: invalid dtb and unrecognized/unsupported machine ID
  r1=0x00001343, r2=0x00000100
  r2[]=05 00 00 00 01 00 41 54 00 00 00 00 00 00 00 00
Available machine support:

ID (hex)	NAME
ffffffff	Generic DT based system
ffffffff	Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.

serial console with connected nc
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:50:06 -0700)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server

SoC:   Kirkwood 88F6702_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Using egiga0 device
host 192.168.100.127 is alive
Using egiga0 device
host 192.168.100.127 is alive
Using egiga0 device
host 192.168.100.127 is alive
Using egiga0 device
host 192.168.100.127 is alive
Using egiga0 device
host 192.168.100.127 is alive
Uncompressing Linux... done, booting the kernel.

Error: invalid dtb and unrecognized/unsupported machine ID
  r1=0x00001343, r2=0x00000100
  r2[]=05 00 00 00 01 00 41 54 00 00 00 00 00 00 00 00
Available machine support:

ID (hex)	NAME
ffffffff	Generic DT based system
ffffffff	Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.

in netconsole I didnt get anything

I dont get message to interupt serial console. its any way to reset enviroments?
Re: Bricked NSA320S during 2017.07 flash
February 03, 2021 04:10PM
mervin,

> I dont get message to interupt serial console. its
> any way to reset enviroments?

Since netconsole is activated in preboot, the input goes there. So you need 2 terminal approach to be able to interrupt u-boot at count down.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Bricked NSA320S during 2017.07 flash
February 14, 2021 06:56AM
Hi.
I managed to solve the problem with netconsole, was bit tuff because I was not geting output, but input was working, I was typing on blind but I get it running.
but I came across another problem, secon HDD making a clicking noise(initialising or something similar) every minute or so, when i dissable this then debian dont see it
init_sata_power 'mw.l f1010104 c70e0ffd'

its no other way to get 2 HDD working?
current envs
root@debian:~# fw_printenv
arcNumber=4931
baudrate=115200
bootcmd=run init_sata_power; run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; reset
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_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
console=ttyS0,115200
device=0:1
disks=0 1 2 3
ethact=egiga0
ethaddr=4c:9e:ff:0b:73:72
if_netconsole=ping $serverip
init_sata_power=mw.l f1010104 c70e0ffd
ipaddr=192.168.100.11
led_error=orange blinking
led_exit=green off
led_init=green blinking
load_dtb=echo loading DTB $dtb_file ...; load $bootdev $device $load_dtb_addr $dtb_file
load_dtb_addr=0x1c00000
load_initrd=echo loading uInitrd ...; load $bootdev $device $load_initrd_addr /boot/uInitrd
load_initrd_addr=0x1100000
load_uimage=echo loading uImage ...; load $bootdev $device $load_uimage_addr /boot/uImage
load_uimage_addr=0x800000
mainlineLinux=yes
mtdids=nand0=orion_nand
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)
partition=nand0,2
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.100.127
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10
uenv_addr=0x810000
uenv_import=echo importing envs ...; env import -t $uenv_addr $filesize
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
usb_ready_retry=15
devices=ide
dtb_file=/boot/dts/kirkwood-nsa320s.dtb
stdout=serial
stdin=serial
stderr=serial
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=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 $uenv_addr /boot/uEnv.txt; then setenv uenv_loaded 1; fi
preboot_nc=run if_netconsole start_netconsole
start_netconsole=setenv ncip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
Re: Bricked NSA320S during 2017.07 flash
February 14, 2021 04:23PM
mervin,

> but I came across another problem, secon HDD
> making a clicking noise(initialising or something
> similar) every minute or so, when i dissable this
> then debian dont see it

I thought we've solved this, so never look back.


Quote


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

Updated 23 Aug 2020:

Kernel linux-5.8.3-kirkwood-tld-1 package has been uploaded. The following features were added/updated:

- BFQ IO Scheduler is now the default in the kernel. This is an improvement in making the system more responsive when under memory stress (Note: use a large swap space to avoid OOM killer).
- Added ISCSI Target capability (as loadable module).
- Updated Zyxel NSA320S capabilty to bring up 3.5" HDD in 2nd slot.

I'll take a look to see if somehow the DTS was at the older version. But try to plug in a 2.5" HDD at the 2nd slot to see if everything is OK.

-bodhi
===========================
Forum Wiki
bodhi's corner
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: