Welcome! Log In Create A New Profile

Advanced

NSA320 installation questions

Posted by mrmazak 
mrmazak
NSA320 installation questions
November 08, 2020 11:57AM
Having trouble finding where to begin.
I have stock u-boot NSA-320
Tried to do simple install from USB stick as described on ArchLinux. Not that I wanted arch, i just didn't search long enough to find this group here.

Of course as I have seen mentioned couple of times in this forum since i made that mistake, that I was not supposed to use the Latest rootfs as the link on ArchLinux says.
So i was stuck with all the Nas lights on and nobody home (so to speak)

Was able to use mincom from connected rpito command "run to_stock" to get back to start point.

When I use kwboot to boot the recommended u-boot(uboot.2017.07-tld-1.nsa320.mtd0.kwb -p), system halts after 100% load.

I have since followed the steps in this thread and created rootfs on a usb stick, loaded with "Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2" but since I do not know how to get the U-boot to boot, i have been stuck.



Edited 1 time(s). Last edit at 11/08/2020 03:59PM by bodhi.
Re: Linux Kernel 5.9.3 Kirkwood package and Debian rootfs
November 08, 2020 12:06PM
these outputs are from stock u-boot. Unless the install script from archlinux instaal modified it. The scripts do not look like the were supposed to have though.

printenv output

del.dog/irepebogym.txt

boot console output if needed.

console output

more logs to come. but i did find other kwboot to use. For arm since i am runninng on a PI. this one DID get me to a boot from new uboot.

now need to modify the (undo) step 4 from rootfs, hope i can get there myself. but will deffinately raise a flag if i hit dead end again./

kwboot used



Edited 4 time(s). Last edit at 11/08/2020 02:33PM by mrmazak.
Re: Linux Kernel 5.9.3 Kirkwood package and Debian rootfs
November 08, 2020 04:15PM
mrmazak,

> printenv output
>
> del.dog/irepebogym.txt
>
> boot console output if needed.
>
> console
> output

>

Please post the log inside your post, or attach the log to your post.

Regarding kwboot for this NSA320, you can use any kwboot binary. Don't use patched version. The one in your Linux host (whatever it is) is good enough.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320 installation questions
November 08, 2020 04:30PM
Alright, so I need to search for distribution of kwboot from apt-get. Did not know that was an option.


current console output from kwboot, When I halt to autoboot, prinenv, then command a boot, the Nas tries to boot from my USB loaded with rootfs ( I may have it wrong) reboots back to installed uboot not the kwbooted one, then continues to boot to stock system.

here is log.



pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# cd Downloads/kwboot-2016.05
root@raspberrypi:/home/pi/Downloads/kwboot-2016.05# ./kwboot -t -B  115200 /dev/ttyS0 -b uboot.2017.07-tld-1.nsa320.mtd0.kwb -p
Sending boot message. Please reboot the target...\
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [..........
 97 % [......................................................................]
 99 % [....................................]
[Type Ctrl-\ + c to quit]


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700)
ZyXEL NSA320 2-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
NSA320> printenv
arcNumber=3956
baudrate=115200
bootcmd=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=console=ttyS0,115200
device=0:1
devices=usb ide
disks=0 1 2 3
dtb_file=/boot/dts/kirkwood-nsa320.dtb
ethact=egiga0
ethaddr=52:3b:20:9c:11:51
if_netconsole=ping $serverip
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(stock_uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)
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: 3016/131068 bytes
NSA320> 

NSA320> boot
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 
Use USB retry period from the environment: 15 second(s)
CACHE: Misaligned operation at range [1ffba0e4, 1ffba900]
CACHE: Misaligned operation at range [1ffba0e4, 1ffba900]
** First descriptor is NOT a primary desc on 0:1 **
1 Storage Device(s) found

Reset IDE: Bus 0: ......OK Bus 1: not available  
  Device 0: Model: WDC WD2000JS-60NCB1  Firm: 10.02E02 Ser#:  WD-WCANL2054052
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 190782.2 MB = 186.3 GB (390721968 x 512)
## 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

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** No partition table - usb 0 **

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

Part	Start Sector	Num Sectors	UUID		Type
  1	63        	1028097   	5c034f75-01	83
  2	1028160   	389688705 	5c034f75-02	20
running scan_disk ...
Scan device usb
device usb 0:1
** No partition table - usb 0 **
device usb 1:1
** Bad device usb 1 **
device usb 2:1
** Bad device usb 2 **
device usb 3:1
** Bad device usb 3 **
Scan device ide

Reset IDE: Bus 0: OK Bus 1: not available  
  Device 0: Model: WDC WD2000JS-60NCB1  Firm: 10.02E02 Ser#:  WD-WCANL2054052
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 190782.2 MB = 186.3 GB (390721968 x 512)
device ide 0:1
***********************************************************************
******REMOVED LARGE CHUCK OF UNNEEDED LOG*******
***********************************************************************

=======
Moderator edit: please use code tags (the Formatted Code button above your text edit box) to post log.



Edited 2 time(s). Last edit at 11/08/2020 07:07PM by mrmazak.
Re: NSA320 installation questions
November 08, 2020 05:01PM
mrmazak,

Your USB drive was not preprared properly.

Quote

