Welcome! Log In Create A New Profile

Advanced

NSA-320 kwboot doesn't work; hangs after fully sending image

Posted by DiscJax420 
NSA-320 kwboot doesn't work; hangs after fully sending image
November 23, 2018 04:17AM
Hello,
I'm trying to upgrade my ZyXEL NSA-320 u-boot to prepare it for debian/openmediavault. Before doing anything I wanted to make sure kwboot works, so I am trying to kwboot both the new u-boot and also the stock mtd0 backup I took but all u-boots I try give the same result:

My serial port is set to baud 115200 - data bits 8 - stop bits 1 - flow control none - parity none

~# kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.nsa320.mtd0.kwb -p
Sending boot message. Please reboot the target... -
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  6 % [......................................................................]
  8 % [......................................................................]
 10 % [......................................................................]
 11 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 23 % [......................................................................]
 25 % [......................................................................]
 27 % [......................................................................]
 29 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 34 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 44 % [......................................................................]
 46 % [......................................................................]
 47 % [......................................................................]
 49 % [......................................................................]
 51 % [......................................................................]
 53 % [......................................................................]
 54 % [......................................................................]
 56 % [......................................................................]
 58 % [......................................................................]
 59 % [......................................................................]
 61 % [......................................................................]
 63 % [......................................................................]
 64 % [......................................................................]
 66 % [......................................................................]
 68 % [......................................................................]
 70 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 75 % [......................................................................]
 76 % [......................................................................]
 78 % [......................................................................]
 80 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 85 % [......................................................................]
 87 % [......................................................................]
 88 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 95 % [......................................................................]
 97 % [......................................................................]
 99 % [....................................]
[Type Ctrl-\ + c to quit]


~# kwboot -t -B 115200 /dev/ttyUSB0 -b mtd0.backup -p
gives the same result.

After the image is loaded it just gives this strange unicode symbol and just sits there. I'm using a FTDI chip and i can get serial console just fine and boot into Arch already and control it with no problems. I've got TX,RX and GND connected only (no VCC).

kwboot version is:
apt install u-boot-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
u-boot-tools is already the newest version (2016.03+dfsg1-6ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

OS is Ubuntu Bionic 18.04 LTS.
Trying without -p gives few blocks of sending and then the original u-boot boots and then gives xmodem error so I think -p is needed.

I connecting the pins directly to the ftdi chip using thin cables with female ends from each pin to the corresponding on the chip.

What else do I need to check ? Anything I can try ?



Edited 2 time(s). Last edit at 11/23/2018 04:28AM by DiscJax420.
Re: NSA-320 kwboot doesn't work; hangs after fully sending image
November 23, 2018 04:24AM
I wanted to add that I checked sha-1 hash of downloaded files and I'm sure they're not corrupt.

To make sure nothing went wrong during untar, here's sha1-sum of untared file:
af17a64d0e4c759a7672374e7de38aa1985b0c7e  uboot.2017.07-tld-1.nsa320.mtd0.kwb

Here's serial console of stock u-boot:
         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|
 ** MARVELL BOARD: RD-88F6281A LE

U-Boot 1.1.4 (Mar 23 2011 - 16:09:39) 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

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 256MB
DRAM CS[1] base 0x10000000   size 256MB
DRAM Total size 512MB  16bit width
Addresses 10M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (10M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)
//---  stateButtonBit = 3, recovery ---//
Kernel address is 0x4640000.

Streaming disabled
Write allocate disabled

Module 0 is RGMII
Module 1 is TDM

USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0, egiga1 [PRIME]
Hit any key to stop autoboot:  0
NSA320>>

Here's my stock env (I have arch installed using their installer):
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
bootdelay=2
baudrate=115200
loads_echo=0
eth1addr=00:19:CB:00:51:82
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
nandEcc=1bit
MODEL_ID=DD01
PRODUCT_NAME=NSA-320
FEATURE_BIT=00
CONTRY_TYPE=FF
VENDOR_NAME=ZyXEL Communications Corp.
run_diag=yes
ethaddr=FC:F5:28:31:85:56
arcNumber=3956
bootargs_stock=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
bootargs_linux=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/sda2 rw rootwait loglevel=8
bootcmd_linux=setenv bootargs $(bootargs_linux); ide reset; ext2load ide 0:1 $(loadaddr) /uImage; bootm $(loadaddr)
bootcmd_stock=setenv bootargs $(bootargs_stock); nand read.e $(loadaddr) $(kernel_addr) 0xA00000; bootm $(loadadr)
to_stock=setenv mainlineLinux no; setenv bootcmd \'run bootcmd_stock\'; saveenv; reset
to_linux=setenv mainlineLinux yes; setenv bootcmd \'run bootcmd_linux\'; saveenv; reset
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
CASset=min
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
ethprime=egiga1
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::orion:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
disaMvPnp=no
ethmtu=1500
eth1mtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
hddPowerCtrl=no
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
enaAutoRecovery=yes
kernel_addr=0x4640000
pcieTune=no
ethact=egiga1
mainlineLinux=yes
bootcmd='run bootcmd_linux'
Re: NSA-320 kwboot doesn't work; hangs after fully sending image
November 23, 2018 05:07AM
DiscJax420,

Sometimes running kwboot from a x86 Ubuntu box is problematic. That kwboot version might be a several version behind. And there are some quirks that might cause a handshake problem.

Usually you will have better chance to get it working from another ARM box (such as rPi, or the Kirkwood plugs in this forum).

I've recently compiled a new ARM kwboot from the latest mainline U-Boot:

https://forum.doozan.com/read.php?3,69499,72534#msg-72534

This new kwboot binary has helped Ironaxe to run it successfully from a rPi (look further down from the linked post). Ironaxe saw the same problem with being stuck after the image was loaded. I suspected that was just a handshake problem from Ubuntu box and the NAS, and that seems to be true (in that case, at least).

In my experience, when you see that 99%, then the box is ready to run the loaded image, it just never receive a trigger for it to run (such as end of image).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA-320 kwboot doesn't work; hangs after fully sending image
November 23, 2018 06:20PM
Hey,
Thanks for your reply. I want to attempt latest kwboot from mainline u-boot on x86 various linux os because i don't have access to any ARM device. I got the latest mainline u-boot from git://git.denx.de/u-boot. How can I compile x86 kwboot ? I tried to do make tools-only but it doesn't build kwboot.

Any info about how to compile kwboot ?
Thanks a lot in advance.

Edit: Also, in case kwboot fails, is there any alternative tool to use ? You mentioned in the guide that there are 3 tools, but then you only mentioned kwboot.



Edited 1 time(s). Last edit at 11/23/2018 06:21PM by DiscJax420.
Re: NSA-320 kwboot doesn't work; hangs after fully sending image
November 23, 2018 06:40PM
DiscJax420,

> I got the latest mainline u-boot from
> git://git.denx.de/u-boot. How can I compile x86
> kwboot ? I tried to do make tools-only but it
> doesn't build kwboot.

To make it easy, just pick a u-boot and build it. It will automatically build kwboot as part of the build.

> Edit: Also, in case kwboot fails, is there any
> alternative tool to use ? You mentioned in the
> guide that there are 3 tools, but then you only
> mentioned kwboot.

For this box, kwboot is the best tool.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA-320 kwboot doesn't work; hangs after fully sending image
November 23, 2018 06:44PM
Thanks for the hints, using Ubuntu 16.04 VM and USB passthrough of FTDI chip and mainline u-boot source, I did `make menuconfig`, chose ARM architecture, then target board `Marvell OpenRD Board`, then I saved .config and executed `make tools-only` and I got new kwboot in ./tools

And I am happy to report with this latest kwboot (tag v2018.11 in git source) even with VM and x86 and USB passthrough, it succeeded to boot. Thank you very much for your help.

EDIT: I should also notice that with the new kwboot, the transfer is slower and there seems to be a small delay before the start of actual transfer but it works, I booted my backed up mtd0 and also U-Boot 2017.07-tld-1.



Edited 1 time(s). Last edit at 11/23/2018 06:48PM by DiscJax420.
Re: NSA-320 kwboot doesn't work; hangs after fully sending image
November 23, 2018 09:25PM
DiscJax420 Wrote:
-------------------------------------------------------
> Thanks for the hints, using Ubuntu 16.04 VM and
> USB passthrough of FTDI chip and mainline u-boot
> source, I did `make menuconfig`, chose ARM
> architecture, then target board `Marvell OpenRD
> Board`, then I saved .config and executed `make
> tools-only` and I got new kwboot in ./tools
>
> And I am happy to report with this latest kwboot
> (tag v2018.11 in git source) even with VM and x86
> and USB passthrough, it succeeded to boot. Thank
> you very much for your help.

Cool!

>
> EDIT: I should also notice that with the new
> kwboot, the transfer is slower and there seems to
> be a small delay before the start of actual
> transfer but it works, I booted my backed up mtd0
> and also U-Boot 2017.07-tld-1.

Part of the improvement in latest kwboot was making sure no lost chars in handshaking thus it is slower, but better.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: