Welcome! Log In Create A New Profile

Advanced

NSA325v2 bricked

Posted by ErGatto 
NSA325v2 bricked
February 27, 2025 01:22PM
Hello,
I recently got my hands on an NSA325v2 Zyxel NAS and I wanted to install debian on it.
I followed the various procedures but I think I bricked my NAS.

I tried connecting it via serial UART:
usb adapter: GND RX TX 3.3
NAS: GND [empty] RX TX 3.3

Is this correct?

I tried using kwboot from a Raspberry Pi4 and another linux computer but it only gives me the following log:
sudo ./kwboot -t -B 115200 /dev/ttyAMA0 -b uboot.2023.04-tld-1.nsa325.kwb -p
kwboot version 2024.04-rc3-00001-g0861eab8ec-dirty
Detected kwbimage v0 with NAND boot signature
Patching image boot signature to UART
Sending boot message. Please reboot the target...\

and also
./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.nsa325.mtd0.kwb  -p
kwboot version 2025.01-rc1-ge61ea9f2e5d2-dirty
Detected kwbimage v0 with NAND boot signature
Patching image boot signature to UART
Sending boot message. Please reboot the target.../

The nas led behaviour is the following:
when connecting the UART adapter to the computers the blue light and yellow DISK2 light come on
sometimes the SYS led lights up but apparently the NAS reboots and it cycles again.

The behaviour is the same even if I connect my rootfs USB drive.

Am I doing this right?
What should I try next?

Thanks
I am new to all this stuff so I really don't know what I'm doing and would appreciate some help.
Re: NSA325v2 bricked
February 27, 2025 11:03PM
ErGatto,

> I tried connecting it via serial UART:
> usb adapter: GND RX TX 3.3
> NAS: GND [empty] RX TX 3.3
>
> Is this correct?

You need to connect GND-GND, RX-TX, TX-RX, and not connect 3.3.V

> The nas led behaviour is the following:
> when connecting the UART adapter to the computers
> the blue light and yellow DISK2 light come on
> sometimes the SYS led lights up but apparently the
> NAS reboots and it cycles again.

That's the watchdog kicks in after about 30 seconds. And it's actually a good sign.

So reconnect the wires and run picocom/minicom on the Linux host. See if anything comes out of serial console. If there is, post the serial console log here.

If nothing comes out of normal serial console, then run kwboot again

sudo ./kwboot -t -B 115200 /dev/ttyAMA0 -b uboot.2023.04-tld-1.nsa325.kwb -p

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325v2 bricked
February 28, 2025 01:39AM
Hi bodhi,
thanks for your reply.
I fixed my serial connection and used picocom to connect.
I do get output but I think there is something wrong with the envs (I made a backup). In any case, it does bootloop but I think it's because it can't set a block device so I wonder if I made a mistake while creating my bootfs USB key.

The serial log is the following:

picocom -b 115200 /dev/ttyUSB0
picocom v3.1

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
hangup is      : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        :
omap is        :
emap is        : crcrlf,delbs,
logfile is     : none
initstring     : none
exit_after is  : not set
exit is        : no

Type [C-a] [C-h] to see available commands
Terminal ready

