Serial install problems on NSA310

@fialot: I did a first shot for an official support of ZyXEL NSA310s. Would you contribute and do/test changes on your hardware, as neither @bobafetthotmail nor myself have a NSA310s at home?

Hello,

I would like to install openwrt on my old 310 (without any letter). I have problem with USB - someday when i try to plug in my printer usb cable, something happen (i dont how exactly what and how), and now my usb doesn't work and USB LED on front panel after system boot lights always on red. When i connect to it via serial ports and boot system I get:

usb 1-1: new high speed USB device using ehci_marvell and address 2
usb 1-1: device descriptor read/64, error -71
....
usb 1-1: device descriptor read/64, error -71
In hub_port_init, and number is 0, retry 1, port 1 .....
usb 1-1: new high speed USB device using ehci_marvell and address 4
usb 1-1: device not accepting address 4, error -71
In hub_port_init, and number is 0, retry 2, port 1 .....
usb 1-1: new high speed USB device using ehci_marvell and address 5
usb 1-1: device not accepting address 5, error -71
In hub_port_init, and number is 0, retry 3, port 1 .....
hub 1-0:1.0: unable to enumerate USB device on port 1

First time usb start command:

NSA310>> usb start
(Re)start USB...
USB:   scanning bus for devices... 
      USB device not responding, giving up (status=20)
2 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found

Second time:


NSA310>> usb start
(Re)start USB...
USB:   scanning bus for devices... 1 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found

Can I fix in any way my USB?

The major question is: Can I install openwrt without access to USB, but via tftp? Anyone use this method with success? There is any chance that USB will work on openwrt, or it is hardware problem?

I wanna to switch on openwrt, because of smbv1 on nas and problems that i have to access files on nas via my linux desktop.

What version of uboot do you have ?
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.

Here is output of serial:

U-Boot 1.1.4 (Feb 22 2011 - 10:31:35) Marvell version: 3.4.19

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFEE0

Soc: 88F6281 A1 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz 

md ff00003c shows 121, so i think i can use it.

I read this topic and try workaround describe by bobafetthotmail

Following by https://openwrt.org/toh/zyxel/nsa310b in flash section, I change usb to ide. I download proper uboot file for my 310. Everything in terminal looks like in tutorial:

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: CT120BX300SSD1                           Firm: M2CR010  Ser#: 1743E10589E1        
            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.
OK
NSA310>> nand write 0x1000000 0x00000 0x100000

NAND write: device 0 offset 0x0, size 0x100000
 1048576 bytes written: OK
NSA310>> reset

But after reset only leds light orange, and serial is blank... Did I brick my 310? I tried:

But have only error:

$ sudo ./kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot.kwb -p
Sending boot message. Please reboot the target...|
Sending boot image...
  0 % [+xmodem: Bad message

So now its trash?

kwboot should work, but 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),

then sending kwboot command from console and see that the bar is spinning
then connecting power and then power up the nsa310 with button.

Also since you say that the USB was killed, please make sure there is no short circuit in the USB port , check that both ports (front and back) contacts look fine, if it is still shorted it can be a problem for kwboot (and in general can cause other problems)

You are genius! 310 starts boot. So whats now? What I did wrong?

Note that I'm starting from stock V4.70(AFK.3)

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:54:15 -0700)
ZyXEL NSA310 1-Bay Power Media Server 


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

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80a88
unable to get device descriptor (error=-1) retry: 5
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80a88
unable to get device descriptor (error=-1) retry: 4
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80a88
unable to get device descriptor (error=-1) retry: 3
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80a88
unable to get device descriptor (error=-1) retry: 2
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80a88
unable to get device descriptor (error=-1) retry: 1
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80a88
unable to get device descriptor (error=-1) retry: 0
1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Reset IDE: ide_preinit failed
## 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 ...
** Bad device usb 0 **

no IDE devices available
running scan_disk ...
Scan device usb
device usb 0:1
** Bad device 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: ide_preinit failed
device ide 0:1
** Bad device ide 0 **
device ide 1:1
** Bad device ide 1 **
device ide 2:1
** Bad device ide 2 **
device ide 3:1
** Bad device ide 3 **
loading uImage ...
** Bad device usb 0 **
loading uInitrd ...
** Bad device usb 0 **
loading DTB /boot/dts/kirkwood-nsa310.dtb ...
** Bad device usb 0 **
Unknown command 'bootm0x800000' - try 'help'
resetting ...


The commands you posted seem correct. Maybe you used the wrong uboot file? You must use the same uboot.kwb that works with kwboot.

If you use the uboot from OpenWrt it's faster to install OpenWrt (as it is already configured to boot openWrt), but as the warnings in the OpenWrt NSA310 page say you need to take the uboot from snapshot download folders, here https://downloads.openwrt.org/snapshots/targets/kirkwood/generic/u-boot-nsa310/

The uboot you posted now is bodhi's uboot. If you install that, you will need to change some configuration to boot OpenWrt too, but it can also boot Debian Linux (from bodhi's forum).

Does not matter. Everything will be erased.

The commands you posted seem correct. Maybe you used the wrong uboot file? You must use the same uboot.kwb that works with kwboot.

anyway, since you are using kwboot, if the tutorial still does not work, you can try differently

setenv mtdparts 'mtdparts=orion_nand:0x00c0000(uboot)
nand erase uboot
nand write 0x1000000 uboot
reset

If you use the uboot from OpenWrt it's faster to install OpenWrt (as it is already configured to boot openWrt), but as the warnings in the OpenWrt NSA310 page say you need to take the uboot from snapshot download folders, here https://downloads.openwrt.org/snapshots/targets/kirkwood/generic/u-boot-nsa310/

The uboot you posted now is bodhi's uboot. If you install that, you will need to change some configuration to boot OpenWrt too, as in the tutorial on the wiki.

Does not matter what firmware you start with. Everything will be erased and replaced.

Im boot now from u-boot you point me. but there isnt ide command...

I tried use tftp (connected directly 310 and laptop (manjaro system)) but:

NSA310> setenv ethaddr xx:xx:xx:xx:xx:xx
NSA310> setenv ipaddr 192.168.11.222    
NSA310> setenv serverip 192.168.11.200  
NSA310> tftp 0x1000000 u-boot.kwb       
Using egiga0 device
TFTP from server 192.168.11.200; our IP address is 192.168.11.222
Filename 'u-boot.kwb'.
Load address: 0x1000000
Loading: *
ARP Retry count exceeded; starting again
NSA310>

I dont know, why i can use it. Do you have any idea how i can put u-boot/bin on nas?

possible commands:

NSA310> help     
?         - alias for 'help'
base      - print or set address offset
bdinfo    - print Board Info structure
boot      - boot default, i.e., run 'bootcmd'
bootd     - boot default, i.e., run 'bootcmd'
bootelf   - Boot from an ELF image in memory
bootm     - boot application image from memory
bootp     - boot image via network using BOOTP/TFTP protocol
bootvx    - Boot vxWorks from an ELF image
bootz     - boot Linux zImage image from memory
chpart    - change active partition
cmp       - memory compare
coninfo   - print console devices and information
cp        - memory copy
crc32     - checksum calculation
date      - get/set/reset date & time
dhcp      - boot image via network using DHCP/TFTP protocol
dns       - lookup the IP of a hostname
echo      - echo args to console
editenv   - edit environment variable
env       - environment handling commands
ext2load  - load binary file from a Ext2 filesystem
ext2ls    - list files in a directory (default /)
ext4load  - load binary file from a Ext4 filesystem
ext4ls    - list files in a directory (default /)
ext4size  - determine a file's size
fatinfo   - print information about filesystem
fatload   - load binary file from a dos filesystem
fatls     - list files in a directory (default /)
fatsize   - determine a file's size
fdt       - flattened device tree utility commands
fsinfo    - print information about filesystems
fsload    - load binary file from a filesystem image
fsls      - list files in a directory (default /)
go        - start application at address 'addr'
help      - print command description/usage
iminfo    - print header information for application image
imxtract  - extract a part of a multi-image
itest     - return true/false on integer compare
loadb     - load binary file over serial line (kermit mode)
loads     - load S-Record file over serial line
loadx     - load binary file over serial line (xmodem mode)
loady     - load binary file over serial line (ymodem mode)
loop      - infinite loop on address range
md        - memory display
mii       - MII utility commands
mm        - memory modify (auto-incrementing address)
mtdparts  - define flash/nand partitions
mw        - memory write (fill)
nand      - NAND sub-system
nboot     - boot from NAND device
nfs       - boot image via network using NFS protocol
nm        - memory modify (constant address)
ping      - send ICMP ECHO_REQUEST to network host
printenv  - print environment variables
reset     - Perform RESET of the CPU
run       - run commands in an environment variable
saveenv   - save environment variables to persistent storage
setenv    - set environment variables
setexpr   - set environment variable as the result of eval expression
sleep     - delay execution for some time
sntp      - synchronize RTC via network
source    - run script from memory
tftpboot  - boot image via network using TFTP protocol
ubi       - ubi commands
ubifsload - load file from an UBIFS filesystem
ubifsls   - list files in a directory
ubifsmount- mount UBIFS volume
ubifsumount- unmount UBIFS volume
usb       - USB sub-system
usbboot   - boot from USB device
version   - print monitor, compiler and linker version

I don't think the uboot can 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.

I didn't know the uboot in OpenWrt has no ide command. The only option for you is installing bodhi's uboot then. Use his uboot and follow the tutorial on the nsa310b page in the wiki.

Unfortunately, bodhi uboot ide is broken :confused: when I try use is command, I have "?" - disk isnt recognized correct:

NSA310> ide reset

Reset IDE: Bus 0: OK Bus 1: not available  
  Device 0: Model: ?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?� Firm: ?�?�?�?� Ser#: ?�?�?�?�?�?�?�?�?�?�
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 427923841.5 MB = 417894.3 GB (4611474908973580287 x 512)

Proper is(my backuped uboot):

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: CT120BX300SSD1                           Firm: M2CR010  Ser#: 1743E10589E1        
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)

So if there isnt any other option to install openwrt without usb, i give up for now. Maybe openwrt uboot will be have in future ide.

i made dump of my old uboot so i can back and restore it (ide command works there).
But now i have problem too...

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: CT120BX300SSD1                           Firm: M2CR010  Ser#: 1743E10589E1        
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 114473.4 MB = 111.7 GB (234441648 x 512)

NSA310>> fatload ide 0 0x1000000 mtd0.kwb
reading mtd0.kwb

1048576 bytes read
NSA310>> nand erase 0x0 0x100000

NAND erase: device 0 offset 0x0, size 0x100000
Erasing at 0xe0000 -- 100% complete.
OK
NSA310>> nand write 0x1000000 0x00000 0x100000

NAND write: device 0 offset 0x0, size 0x100000
 1048576 bytes written: OK
NSA310>> reset

After reset, my nas didnt boot (5 orange leds). So i dont know if that ide command works property. Everything i do as on tutorials, but nas didnt boot. What I doing wrong? now I want to go back to stock...

System when i boot it via serial and kwtool boot normally without stop bootloader... I dont know if i put uboot correctly.

after you flash uboot and reset you should pull power plug to make sure all is powered off, like when you kwboot. I had similar issues where the system did not like a warm reboot after uboot update.

If it still does not work, I will add ide to OpenWrt uboot (it is just a yes/no selection, it's fast to do) and compile it so you can flash it.

This is all I can do, sorry.

If bodhi's uboot does not see the hard drive in your device you can also ask him in his forums.

Thank You for you time and help. I will check it later/tomorrow and will write results.
But if I recover my nas with my backuped mtd0 (so make sure that all is working), i will ask you to put ide to openwrt uboot and try install it by ide. I would like have openwrt on my injured nas :slight_smile:

I checked now, and "cold reset" doesnt help.

It looks like my nand didnt write uboot.. There is any way to check if nand is write ok? For example make dump mtd0 after kwboot and full boot and check md5 or sha256 with my backup?

If it isnt to much work for you, please prepare for me openwrt uboot with ide, i will check it, and this will be probably last thing to do... :frowning:

After 10 times writing my dump, finally its working. Last time i formated my hdd from fat32 to fat16 and made only one 3GB partition... I dont know if it was help or maybe I have more luck on tenth attempt.

Now i know that i can use ide to flash my nas.

@bobafetthotmail If you proposition is still active, please prepare for me uboot with ide :slight_smile: I will be very grateful.

Ok, compiled and tested on my nsa310, ide command works and sees the drive
Use the u-boot.kwb file from this zip
https://mega.nz/file/GqBFCaDY#L9LlBfBQk6sAE-362J4i_ZqmO1dWaUNj7YP9Vq3AA2Q
try with kwboot first to see if ide works correctly on your device, if all is good you can flash it.

1 Like

Thank You so much @bobafetthotmail my 310 have now openwrt :slight_smile:

bodhi's uboot was ok too. Problem was with my ssd, it was wrong recognize... I put another hdd (older) and was ok. Same was with your uboot too. There was "?�" on sdd, but hdd install uboot, and openwrt.

So i can confirm that with ide openwrt can be installed. IDE should be enable in uboot by default :slight_smile:

There is a hope for people without USB :slight_smile:

1 Like

yeah I'll send a PR to and enable ide support in all kirkwood uboot built by OpenWrt now.

1 Like

A post was split to a new topic: Unbricking NSA310S after I flashed the wrong U-Boot