The Zyxel NSA310, NSA310b, NSA310s, NSA320, NSA325 is a Kirkwood based NAS (aka Network Attached Storage) with one HDD bay using SATA.

ModelVersionSoCCPU MHzCPU CoresFlash MBRAM MBWLAN HardwareWLAN2.4WLAN5.0100M portsGbit portsModemSATA portsUSB
NSA310Marvell 88F628112001128256----1-22x 2.0
NSA310SMarvell 88F670210001128NAND256----1-12x 2.0
NSA325v1, v2Marvell 88F628216001128512---1-22x 2.0, 1x 3.0
* - * * *
Serial connection parameters 3.3V, 115200 Baud

This chapter is based on Doozan Forum
:!: Carefully choose the correct U-Boot for your hardware version otherwise you brick the hardware!

NSA310 uboot.2017.07-tld-1.nsa310.bodhi.tar OpenWrt Image NSA310b working
NSA310b u-boot-nsa310/u-boot.kwb
(Link above in the OpenWrt binaries)
OpenWrt Image NSA310b working
NSA310s uboot.2017.07-tld-1.nsa310s.bodhi.tar OpenWrt Image NSA325 working (without buttons & LEDs)
NSA320uboot.2017.07-tld-1.nsa320.bodhi.tar Not supported by OpenWrt
NSA325uboot.2017.07-tld-1.nsa325.bodhi.tar OpenWrt Image NSA325 working

Copy the u-boot.kwb and -factory.bin files to a FAT32 formatted USB stick with msdos partition table (single partition). Rename the -factory.bin to something simple like nsa310.bin.

:!: u-boot are also available in more up to date versions from the OpenWRT snapshot daily built !

This chapter is based on a post in the Doozan Forum.

  • Connect the USB to Serial converter (3.3V not 5V!) to the pins of the NSA3xx main board (Tx → Rx; Rx ← Tx; GND → GND).
  • Boot the stock firmware and access the NSA3xx through the serial interface
  • Check the Ethernet MAC Address and note it
  fw_printenv ethaddr
  • save the environment variables
  fw_printenv > current_envs.txt
  blparam >  current_envs.txt
  • Check bad blocks in NAND

:!: Be sure there is no bad block in the first 1M of your NAND (check dmesg). This is very important, if there is bad block in the first 1M (8 blocks), don't flash u-boot, because you will almost certainly brick your box. Please post your question here (there is a work around for it).

  dmesg | grep -i 'bad'
    [    2.413231] Scanning device for bad blocks
    [    2.417731] Bad eraseblock 3 at 0x000000060000

This bad block is the 4th block which resides within mtd0 (block 0 to block 7). So u-boot should not be flashed.

Overview for advanced users (git commit)

Basically we command the device through a terminal (using the serial interface) to load and flash our files to NAND.

:!: Please note that to write to NAND you have to erase the NAND first, which means all data on the NAND will be deleted! Meaning stock firmware, bootloader, settings and everything will be gone! So make sure you got the proper files ready before you start as it's vital that you flash the new bootloader before you restart your device as it would otherwise get soft-bricked.

Plug in the USB stick into the NAS (front USB) with the correct files and booting into u-boot (press any key on the serial communication to interrupt the boot progress).
The first step is to install OpenWrt's u-boot. Therefor send those commands in the U-Boot command line:

NSA310>>usb reset
(Re)start USB...
  USB:   scanning bus for devices... 3 USB Device(s) found
  scanning bus for storage devices... 1 Storage Device(s) found
NSA310>>fatload usb 0 0x1000000 u-boot.kwb
  reading u-boot.kwb
  524288 bytes read
NSA310>>nand erase 0x0 0x100000
  Erasing at 0xe0000 -- 100% complete.
NSA310>>nand write 0x1000000 0x00000 $filesize
  1048576 bytes written: OK

In case you get below error message please use Setting up a TFTP server for TFTP Recovery/Install to load the files. IP configuration described serial-install-problems-on-nsa310. However this has not been tested successfully yet

NSA310>>usb reset
  USB:   scanning bus for devices... 1 USB Device(s) found
  scanning bus for storage devices... 0 Storage Device(s) found
NSA310>> fatload usb 1 0x1000000 u-boot.kwb
** Can't read from device 1 **
** Unable to use usb 1:1 for fatload **
NSA310>> fatload usb 0 0x1000000 u-boot.kwb
** Can't read from device 0 **
** Unable to use usb 0:1 for fatload **

Install NSA310
:!: The uboot CANNOT use network (tftp) on nsa310 as it has an external network chip and bodhi (he made the uboot also OpenWrt uses) never fixed that. Openwrt can use the network chip so this is a problem only when installing the first time and you are using uboot.

:!: You may need to try a few times, and from true power off state.Disconnect power from nsa310, press power button for 5 seconds (to make sure everything is discharged and power is off)

NSA310>> ide reset
Reset IDE: 
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
  Device 0 @ 0 0:
Model: xxxxx                           Firm: xxx  Ser#: xxx        
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)
NSA310>> fatload ide 0 0x1000000 uboot.kwb
reading uboot.kwb
524288 bytes read
NSA310>> nand erase 0x0 0x100000
NAND erase: device 0 offset 0x0, size 0x100000
Erasing at 0xe0000 -- 100% complete.
NSA310>> nand write 0x1000000 0x00000 $filesize
NAND write: device 0 offset 0x0, size 0x100000
 1048576 bytes written: OK
NSA310>> reset

After the device reboots into the OpenWrt u-boot we adjust the device's MAC address (adjust the values, see the sticker under the NAS case):

NSA310>>setenv ethaddr AB:CD:EF:00:00:00
  Address in SROM is         AB:CD:EF:00:00:00
  Address in environment is  AB:CD:EF:00:11:11
  Saving Environment to NAND...
  Erasing NAND...
  Erasing at 0xc0000 -- 100% complete.
  Writing to NAND... OK

Now we set the correct environment variables

NSA310>>setenv mtdparts 'mtdparts=orion_nand:0x00c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)'
NSA310>>setenv bootcmd 'run setenv bootargs; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000'
  Saving Environment to NAND...
  Erasing NAND...
  Erasing at 0xc0000 -- 100% complete.
  Writing to NAND... OK
  resetting ...

Then we proceed to flashing OpenWrt itself (which we called nsa310.bin for less typing):

NSA310>>usb reset
  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
NSA310>>fatload usb 0 0x2000000 nsa310.bin
  reading openwrt.bin
  4063232 bytes read in 210 ms (18.5 MiB/s)
NSA310>>nand erase.part ubi
 NAND erase.part: device 0 offset 0x140000, size 0x7ec0000
  Skipping bad block at  0x00540000
  Skipping bad block at  0x05580000
  Skipping bad block at  0x06120000
  Skipping bad block at  0x06aa0000
  Erasing at 0x7fe0000 -- 100% complete.
NSA310>>nand write 0x2000000 ubi $filesize
  NAND write: device 0 offset 0x140000, size 0x600000
  Skip bad block 0x00540000
  6291456 bytes written: OK

Note that the number at the end indicates the size to write in hex. In this case up to 6 MiB. Increasing this number should work but has not been tested.

And now we reboot to OpenWrt:


hardware.button on howto use and configure the hardware button(s). Here, we merely name the buttons, so we can use them in the above Howto.

The device has the following buttons:

Power power
Reset reset
Copy copy

This is a NSA310

This is for a NSA310S

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2021/02/24 17:58
  • by danitool