Use USB retry period from the environment: 15 second(s)
CACHE: Misaligned operation at range [1ffba0e4, 1ffba900]
CACHE: Misaligned operation at range [1ffba0e4, 1ffba900]
** First descriptor is NOT a primary desc on 0:1 **
1 Storage Device(s) found

So eventhough you thought the rootfs is OK. It is not.

You should use fdisk on the rPi to wipe the disk clean, recreate a single partition with Ext3, untar the rootfs while being root. And you're correct to skip step 4.

Try again. If the above errors stil appear, we'll go from there. This time I only need to see the u-boot part of the log.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320 installation questions
November 08, 2020 07:04PM
Now I am at debian log-in.



U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:46:11 -0700)
ZyXEL NSA320 2-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found

Reset IDE: Bus 0: ......OK Bus 1: not available  
  Device 0: Model: WDC WD2000JS-60NCB1  Firm: 10.02E02 Ser#:  WD-WCANL2054052
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 190782.2 MB = 186.3 GB (390721968 x 512)

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

Part	Start Sector	Num Sectors	UUID		Type
  1	2048      	15382528  	bc136247-01	83

## 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

## Unknown partition table type 0
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **

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

Part	Start Sector	Num Sectors	UUID		Type
  1	63        	1028097   	5c034f75-01	08
  2	1028160   	389688705 	5c034f75-02	20
running scan_disk ...
Scan device usb
device usb 0:1
1 bytes read in 692 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
4963680 bytes read in 1106 ms (4.3 MiB/s)
loading uInitrd ...
9713936 bytes read in 1145 ms (8.1 MiB/s)
loading DTB /boot/dts/kirkwood-nsa320.dtb ...
13153 bytes read in 2721 ms (3.9 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-5.2.9-kirkwood-tld-1
   Created:      2019-08-25   2:22:31 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4963616 Bytes = 4.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-5.2.9-kirkwood-tld-1
   Created:      2019-08-25   2:22:50 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9713872 Bytes = 9.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000
   Loading Kernel Image ... OK
   Loading Ramdisk to 0f6bc000, end 0ffff8d0 ... OK
   Loading Device Tree to 0f6b5000, end 0f6bb360 ... OK

Starting kernel ...

from here.. The next thing is flash the u-Boot ?
Re: NSA320 installation questions
November 08, 2020 07:20PM
mrmazak,

Execellent! log in as root/root. And flash the new u-boot image and its envs image. Since you have serial console, dont set up netconsole.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320 installation questions
November 08, 2020 08:13PM
some differences in /proc/mtd. is it need to change. Guide says
mtd0: 00100000 00020000 "u-boot"


Without changes made mine says
mtd0: 00100000 00020000 "uboot"

does that name need changed?



Step 5 of u-boot flash guide say to extract the archive. to /tmp.
I must have missed the step of transfering the uboot to the rootfs.

i ended up useing scp to push files to /tmp.

flashed u-boot. and env, rebooted seems to be running.


Now for the questions i should have asked before i started.
This is on a nas device, so shareing files is the main reason for it. Is samba here already or do i need to build the server now?



Edited 2 time(s). Last edit at 11/08/2020 09:45PM by mrmazak.
Re: NSA320 installation questions
November 09, 2020 07:43AM
Power button

Reset button

Lights


None seem to respond. Need to use ssh or console to command halt.

I found some thread that mentions editing an *.rc file , to make lights and buttons to work. From "nsa325" to "nsa320" .

Don't know if there is other configs that need to be tweaked.

Will booting from the usb rootfs, cause thumb drive to fail in short time?
Re: NSA320 installation questions
November 09, 2020 04:41PM
Quote

This is on a nas device, so shareing files is the main reason for it. Is samba here already or do i need to build the server now?

This rootfs is a basic rootfs, only necessary packages have been installed.

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

Basic Debian buster Kirkwood rootfs for most Kirwood plugs:

- tarball size: 209M
- install size: 536M
- The init system used in this rootfs is sysvinit . To boot with systemd, see note 2 below.
- Installed packages: nano, avahi, ntp, busybox-syslogd (log to RAM), htop, isc-dhcp-client, dialog, bzip2, nfs server/client, iperf, ethtool, sysvinit-core, sysvinit, sysvinit-utils, u-boot-tools, and mtd-utils.
- see LED controls in /etc/rc.local, and /etc/init.d/halt
- see some useful aliases in /root/.profile
- root password: root

See how LEDS are controlled as described above.

And see the Wiki thread for how to set up buttons and Samba:

Quote
https://forum.doozan.com/read.php?2,23630
Key daemon (button control)

Multimedia keyboard daemon for Linux
How to use set up button to reboot or shutdown with Key Daemon (esekeyd)

Samba

Samba smb.conf for a simple set up
HowTo setup Samba/CIFS shares



So you can see it is a barebone system. The intention is to provide a fully functional Debian Linux system with minimal size. Users will need to get their hands dirty in setting it up the way they like (unlike the rPi, for example, which provides a heavy rootfs with all packages they think users need). I recall rPi also provides a basic rootfs too, for users who like to do their own setups.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320 installation questions
November 09, 2020 10:27PM
Thanks.

I had the leds working, but still needed a clue for the power button.

I have a very simple halt now when tap button. I saw the example with >< 2sec triggers and flashing blue light. Wow ok anything you want, you just need to code it. Great.
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: