Welcome! Log In Create A New Profile


Zyxel NSA 325

Posted by Thiefrainb0w 
Zyxel NSA 325
May 02, 2021 02:49PM

Since a few months I have been passing up this task to get OpenWRT onto the Zyxel. I followed their instructions only to find that the installed version of u-boot (1.1.4) would not recognize any flash drive, hdd or network attempt to get OpenWrt last U-boot onto it.

I tried following the instructions here but I am too overwhelmed, so sorry if I ask stupid questions. Someone told me to take a look at kwboot but I have no clue how to use it.

I tried "kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot.kwb -p" but am getting an xmodem protocol error back.

If that works from that uboot version I should be able to flash uboot to nand and after that openwrt?

edit: I just tried to get into the telnet backdoor, is that of any help?

Edited 1 time(s). Last edit at 05/02/2021 03:41PM by Thiefrainb0w.
Re: Zyxel NSA 325
May 02, 2021 03:59PM

See these tutorials in the Wiki thread



Rescue Systems

Rescue System V4, using a custom LEDE firmware (BETA)
Rescue System for Pogo E02 using LEDE/OpenWrt (Install with Serial Console)
Rescue System for Pogo V4/Mobile using OpenWrt (Install with NetConsole)

OpenWrt installation for the Zyxel NSA325 is similar to these 3 threads. Especially the Pogo E02.

Forum Wiki
bodhi's corner

Edited 1 time(s). Last edit at 05/02/2021 04:00PM by bodhi.
Re: Zyxel NSA 325
May 02, 2021 08:53PM
Not sure why if you're trying to install OpenWrt you don't make use of the OpenWrt wiki page for the ZyXEL NSA325.
Re: Zyxel NSA 325
May 03, 2021 06:39AM
Thanks for the hints, first time flashing something that isn't an Android.

I semi followed this https://forum.doozan.com/read.php?4,100764,101409#msg-101409

Using Telnet I am now in the NSA325, got a FAT flash mounted that has openwrt u-boot.kwb and the openwrt.bin fpr nsa325 and U-boot flashing utilities unpacked in /tmp/tools

From another not to recent thread it seems openwrt u-boot already contains the needed environments https://forum.doozan.com/read.php?3,119919,119939#msg-119939

These are the first outputs and I guess it looks good to go. I should be ok with the bad blocks right?

cat /proc/mtd

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"


/tmp/tools # fw_printenv
Warning: Bad CRC, using default environment
bootargs=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
bootcmd=nand read.e 0x2000000 $(kernel_addr) 0xA00000; bootm 0x2000000
VENDOR_NAME=ZyXEL Communications Corp.

/tmp/tools # dmesg | grep -i bad
Scanning device for bad blocks
Bad eraseblock 100 at 0x000000c80000
Bad eraseblock 200 at 0x000001900000

Next step would be:

# Install U-Boot

/tmp # ./tools/flash_erase /dev/mtd0 0 4
/tmp # ./tools/nandwrite -p /dev/mtd0 u-boot.kwb

After this I could stick to the openwrt guide: (https://openwrt.org/toh/zyxel/nsa325)

./tools/fw_setenv mtdparts 'mtdparts=orion_nand:0x00c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)'
./tools/fw_setenv bootcmd 'run setenv bootargs; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000'

After that exit and reboot and hope I see a new u-boot and read from usb to flash openwrt.bin with fatload

moderator edit: please use code tags for commands and logs

Edited 4 time(s). Last edit at 05/03/2021 05:21PM by bodhi.
Re: Zyxel NSA 325
May 03, 2021 08:25AM
Just gave it a shot, and I'm in new U-boot! I had to use the padding flag while using nandwrite.

This is what serial console gave out after reboot

U-Boot 2018.03 (Nov 11 2020 - 20:09:58 +0000)
ZyXEL NSA325 2-Bay Power Media Server

SoC: Kirkwood 88F6282_A1
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: 128 MiB
Loading Environment from NAND... OK
In: serial
Out: serial
Err: serial
Net: egiga0
Error: egiga0 address not set.

MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot: 0

I can find flash memory now but trying to read from it gives me 'Bad device' error
Re: Zyxel NSA 325
May 03, 2021 05:37PM

> U-Boot 2018.03 (Nov 11 2020 - 20:09:58 +0000)
> ZyXEL NSA325 2-Bay Power Media Server

> Hit any key to stop autoboot: 0

Get the listing of the envs here, it might not have enough to allow you to read.

And post what you've tried. Basically, the entire serial console log until the error.

Forum Wiki
bodhi's corner
Re: Zyxel NSA 325
May 04, 2021 01:17PM
Got OpenWrt flashed and booting. Using fatls command mounted the device first I think and then made it readable.

From there I flashed openwrt.bin to nand, a little fighting with setenv got it to boot on its own without serial commands.

Thanks for the initial links you posted. By chance, do you know if wake on lan has to be set in u-boot? Most docs I find are more centered to sending wol packages to other hosts, but not the openwrt box itself.
Re: Zyxel NSA 325
May 06, 2021 03:39AM

> do you know if wake on lan has to be set
> in u-boot?

Not in u-boot. For this box, WOL must be controlled using i2c command. The i2c command can be executed in Linux.

In the Wiki thread we have WOL i2c command for Zyxel NAS326. But the NSA325 WOL i2c command has not been found yet.



Sensors & Fan & WOL

OWFSPlug : 1-Wire File System + Motion Detection Software in a NAND Package
OWFS & Motion Detection (external link)
How to control GPIO in Linux userspace for GPIO-enable fan
Zyxel NSA 310S/320S/325/326 CPU Temperature and Fan Speed reading
Zyxel NAS326 WOL
Zyxel NAS326 Auto-Power Up
Zyxel NAS326 WOL and Auto-Power Up I2C commands
Zyxel NSA320 Auto-Power Up

Forum Wiki
bodhi's corner

Your Email:


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.