Nas520 corrupt fw, but can boot thought universal stick

Mindspeed Comcerto 2000 based
Post Reply
Lroyb
Posts: 4
Joined: Mon Jul 03, 2017 12:46 pm

Nas520 corrupt fw, but can boot thought universal stick

Post by Lroyb » Mon Jul 03, 2017 1:03 pm

Hiya
Newbie to this forum, found some good info that set me off repairing my nas520. Here is the scene.

Installed 2 3tb drives into my nas520 (purchased from eBay last week)
Connected it up and powered it on. After about 1 minutes it reboots.
It continues doing this until I unplug it.

After googling and reading plenty of forums, I find the usb stick method of forcing a flash of the firmware, woohoo I thought.

After downloading the latest 5.21 firmware I set up the usb stick and stuck it in,and turned it on.
And..... Nothing changed.

So I renamed the telnet and stop sh.2 file and telnetted in.

Comparing the force flash sh.2 file and the exec.log file. I noticed that the called variables from the current firmware are none existent and therefore refuses to force the flash. Mainly because the zyxel directory & various other directories (e.g. /usr/local) with all the required commands is completely missing.

I have been able to manually extract the rom, copy the sysdisk.img.gz into nand (block 5 & 7) but I'm unsure as to which block I should write the kernel to.

But I need to download the 5.11 fw and replace the sysdisk.img.gz with that one otherwise the checksums will fail.

Anyone offer any advise?

Thanks in advance
Lee

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: Nas520 corrupt fw, but can boot thought universal stick

Post by Mijzelf » Tue Jul 04, 2017 8:51 am

Which 'force flash' are you talking about?

Lroyb
Posts: 4
Joined: Mon Jul 03, 2017 12:46 pm

Re: Nas520 corrupt fw, but can boot thought universal stick

Post by Lroyb » Tue Jul 04, 2017 9:31 am

The force flash I'm referring to is mentioned on this page.
http://zyxel.nas-central.org/wiki/Flashing_firmware
Because I have absolutely no access through any method apart from the universal stick telnet session.

I have also discovered an error of
Envfs: bad magic on mtd2

Edit: changed 1 word

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: Nas520 corrupt fw, but can boot thought universal stick

Post by Mijzelf » Tue Jul 04, 2017 10:04 am

Right. I was afraid for that. That page is about the NSA300 series. The flash layout of the 500 series (and also the NAS326) is totally different. There is a flash script for the 500 series, but I never published it, as far as I remember, because I never tested it.

It can be found in the GPL sources of the 5.00 firmware for the NAS540.

Lroyb
Posts: 4
Joined: Mon Jul 03, 2017 12:46 pm

Re: Nas520 corrupt fw, but can boot thought universal stick

Post by Lroyb » Tue Jul 04, 2017 11:08 am

I've found the flash layout for the 500 series, but that would explain why some of the commands called by the sh.2 flash script are missing
Am I right in thinking because it had the 5.11 fw installed that the link you posted I shouldn't use and follow through to download http://www.mediafire.com/file/obaoioo76 ... 1C0.tar.gz

As it stands I've no option apart from send it back or test your untested script, which I'm happy to do.

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: Nas520 corrupt fw, but can boot thought universal stick

Post by Mijzelf » Tue Jul 04, 2017 1:41 pm

but that would explain why some of the commands called by the sh.2 flash script are missing
I guess you mean 'not explain'? Don't know which commands are missing, but I guess it's commands like 'fw_printenv' and friends. These commands are designed to manipulate the u-boot environment. Well, the NAS500 doen't use u-boot, it uses barebox. So it's not strange the commands are lacking.
Am I right in thinking because it had the 5.11 fw installed that the link you posted I shouldn't use and follow through to download http://www.mediafire.com/file/obaoioo76 ... 1C0.tar.gz
AFAIK only the earliest GPL sources contain the script. Later ZyXEL removed it. The flash layout didn't change, so it should still work. I hope.

Lroyb
Posts: 4
Joined: Mon Jul 03, 2017 12:46 pm

Re: Nas520 corrupt fw, but can boot thought universal stick

Post by Lroyb » Tue Jul 04, 2017 1:52 pm

Since my last reply. I've been able to erase and flash replacement kernel and sysdisk.img.gz into blocks 4 & 5 respective.

I've got the setenv commands but they fail with envfs: bad magic on block 2. But like you said the 500 series don't use uboot.

As the primary kernel and fs both erased and flashed fine, I'm going to repeat it on the secondary locations.

Post Reply