U-Boot 2023.04-tld-1 (Jun 24 2023 - 17:50:21 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
Model: ZyXEL NSA325
DRAM:  512 MiB
Core:  19 devices, 15 uclasses, devicetree: separate
NAND:  128 MiB
Loading Environment from NAND... OK
Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
pcie0.0: Link up
Net:
Warning: ethernet-controller@72000 (eth0) using random MAC address - 9e:bb:cb:28:05:dc
eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0
Initializing devices...
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices...

U-Boot 2023.04-tld-1 (Jun 24 2023 - 17:50:21 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
Model: ZyXEL NSA325
DRAM:  512 MiB
Core:  19 devices, 15 uclasses, devicetree: separate
NAND:  128 MiB
Loading Environment from NAND... OK
Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
pcie0.0: Link up
Net:
Warning: ethernet-controller@72000 (eth0) using random MAC address - 7a:bc:88:6d:fa:48
eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0
Initializing devices...
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices...

U-Boot 2023.04-tld-1 (Jun 24 2023 - 17:50:21 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
Model: ZyXEL NSA325
DRAM:  512 MiB
Core:  19 devices, 15 uclasses, devicetree: separate
NAND:  128 MiB
Loading Environment from NAND... OK
Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
pcie0.0: Link up
Net:
Warning: ethernet-controller@72000 (eth0) using random MAC address - 9e:bb:cb:28:05:dc
eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0
Initializing devices...
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Loading envs from usb 0...
** No partition table - usb 0 **
Couldn't find partition usb 0:1
Can't set block device
Loading envs from usb 1...
** Bad device specification usb 1 **
Couldn't find partition usb 1:1
Can't set block device
Loading envs from usb 2...
** Bad device specification usb 2 **
Couldn't find partition usb 2:1
Can't set block device
Loading envs from usb 3...
** Bad device specification usb 3 **
Couldn't find partition usb 3:1
Can't set block device
Loading envs from sata 0...
** Bad device specification sata 0 **
Couldn't find partition sata 0:1
Can't set block device
Loading envs from sata 1...
** Bad device specification sata 1 **
Couldn't find partition sata 1:1
Can't set block device
Loading envs from sata 2...
** Bad device specification sata 2 **
Couldn't find partition sata 2:1
Can't set block device
Loading envs from sata 3...
** Bad device specification sata 3 **
Couldn't find partition sata 3:1
Can't set block device
running scan_disk ...
Scan device usb
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices...

U-Boot 2023.04-tld-1 (Jun 24 2023 - 17:50:21 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
Model: ZyXEL NSA325
DRAM:  512 MiB
Core:  19 devices, 15 uclasses, devicetree: separate
NAND:  128 MiB
Loading Environment from NAND... OK
Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
pcie0.0: Link up
Net:
Warning: ethernet-controller@72000 (eth0) using random MAC address - be:ba:0e:67:d4:0c
eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0
Initializing devices...
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Loading envs from usb 0...
** No partition table - usb 0 **
Couldn't find partition usb 0:1
Can't set block device
Loading envs from usb 1...
** Bad device specification usb 1 **
Couldn't find partition usb 1:1
Can't set block device
Loading envs from usb 2...
** Bad device specification usb 2 **
Couldn't find partition usb 2:1
Can't set block device
Loading envs from usb 3...
** Bad device specification usb 3 **
Couldn't find partition usb 3:1
Can't set block device
Loading envs from sata 0...
** Bad device specification sata 0 **
Couldn't find partition sata 0:1
Can't set block device
Loading envs from sata 1...
** Bad device specification sata 1 **
Couldn't find partition sata 1:1
Can't set block device
Loading envs from sata 2...
** Bad device specification sata 2 **
Couldn't find partition sata 2:1
Can't set block device
Loading envs from sata 3...
** Bad device specification sata 3 **
Couldn't find partition sata 3:1
Can't set block device
running scan_disk ...
Scan device usb
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
device usb 0:1
** No partition table - usb 0 **
Couldn't find partition usb 0:1
Can't set block device
device usb 1:1
** Bad device specification usb 1 **
Couldn't find partition usb 1:1
Can't set block device
device usb 2:1
** Bad device specification usb 2 **
Couldn't find partition usb 2:1
Can't set block device
device usb 3:1
** Bad device specification usb 3 **
Couldn't find partition usb 3:1
Can't set block device
Scan device sata
device sata 0:1
** Bad device specification sata 0 **
Couldn't find partition sata 0:1
Can't set block device
device sata 1:1
** Bad device specification sata 1 **
Couldn't find partition sata 1:1
Can't set block device
device sata 2:1
** Bad device specification sata 2 **
Couldn't find partition sata 2:1
Can't set block device
device sata 3:1
** Bad device specification sata 3 **
Couldn't find partition sata 3:1
Can't set block device
loading uImage ...
** No partition table - usb 0 **
Couldn't find partition usb 0:1
Can't set block device
resetting ...
and then it loops again and again.

To make my rootfs USB I used a 64GB (I don't have any smaller ones) USB3.0 key.
I deleted all partitions, made a single primary one (MBR style not GPT) and formatted it using ext3
mke2fs -j /dev/sdh
then labeled it "rootfs".
After that I downloaded the Debian-6.5.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2 archive, and extracted it to my usb drive.
I tried using both the back usb ports but to no avail.

Another issue I am experiencing is that sometimes it won't boot at all and the HDD2 led stays on then everything turns off and back on again. I have no serial output when it does that.



Edited 1 time(s). Last edit at 02/28/2025 02:08AM by ErGatto.
Re: NSA325v2 bricked
February 28, 2025 03:47AM
ErGatto,


If you create the rootfs on Ubuntu or other Debian derivative, use command line tool, don't use GUI.

Assuming the USB drive is assigned /dev/sdb.

Become root, wipe and create new partition, format as Ext3, mount and exrtract the tarball.
su -
fdisk /dev/sdb
mkfs.ex3 -L rootfs /dev/sdb1
mount /dev/sdb1 <mount point>
cd  <mount point>
tar xf <the rootfs tarball>
sync
sync
umount <mount point>

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



Edited 1 time(s). Last edit at 02/28/2025 03:49AM by bodhi.
Re: NSA325v2 bricked
February 28, 2025 04:30AM
Thanks again for your reply.
I am using a raspberry Pi 4 running RaspberryPi OS to create the rootfs. I did the following:
su -
lsblk     # my device is /dev/sda
fdisk /dev/sda
o     # created new MBR partition table
n     # created new primary partition (p , 1, 2048, 120176639)
w    # wrote the changes to disk
lsblk    # /dev/sda1
mkfs.ext3 -L rootfs /dev/sda1
mount /dev/sda1 /media/USB
cd /media/USB
tar xf /home/Gatto/Desktop/Debian-5.6.7-kirkwood-tld-1-rootfs-bodhi.tar.bz2
sync
sync
umount /media/USB

And now it boots to Debian.

I just have one more question: I did set my MAC address while configuring the envs but this NAS always boots with random addresses. Should I set the correct one within Debian or should I try setting the variable in the uboot env?

Also this is now a debian box right? Can I do whatever I want (mdadm raid, webserver, monitoring and similar)?

I still experience that issue where after a reboot it takes many power cycles to boot and sometimes it restarts during the uboot 10 seconds countdown. I am not sure if the cpu is overheating or what is happening (I am only using the nas board now to do these tests before putting it all back together).

Thanks again for your help!



Edited 2 time(s). Last edit at 02/28/2025 07:09AM by ErGatto.
Re: NSA325v2 bricked
February 28, 2025 06:44AM
I am now experiencing a new issue, I'm not sure if it's power related but after updating debian and rebooting I cannot get Debian to work.

Serial log:
U-Boot 2023.04-tld-1 (Jun 24 2023 - 17:50:21 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
Model: ZyXEL NSA325
DRAM:  512 MiB
Core:  19 devices, 15 uclasses, devicetree: separate
NAND:  128 MiB
Loading Environment from NAND... OK
Resetting console stdin/stdout/stderr to serial...
In:    serial
Out:   serial
Err:   serial
pcie0.0: Link up
Net:   eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0
Initializing devices...
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Loading envs from usb 0...
Failed to load '/boot/uEnv.txt'
Loading envs from usb 1...
** Bad device specification usb 1 **
Couldn't find partition usb 1:1
Can't set block device
Loading envs from usb 2...
** Bad device specification usb 2 **
Couldn't find partition usb 2:1
Can't set block device
Loading envs from usb 3...
** Bad device specification usb 3 **
Couldn't find partition usb 3:1
Can't set block device
Loading envs from sata 0...
** Bad device specification sata 0 **
Couldn't find partition sata 0:1
Can't set block device
Loading envs from sata 1...
** Bad device specification sata 1 **
Couldn't find partition sata 1:1
Can't set block device
Loading envs from sata 2...
** Bad device specification sata 2 **
Couldn't find partition sata 2:1
Can't set block device
Loading envs from sata 3...
** Bad device specification sata 3 **
Couldn't find partition sata 3:1
Can't set block device
running scan_disk ...
Scan device usb
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
resetting USB...
Bus ehci@50000: USB EHCI 1.00
Bus xhci_pci: Register 4000820 NbrPorts 4
Starting the controller
USB XHCI 0.96
scanning bus ehci@50000 for devices... 3 USB Device(s) found
scanning bus xhci_pci for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
device usb 0:1
1 bytes read in 9 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
6223944 bytes read in 178 ms (33.3 MiB/s)
loading uInitrd ...
5791271 bytes read in 168 ms (32.9 MiB/s)
loading DTB /boot/dts/kirkwood-nsa325.dtb ...
14414 bytes read in 17 ms (827.1 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-6.5.7-kirkwood-tld-1
   Created:      2023-10-31  22:53:22 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    6223880 Bytes = 5.9 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-6.5.7-kirkwood-tld-1
   Created:      2023-10-31  22:53:55 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5791207 Bytes = 5.5 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02c00000
   Booting using the fdt blob at 0x2c00000
Working FDT set to 2c00000


Starting kernel ...

   Loading Kernel Image
   Loading Ramdisk to 1f5c7000, end 1fb4cde7 ... OK
   Loading Device Tree to 1f5c0000, end 1f5c684d ... OK
Working FDT set to 1f5c0000

Starting kernel ...
After that the NAS reboots.
I am not sure if it's a power issue, output voltage looks fine, 12.2V. I am not sure if it's a software issue, maybe some update or something. The weird issue is the costant boot loop.

Edit: I have this issue while booting too, sometimes it does not reach the kernel loading step at all. So yeah, I'm actually wondering what is going on.



Edited 1 time(s). Last edit at 02/28/2025 07:27AM by ErGatto.
Re: NSA325v2 bricked
February 28, 2025 09:41AM
ErGatto,

Quote

> I still experience that issue where after a reboot
> it takes many power cycles to boot and sometimes
> it restarts during the uboot 10 seconds countdown.

Also

Quote

Starting kernel ...
After that the NAS reboots.
I am not sure if it's a power issue, output voltage looks fine, 12.2V. I am not sure if it's a software issue, maybe some update or something. The weird issue is the costant boot loop.

For this NSA325 box only (with the hardware watchdog), this issue sometimes is related to whether you have erased the flash before nandwrite.

https://forum.doozan.com/read.php?3,135222

Quote

5. Flash u-boot image to NAND

Be extra careful with the next 2 commands, you should see output that look like below in those steps. If there is error, then do not reboot, post your problem here so we can help.

Erase 4 blocks
flash_erase /dev/mtd0 0 4
Expected output:
Erase Total 4 Units
Performing Flash Erase of length 131072 at offset 0x60000 done

Write the image
nandwrite /dev/mtd0 /tmp/uboot.2023.04-tld-1.nsa325.kwb
Expected output:
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000

So erase the flash mtd0 and reflash it.

And please post the log of your flashing session.

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



Edited 1 time(s). Last edit at 02/28/2025 10:02AM by bodhi.
Re: NSA325v2 bricked
February 28, 2025 10:02AM
Some of the symptoms sound like they may be power related. If you have another 12V/5A power adapter available you should try using a different power supply to see if it improves your situation.

Ray



Edited 1 time(s). Last edit at 02/28/2025 10:02AM by rayknight.
Re: NSA325v2 bricked
February 28, 2025 10:06AM
Quote

I just have one more question: I did set my MAC address while configuring the envs but this NAS always boots with random addresses. Should I set the correct one within Debian or should I try setting the variable in the uboot env?

You can set ethaddr env in Debian with fw_setenv.

Quote

Also this is now a debian box right? Can I do whatever I want (mdadm raid, webserver, monitoring and similar)?

Yes! install whatever package you need and as you are using it, you will need to install more packages. This rootfs is a bare minimal Debian system.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325v2 bricked
February 28, 2025 11:16AM
bodhi Wrote:
-------------------------------------------------------
> ErGatto,
>
>
Quote

5. Flash u-boot image to NAND
>
> Be extra careful with the next 2 commands, you
> should see output that look like below in those
> steps. If there is error, then do not reboot, post
> your problem here so we can help.
>
> Erase 4 blocks
> flash_erase /dev/mtd0 0 4
> Expected output:
> Erase Total 4 Units
> Performing Flash Erase of length 131072 at offset
> 0x60000 done
>
> Write the image
> nandwrite /dev/mtd0
> /tmp/uboot.2023.04-tld-1.nsa325.kwb
> Expected output:
> Writing data to block 0 at offset 0x0
> Writing data to block 1 at offset 0x20000
> Writing data to block 2 at offset 0x40000
> Writing data to block 3 at offset 0x60000
>
> So erase the flash mtd0 and reflash it.
>
> And please post the log of your flashing session.


Thanks again for your reply.

This is what I did (after booting to Debian rootfs, I did not have those commands in uboot):
root@debian:/tmp/tools# flash_erase /dev/mtd0 0 4
Erasing 128 Kibyte @ 60000 -- 100 % complete

root@debian:/tmp/tools# nandwrite /dev/mtd0 uboot.2023.04-tld-1.nsa325.kwb
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000


root@debian:/tmp# flash_erase /dev/mtd0 0xc0000 1
Erasing 128 Kibyte @ c0000 -- 100 % complete

root@debian:/tmp# nandwrite -s 786432 /dev/mtd0 /tmp/uboot.2023.04-tld-1.nsa325.environment.img
Writing data to block 6 at offset 0xc0000

Edit: i probably messed up so I am doing everything again, will update when done sorry
Edit2: I followed the instructions again but I still have the same issue. Booting with kwboot is 100% working, both uboot and Debian.

Also I don't have another 12v adapter so I cannot test it but bootting with kwboot worked fine and had no issues. I got into debian too so this makes me think that it's something else.



Edited 4 time(s). Last edit at 02/28/2025 11:28AM by ErGatto.
Re: NSA325v2 bricked
February 28, 2025 10:33PM
ErGatto,

Dump the current u-boot from mtd0

cat /proc/mtd
nanddump --noecc --omitoob -l 0x80000 -f mtd0.nsa325.2023.04-tld-1 /dev/mtd0

And compare with the image
diff mtd0.nsa325.2023.04-tld-1 uboot.2023.04-tld-1.nsa325.kwb

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325v2 bricked
March 01, 2025 03:40AM
Thanks bodhi for all the help you provided me.
This is the commands output:

root@debian:/tmp# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "uboot"
mtd1: 00080000 00020000 "stock_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"

root@debian:/tmp# ./tools/nanddump --noecc --omitoob -l 0x80000 -f mtd0.nsa325.2023.04-tld-1 /dev/mtd0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00080000...

root@debian:/tmp# diff mtd0.nsa325.2023.04-tld-1 uboot.2023.04-tld-1.nsa325.kwb     # (does not produce output)
root@debian:/tmp#

I will attach the dumped file here.

Edit 1: I will also post part of a log from the first flashing session ever because when going through all the guides and threads again I noticed that somethign was off on the stock fw_env.config file.
~ $ cat /etc/fw_env.config
# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, in this case the redundand
# environment sector is assumed present.
# Notice, that the "Number of sectors" is ignored on NOR.

# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
# NAND example
/dev/mtd1               0x0000          0x20000         0x20000                 4
This should have been /dev/mtd0 so did I flash something where I wasn't supposed to?

~ $ cat /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"

Edit 2: I will also post the original envs
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=AE03
PRODUCT_NAME=NSA-325v2
FEATURE_BIT=00
CONTRY_TYPE=FF
VENDOR_NAME=MitraStar Technology Corp.
run_diag=yes
ethaddr=XX:XX:XX:YY:YY:YY

Should I just try to flash the original uboot?
Thanks a lot



Edited 2 time(s). Last edit at 03/01/2025 03:55AM by ErGatto.
Attachments:
open | download - mtd0.nsa325.2023.04-tld-1 (512 KB)
Re: NSA325v2 bricked
March 01, 2025 10:49PM
ErGatto,

> # MTD device name Device offset Env. size
> Flash sector size Number of sectors
> # NAND example
> /dev/mtd1 0x0000 0x20000
> 0x20000 4
> [/code]
> This should have been /dev/mtd0 so did I flash
> something where I wasn't supposed to?
>

That was stock u-boot envs. So it does not come into play when you're booting with new u-boot. The only drawback is now you cannot boot into stock OS. You can restore this if you want to boot to stock again.

> Should I just try to flash the original uboot?

No, try flashing new u-boot again. And shutdown, disconnect power for a while (at least 30 minutes) and power up. See if it'll be better.

I'll take a look at the new nandwrite to see if I can find any clue.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325v2 bricked
March 02, 2025 09:39AM
bodhi Wrote:
-------------------------------------------------------
> disconnect power for a while (at least 30 minutes)
> and power up.

Why is that?
Re: NSA325v2 bricked
March 02, 2025 10:04AM
> No, try flashing new u-boot again. And shutdown,
> disconnect power for a while (at least 30 minutes)
> and power up. See if it'll be better.
>

Hello,
I tried doing that but still have the same issues.

I noticed that the board has a CR2032 battery, could these issues be caused by a bad battery?
I will go buy new batteries asap.
I actually had a new battery, so I just tried it but still the same.

Not really sure what to do now. Sometimes it boots to u-boot and tries to load the OS but it restarts during kernel loading.
It managed to boot Debian by itself (without serial console) just once. I will have to set up storage another way, at least until we can figure this out.



Edited 3 time(s). Last edit at 03/02/2025 10:39AM by ErGatto.
Re: NSA325v2 bricked
March 02, 2025 10:34PM
Mijzelf,

> > disconnect power for a while (at least 30
> minutes)
> > and power up.
>
> Why is that?

It's an exageration. Probably 1 minute is enough.

We don't know what the BootROM does (its code is Marvell proprietary), and kwboot works but not the version from NAND. The difference is the version in RAM vs the version read from NAND. Most likely different code in BootROM were used in each case.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325v2 bricked
March 02, 2025 10:38PM
ErGatto,

> I tried doing that but still have the same
> issues.
>
> I noticed that the board has a CR2032 battery,
> could these issues be caused by a bad battery?
> I will go buy new batteries asap.
> I actually had a new battery, so I just tried it
> but still the same.

I don't think the battery is causing this.

> Not really sure what to do now. Sometimes it boots
> to u-boot and tries to load the OS but it restarts
> during kernel loading.
> It managed to boot Debian by itself (without
> serial console) just once. I will have to set up
> storage another way, at least until we can figure
> this out.

For now, boot with kwboot so you can set up Debian while waiting. I'll post a slighly different flashing procedure for you to try.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325v2 bricked
March 03, 2025 01:07AM
> > Not really sure what to do now. Sometimes it
> boots
> > to u-boot and tries to load the OS but it
> restarts
> > during kernel loading.
> > It managed to boot Debian by itself (without
> > serial console) just once. I will have to set
> up
> > storage another way, at least until we can
> figure
> > this out.
>
> For now, boot with kwboot so you can set up Debian
> while waiting. I'll post a slighly different
> flashing procedure for you to try.

Hi Bodhi,
thanks again for your reply.
I will wait the new flashing procedure.
I am genuinely curious about the differences between my board and the boards of the other people who successfully managed to do this. Maybe I have a different revision of the BootROM or something similar.
I am not an expert but this is becoming very interesting.
Re: NSA325v2 bricked
March 03, 2025 02:57AM
ErGatto,

It probably is 0 like other NSA325 boards.

Power up, interrupt serial console u-boot countdown and dump BootROM version:
md ff00003c

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



Edited 1 time(s). Last edit at 03/03/2025 04:28AM by bodhi.
Re: NSA325v2 bricked
March 03, 2025 09:58AM
Hello,
this is what I get:
NSA325> md ff00003c
ff00003c: 00000121 e3a00000 e59f222c e5921000  !.......,"......
ff00004c: e2013008 e3530000 1a000002 e3811008  .0....S.........
ff00005c: e5821000 e5921000 e3a03000 ee2f3f1b  .........0...?/.
ff00006c: e59f2208 e5921000 e3c11cff e3c110ff  ."..............
ff00007c: e3710801 1a000003 e5921000 e3c114ff  ..q.............
ff00008c: e3c118ff e5821000 e59f21e0 e5922000  .........!... ..
ff00009c: e3a01902 e0112002 0a00000b e59f21d0  ..... .......!..
ff0000ac: e5921000 e3c11080 e5821000 e59f21c4  .............!..
ff0000bc: e5921000 e3c11080 e5821000 e59f21b8  .............!..
ff0000cc: e5921000 e3c1120f e5821000 e10f5000  .............P..
ff0000dc: e3c5501f e38550d3 e121f005 e3a05000  .P...P....!..P..
ff0000ec: ee075f17 ee075f16 ee075f15 ee085f17  ._..._..._..._..
ff0000fc: e59f2174 e3a03010 e5924000 e1c44003  t!...0...@...@..
ff00010c: e5824000 ee3f1f11 e3811505 ee2f1f11  .@....?......./.
ff00011c: e3a04003 ee034f10 e59f4160 ee024f10  .@...O..`A...O..
ff00012c: e3a03601 e3a02000 e3a01d06 e59f0150  .6... ......P...
Also today it booted to Debian without kwboot and on the first try. I left it powered down for 18 hours.
As always after a reboot it stops working with she symptoms described in the previous messages: hdd2 led light on, reboots every 30s or so, no serial output, takes multiple tries to get uboot to launch and it still reboots in about 30 seconds.



Edited 1 time(s). Last edit at 03/03/2025 10:02AM by ErGatto.
Re: NSA325v2 bricked
March 03, 2025 10:55PM
ErGatto,

> NSA325> md ff00003c
> ff00003c: 00000121

Interesting. The previous NSA325 boxes (v1 and v2) did not show BootROM version at all, eventhough it must be version 1.21 since kwboot works. The difference means BootROM is probably a different version, and it could be why the behavior changed.

> Also today it booted to Debian without kwboot and
> on the first try. I left it powered down for 18
> hours.

Also interesting, it could be something was clear after a long period without power.

> As always after a reboot it stops working with she
> symptoms described in the previous messages: hdd2
> led light on, reboots every 30s or so, no serial
> output, takes multiple tries to get uboot to
> launch and it still reboots in about 30 seconds.

And the watchdog barks again.

====

Try this test. After you booted successfully into Debian (either by kwboot or cold start), shutdown. Wait a few seconds/minutes, then press the power button to start booting again, see if it works consistently.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325v2 bricked
March 04, 2025 03:06AM
bodhi Wrote:
-------------------------------------------------------
> ErGatto,
>
> Try this test. After you booted successfully into
> Debian (either by kwboot or cold start), shutdown.
> Wait a few seconds/minutes, then press the power
> button to start booting again, see if it works
> consistently.

Hi bodhi,
thanks again for all your help.

I did that but unless I boot using kwboot it won't boot at all with the watchdog symptoms described before.
It can take several minutes just to get uboot to boot on its own and it could reset during the 10 seconds countdown.
Re: NSA325v2 bricked
March 04, 2025 03:48AM
ErGatto,

Let do the flashing procedure. Kwboot and login into Debian.

First we check the command to make sure (atm, I don't have access to an ARM box)
flash_erase --help

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA325v2 bricked
March 04, 2025 04:06AM
bodhi Wrote:
-------------------------------------------------------
> ErGatto,
>
> Let do the flashing procedure. Kwboot and login
> into Debian.
>
> First we check the command to make sure (atm, I
> don't have access to an ARM box)
>
> flash_erase --help
>

Sure,
I am using your linux tools binaries that I downloaded from this thread: https://forum.doozan.com/read.php?3,27280. Here's the output of the command:
root@debian:/tmp/tools# ./flash_erase --help
Usage: flash_erase [options] MTD_DEVICE <start offset> <block count>
Erase blocks of the specified MTD device.
Specify a count of 0 to erase to end of device.

  -j, --jffs2       format the device for jffs2
  -N, --noskipbad   don't skip bad blocks
  -u, --unlock      unlock sectors before erasing
  -q, --quiet       do not display progress messages
      --silent      same as --quiet
      --help        display this help and exit
      --version     output version information and exit
root@debian:/tmp/tools#
Re: NSA325v2 bricked
March 04, 2025 11:48PM
ErGatto,

Let's use the tools in the rootfs instead.

flash_erase /dev/mtd0 0 4
nandwrite --noecc /dev/mtd0 uboot.2023.04-tld-1.nsa325.kwb

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



Edited 1 time(s). Last edit at 03/04/2025 11:49PM by bodhi.
Re: NSA325v2 bricked
March 05, 2025 08:54AM
bodhi Wrote:
-------------------------------------------------------
> ErGatto,
>
> Let's use the tools in the rootfs instead.
>
>
> flash_erase /dev/mtd0 0 4
> nandwrite --noecc /dev/mtd0
> uboot.2023.04-tld-1.nsa325.kwb
>

Ok I will do that but right now I am out of town due to work issues. I will be able to retry to flash the uboot next week. Sorry about that. Thanks again.
Re: NSA325v2 bricked
March 05, 2025 09:27AM
ErGatto,

> Ok I will do that but right now I am out of town
> due to work issues. I will be able to retry to
> flash the uboot next week. Sorry about that.
> Thanks again.

No worries. Hacking should be at our own pace and deliberate. We all learn something out of the process.

-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: