Welcome! Log In Create A New Profile

Advanced

NSA310S u-boot installation - cannot boot

Posted by Hendrik 
Hendrik
NSA310S u-boot installation - cannot boot
October 10, 2017 12:42AM
Dear bodhi,

thank you very much for offering these pieces of software combined with a nice little manual how to install it.
Since my Laptop died on Sunday and yesterday my desktops data-HDD crashed I needed a cheap and quick solution for all my data and got an old zyxel NSA310s.
Unfortunately, beeing kind of a novice to linux and especially to flashing hardware via UART, I seem to have inadvertently bricked my zyxel. :-(
My goal was to flash the uboot to nand but after rebooting between section A and B of your instructions the device is stucked in a bootloop. I'm monitoring it via UART.

Before rebooting I backed up the settings as follows:

fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
# NAND example
/dev/mtd1               0x0000          0x20000         0x20000                 4

/proc/mtd
dev:    size   erasesize  name
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"

fw_printenv did not change at all
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
bootdelay=2
baudrate=115200
loads_echo=0
ipaddr=10.4.52.165
serverip=10.4.52.7
rootpath=/srv/ubuntu
netmask=255.255.255.0
nandEcc=1bit
kernel_addr=C80000
MODEL_ID=AD03
PRODUCT_NAME=STG-315
FEATURE_BIT=00
CONTRY_TYPE=FF
VENDOR_NAME=MitraStar Technology Corp.
run_diag=yes
ethaddr=5C:F4:AB:2F:FB:F0

Bad blocks as of / # dmesg | grep -i 'bad' were:
Scanning device for bad blocks
Bad eraseblock 100 at 0x000000c80000
Bad eraseblock 200 at 0x000001900000

After rebooting i got the following messages repeatingly:
U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:55:45 -0700)
ZyXEL NSA310S/320S 1/2-Bay Power Media Server

SoC:   Kirkwood 88F6702_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
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Partition Map for USB device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            15644672        00000000-01     83 Boot
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **
** File not found /boot/uImage **
** File not found /boot/uInitrd **
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
stopping USB..

Reset IDE: Bus 0: OK Bus 1: not available
  Device 0: Model: ST8000AS0002-1NA17Z  Firm: AR13 Ser#: Z84048X9
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 7630885.3 MB = 7452.0 GB (15628053168 x 512)
** File not found /boot/uImage **
** File not found /boot/uInitrd **
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
resetting ...

what was my mistake (aside from touching the firmware in the first place...) and what can i do now?
Help is much appreciated!

-Hendrik



Edited 1 time(s). Last edit at 10/10/2017 02:42AM by bodhi.
Re: NSA310S u-boot installation - cannot boot
October 10, 2017 02:59AM
Hendrik,


> U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:55:45
> -0700)
> ZyXEL NSA310S/320S 1/2-Bay Power Media Server
>
> SoC: Kirkwood 88F6702_A1
> DRAM: 256 MiB
> WARNING: Caches not enabled
> NAND: 128 MiB

u-boot image looks good!

Quote

> *** Warning - bad CRC, using default environment

fw_printenv did not change at all


You did not flash the default env image in step 8

Quote

8. Flashing default u-boot envs image:

....

A special section (B. Flashing default u-boot envs image) about flashing default u-boot envs is included at the end of this installation procedure. Please follow the instruction in this section B to perform this step before continuing with step 9.

So now we need to fix it in serial console. Solution:



Follow the instruction in this post to set your envs to a good default set:

https://forum.doozan.com/read.php?3,29362,29390#msg-29390

Note: you need to change this since your box is NSA310S:

Quote

Adjust the other specific envs and then boot the rootfs:
setenv devices 'usb ide'
setenv ethaddr xx:xx:xx:xx:xx:xx
setenv dtb_file '/boot/dts/kirkwood-nsa310s.dtb'

And post the entire serial console log if you cannot boot. I've noticed your USB rootfs might have a different problem.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 10/10/2017 03:00AM by bodhi.
Hendrik
Re: NSA310S u-boot installation - cannot boot
October 12, 2017 08:10AM
Thank you very much!

I will try to do these steps, on saturday, as i'm currently not at home!
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: