Welcome! Log In Create A New Profile

Advanced

Zyxel NAS326 - Debian / Boot from USB?

Posted by Kirsch 
Re: Zyxel NAS326 - Debian / Boot from USB?
March 15, 2017 04:46AM
Yes it's amber ... (Kernel 4.9, 4.10 and now 4.11 rc2)
Re: Zyxel NAS326 - Debian / Boot from USB?
March 15, 2017 05:25AM
Hey pengu :) thanks for the report.

I'm testing kernel 4.10. I can't seem to find the LED green setting in the GPL source. When ethernet is running Gbits, the green LED should be set. But that's a minor inconvenience for not being able tell by looking at the port.

The reason I'm looking for it is: a lot of time, the interrupt line is on the green LED (crazy I know :).

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Zyxel NAS326 - Debian / Boot from USB?
March 15, 2017 07:14PM
Re: Zyxel NAS326 - Debian / Boot from USB?
March 16, 2017 05:58AM
YES it's based on your config as my kirkwood kernel builds were too.

The patch can still be applied without failures
I think its usable but ... see below.

The file attached is diff between your config and the one I'm using now.

[Edit]

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.0 (stretch)
Release:	9.0
Codename:	stretch

[    0.000000] Linux version 4.10.3-rm-1 (root@debiannas326) (gcc version 6.3.0 20170205 (Debian 6.3.0-6) ) #1 SMP Fri Mar 17 19:13:20 CET 2017
[    0.000000] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: Zyxel NAS326

I've got some connection issues with NFS .. perhaps it's gone now ...



Edited 3 time(s). Last edit at 03/17/2017 06:11PM by pengu.
Attachments:
open | download - changes.txt (39.6 KB)
Re: Zyxel NAS326 - Debian / Boot from USB?
March 19, 2017 03:40AM
I've been booting succesfully from USB key attached to front port. Unfortunately I'm not able to boot into stock mode, once pulling out the USB key, NAS326 just keeps continously beeping. I have not connected the serial cable, as I installed with the USB option. Should I do that or is it safe to try something else? I'm a bit scared changing (back) the uboot env's to stock mode. Below my envs for booting and information about mtd's. One is with a bad block.
Quote

curr_bootfrom=1
next_bootfrom=1
load_dtb_addr=0x1000000
load_image_addr=0x02000000
load_initrd_addr=0x2900000
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial init=/bin/systemd"
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/zImage; ext2load usb 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr
bootcmd_custom=if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
kernel_addr_1=0x00000000; run bootcmd_custom;
change_boot_part=1

bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2) earlyprintk=serial init=/bin/systemd
kernel_addr=${kernel_addr_1}
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)

I have a bad block on /dev/mtd4.
Quote

nandtest /dev/mtd4
ECC corrections: 0
ECC failures : 0
Bad blocks : 1
BBT blocks : 0
00740000: reading...
1 bit(s) ECC corrected at 00740000
02900000: reading...
2 bit(s) ECC corrected at 02900000
Bad block at 0x04120000
069e0000: checking...
Finished pass 1 successfully

Should I try to reflash /dev/mtd3-6? There are some instruction to use the "Usb key func.sh" for firmware upgrade, but unfortunately this won't boot either. NAS box keeps beeping, if even the "Usb key func.sh" key has be inserted into front port.
Re: Zyxel NAS326 - Debian / Boot from USB?
March 19, 2017 04:11AM
nielsek,

> Should I do that or is it safe to t
> ry something else? I'm a bit scared changing (bac
> k) the uboot env's to stock mode. Below my envs f
> or booting and information about mtd's. One is wi
> th a bad block.

You are right to be careful. No, it is not safe to change u-boot envs to something else if you don't have serial console, because if it does not work, you will have to wait until you install serial console to recover.

The bad block on mtd4 could be the problem. It is the rootfs for kernel 1, which is the option that I set to boot when the USB is not plugged in.So since you can still boot with USB as in normal operation, I would stay with that for now.

I will try the kernel 2 as the fallback and see if perhaps we can use that. After I've tested it, I will let you know.

All that said, connecting serial console is always a great idea. It gives you a lot of latitude in playing with u-boot envs. The NAS326 is quite easy to connect serial console, the header is factory built. All you'd need is the serial module converter (see here in case you are looking), and some wires long enough to route them out through the hole in the back.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Zyxel NAS326 - Debian / Boot from USB?
March 19, 2017 06:19AM
I have used standard pl2303 usb/serial converter with Dockstar and GoFlex. It should work also for NAS326?
Re: Zyxel NAS326 - Debian / Boot from USB?
March 19, 2017 06:54AM
nielsek,

Yes it will work the same way whether it's Dockstar, GoFlex, or Zyxel.

Here is the layout. This header has a unique layout where the missing pin (2nd from right) can be used as the reference point .

Zyxel NAS326 Serial Pinouts (same as NSA325 and NSA310S/320S)

GND  
RX 
TX 

          +----+----+           
          |    |    |
+----+----+----+----+----+
|3.3V| TX | RX |    | GND|
+----+----+----+    +----+

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 03/19/2017 06:56AM by bodhi.
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: