NSA325 reboot loop?

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

NSA325 reboot loop?

Postby Socaltom » Wed Mar 23, 2016 3:24 pm

OK I have a Zyxel NSA325,
It was recently running the stock FW, but I decided to go back to archarm.
Rather than follow the instructions, this is what I did.
I manually performed the instructions in the install script as follows
1) fdisk to create 3 partitions
1- ext2 16M labeled "boot"
2 ext4 25G partition labeled "rootfs"
3) ext 3 partition
I extracted the kirkwood fs on to the ext4 partition
copied the contents of /boot to the root of the first partition
ran fw_printenv to confirm that the "to_linux" parameters were still in there.

then ran fw_setenv bootcmd 'run to_linux'

plugged the drive into the left slot, and I can hear it access the drive, but after about 30 seconds it reboots.

For reference here is the install script I tried to follow
What do I do next?

$this->bbcode_second_pass_code('', '#!/bin/sh

#####
# Created By: Jason Plum <jplum@archlinuxarm.org>
# Prepared for: Arch Linux ARM
# ----------
# Automation to convert NSA-325 to Arch Linux ARM on /dev/sda
# : /dev/sda is sata port 1, left side of enclosure.
#####
echo "Automatic Installation of Arch Linux ARM"

###
# setup u-boot environment
echo "- set bootloader"
fw_setenv arcNumber 4495
fw_setenv mainlineLinux yes
fw_setenv 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'
fw_setenv 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'
fw_setenv bootcmd_linux 'setenv bootargs $(bootargs_linux); ide reset; ext2load ide 0:1 $(loadaddr) /uImage; bootm $(loadaddr)'
fw_setenv bootcmd_stock 'setenv bootargs $(bootargs_stock); nand read.e $(loadaddr) $(kernel_addr) 0xA00000; bootm $(loadadr)'
fw_setenv to_stock "setenv mainlineLinux no; setenv bootcmd \'run bootcmd_stock\'; saveenv; reset"
fw_setenv to_linux "setenv mainlineLinux yes; setenv bootcmd \'run bootcmd_linux\'; saveenv; reset"

###
# setup the partitions on the disk (sda)
# : 16M 1st partition, ext2/3
#echo "- parition sda"
#fdisk /dev/sda <<EOF
#o
#n
#p
#1

#+16M

#n
#p
#2


#p
#w

#EOF
echo " * pause for ioctl to re-sync partitions"
sleep 5
###
# make filesystems
#echo "- make filesystems"
# ext2 makes u-boot happy.
#mkfs.ext2 -L "boot" /dev/sda1
# stock does not know how to make ext4!
#mkfs.ext4 -L "rootfs" /dev/sde2

###
# make dirs & mount
echo "- mount destination"
mkdir -p /tmp/boot
mount -t ext3 /dev/sda1 /tmp/boot
mkdir -p /tmp/rootfs
mount -t ext4 /dev/sda2 /tmp/rootfs

###
# prepare the system
# extract the rootfs
#echo "- extract rootfs"
#tar xzf /mnt/parnerkey/rootfs.tgz -C /tmp/rootfs/cd

# copy the uImage to the boot partition
echo "- prepare boot partition"
cp -aR /tmp/rootfs/boot/* /tmp/boot/

# always make sure you're sync'd!
sync

###
# prepare for first boot
# set the bootcmd to run the steps to convert.
fw_setenv bootcmd 'run to_linux'
###
# we're done here
echo "- REBOOTING!"
sync
reboot
')
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side

Re: NSA325 reboot loop?

Postby WarheadsSE » Wed Mar 23, 2016 5:51 pm

</3 hardware watchdog.

This has been solved, but it requires adding a line to the in the bootcmd to cause it to trip the GPIO. That's what needs addressed at this point. I do not immediately recall the command and aassociated memory addresses though, to do so.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: NSA325 reboot loop?

Postby Socaltom » Wed Mar 23, 2016 7:32 pm

any tricks to get it to go back to stock?
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side

Re: NSA325 reboot loop?

Postby summers » Wed Mar 23, 2016 7:59 pm

Back to stock is hard I think.

I guess you rewrote the uboot env variables run_to_linux.

So this means that the flash has partially been rewritten, now rewriting the env varibles if you can't boot, is hard. Pulling the hard disk doesn't help, as its in flash that its going wrong.

I still have the original arm arch env varibles on my NS325, in the old env location (this has changed on more recent uboot). So I'lll check the variables when I get a chance, and see what fall back it has -so if there is a fall back to boot to stock.

Obviously easiest is to set up a HDD that looks as uboot expect it, so the boot to linux boots property.

Other option is to access the UART on the main board, you can use a serial interface there to interupt ubot, and so change what it boots too.

ANyway more into when I've check my old uboot env variables.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA325 reboot loop?

Postby Socaltom » Wed Mar 23, 2016 8:01 pm

run to_stock is still in there. If I put that command on the Usb stick would it work?
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side

<solved> Re: NSA325 reboot loop?

Postby Socaltom » Wed Mar 23, 2016 11:17 pm

so, I used a different HD, set it up with the 2 required partitions, and gave it a go. Darned if it didn't boot first try! Funny part is its an old slow SATA I drive. Once I got it booted I jumped through a couple of hoops, and got it to run to stock.
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side

Re: NSA325 reboot loop?

Postby WarheadsSE » Wed Mar 23, 2016 11:59 pm

@summers if they never changed the uboot out, then the to_stock will still be there.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: NSA325 reboot loop?

Postby summers » Thu Mar 24, 2016 5:48 pm

@SocalTom: Glad it worked about you found a way out.

@WarheadSE: Of course you are right, the problem is though how to execute the to_stock command. There are two ways:

1) Access the UART, and direct access of uboot
2) Rewriting the enviroment varaibles via fw_setenv, for which you need to be in a OS that can execute fw_setenv

Now wasn't clear in original post that the poster had a UART connection, so not clear he could use that method. Most people don't have a UART, are the headers mounted by default on an NSA325, or do you need to solder them on?

So most people need to find a way into an OS where they can execute fw_setenv. Now modern uboot env variables scan multiple systems, to try and find a system to boot, e.g. default seems to scan both usb and ide. So on a modern uboot, you can create a viable OS on a USB stick, and boot from that, to reset.

Now on the old stock uboot env variables, I don't recall if the default boot sequence scanned anything more than the first ide disk. I seem to recall references to an nfs boot, but that it wasn't default (and needed to uart to enter).

Anyway writing a correct OS to an spare HDD and using that in slot 1 seems easiest - and is what the poster did.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA325 reboot loop?

Postby Socaltom » Mon Mar 28, 2016 3:53 am

I had some more time to play with it this weekend. For what ever reason, if I put 3 partitions on the boot drive it stalls out. If I put 2 partitions it boots right up to ALARM.
Tom
used to be owned by me
Pink Pogo V2, Black Pogo V3, Zyxel NAS 325 v1,
used to be Adminstrator for
Goflex net, Black V3, Black V2
Now I have a couple of raspberry pi ( 3+ and 4)
Socaltom
 
Posts: 571
Joined: Thu Apr 07, 2011 2:21 pm
Location: The left side

Re: NSA325 reboot loop?

Postby WarheadsSE » Mon Mar 28, 2016 4:01 pm

Yeah, non-stock uboot doesn't have this issue since we flip the watchdog once uboot is up.

I have to go digging though the old thread and find you the mw commands to turn it off in boot sequence.

Sadly, my 325 has bitten the proverbial dust.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Next

Return to ARMv5

Who is online

Users browsing this forum: No registered users and 9 guests