Nas542 dead + spi_flash_dead + barebox_dead + Uloader_dead
All Replies
-
Barebox-C2K >/ printenv
locals:
PATH=/env/bin
ip=dhcp
kernel_loc=nand
rootfs_loc=nand
uloaderimage=microloader-c2kevm.bin
bareboximage=barebox-c2kevm.bin
mfg_kernel_img=uImage_MFG
mfg_rootfs_img=rootfs_ubi.img_MFG
rootfs_type=ubifs
rootfsimage=root.ubifs-128k
kernelimage_type=uimage
kernelimage=uImage
spi_parts=256k(uloader)ro,512k(barebox)ro,256k(env)
spi_device=spi0.0
nand_device=comcertonand
nand_parts=10M(config),10M(kernel1),110M(rootfs1),10M(kernel2),110M(rootfs2),-(reserved)
rootfs_mtdblock_nand=2
autoboot_timeout=3
usb3_internal_clk=yes
bootargs=console=ttyS0,115200n8, init=/etc/preinit pcie_gen1_only=yes mac_addr=,,
next_bootfrom=2
curr_bootfrom=2
kernel_mtd_1=4
sysimg_mtd_1=5
kernel_mtd_2=6
sysimg_mtd_2=7
MODEL_ID=B403
fwversion_1=V5.21(ABAG.6)C0
fwversion_2=V5.21(ABAG.6)C0
revision_1=51201
revision_2=51201
modelid_1=B403
modelid_2=B403
core_checksum_1=ce70d927b52d5e04f0dd6773fd0f8dd3
core_checksum_2=ce70d927b52d5e04f0dd6773fd0f8dd3
zld_checksum_1=1a3fddc58e0c799fd695f7800bb5f058
zld_checksum_2=1a3fddc58e0c799fd695f7800bb5f058
romfile_checksum_1=95CC
romfile_checksum_2=95CC
img_checksum_1=4585723149e6689c4c335893e7f82b66
img_checksum_2=4585723149e6689c4c335893e7f82b66
serial_number=S190Z22001774
ethaddr=54:83:3A:A2:85:DA
eth2addr=54:83:3A:A2:85:DB
change_boot_part=1
globals:
Barebox-C2K >/ ▒0 -
Barebox-C2K >/ eth0.ipaddr=192.168.2.55
Barebox-C2K >/ eth0.serverip=192.168.2.50
Barebox-C2K >/ tftp -f uImage.bin -a 30010000
tftp: invalid option -- f
tftp: invalid option -- a
warning: No MAC address set. Using random address 6A:C9:1F:45:E2:FC
TFTP from server 192.168.2.50 ('uImage.bin' -> '30010000')
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#
Barebox-C2K >/I flashed uImage.bin from 542 but there is no result(((
0 -
So far I don't know what to do, but a few things are unclear.
After flashing my mtd2 backup, the environment contained
MODEL_ID=B103
fwversion_1=V5.04(AATB.0)
fwversion_2=V5.11(AATB.2)
revision_1=46843
revision_2=49397But later it was
MODEL_ID=B403
fwversion_1=V5.21(ABAG.6)C0
fwversion_2=V5.21(ABAG.6)C0
revision_1=51201
revision_2=51201So you edited the MODEL_ID, and flashed it twice?
Hit any key to stop autoboot: 1
usage: update -t <kernel|rootfs|barebox|bareboxenv> -d <nor|nand> [-m tftp|xmodem|ddr] [-f imagename|-a address] -c update tools.This is without hitting a key, I suppose? It should have been
Hit any key to stop autoboot: 3## 2## 1## 0
booting kernel of type uimage from /dev/nand0.kernel1.bb(See bootlog)
This means the startscripts are damaged. As it booted before (calling the script in the flash drive is part of the init scripts of the Linux firmware), apparently it became damaged as result of flashing a new firmware.
Bad eraseblock 1536 at 0x0c000000
Bad eraseblock 1537 at 0x0c020000As far as I can see, that is inside the rootfs2 partition
[ 3.838844] 0x000000000000-0x000000a00000 : "config"
[ 3.864991] 0x000000a00000-0x000001400000 : "kernel1"
[ 3.883882] 0x000001400000-0x000008200000 : "rootfs1"
[ 3.911019] 0x000008200000-0x000008c00000 : "kernel2"
[ 3.929970] 0x000008c00000-0x00000fa00000 : "rootfs2"
[ 3.954358] 0x00000fa00000-0x000010000000 : "reserved"That could have been part of the cause of your original problem. As you can see the bootloader environment contains a few checksums. One of them is the checksum of the rootfs 'blob' in rootfs[1,2] and on harddisk. Normally it uses the blob on harddisk, which is much faster than nand. On boot it calculates the checksum of the harddisk blob, and compares that with the checksum in bootloader enviroment. When it doesn't match, it extracts a new blob from rootfs[1,2]. Normally that is only done on a new harddisk, or when the firmware is updated. But if the bootloader environment got corrupted it might do it every boot. When the rootfs partition gets a bad block, you end up with a box without valid rootfs.
This doesn't help anything, just background.
0 -
I seem to remember someone posted an recipe to restore the bootloader boot scripts in this forum. (Which are not in NAND flash, btw, but in SPI NOR flash. mtd0 - 2 are NOR, and mtd3-8 are NAND. The box can't boot from NAND, but NAND is much cheaper than NOR. So that is why the bootloader is in 1MB NOR, while the firmware is in 512(?) MB NAND).
I think the scripts are also in mtd2. It is 256kB in size, which is a bit bulky for the few environment settings.
0 -
Hit any key to stop autoboot: 1
booting kernel of type uimage from /dev/nand0.kernel2.bb
Bad Header Checksum
Failed.
booting kernel of type uimage from /dev/nand0.kernel1.bb
Bad Header Checksum
warning: No MAC address set. Using random address 36:66:39:7C:10:66
T DHCP client bound to address 192.168.2.52
DHCP client bound to address 192.168.2.52Maybe there are some commands to upload the firmware again? I don't understand what happened at all(((
0 -
Hit any key to stop autoboot: 1
booting kernel of type uimage from /dev/nand0.kernel2.bb
Bad Header Checksum
Failed.
booting kernel of type uimage from /dev/nand0.kernel1.bb
Bad Header Checksum
warning: No MAC address set. Using random address 36:66:39:7C:10:66
T DHCP client bound to address 192.168.2.52
DHCP client bound to address 192.168.2.52
ping failed: Interrupted system callMaybe there are some commands to upload the firmware again? I don't understand what happened at all(((
0 -
I flashed uImage.bin from 542 but there is no result(((
If you means the log above, you didn't flash it, only put it in ram.
Maybe there are some commands to upload the firmware again?
'Normally' a NAS5xx boots a kernel with embedded initramfs, which contains a script which can execute a script from flash disk, which can flash a new firmware. So assuming the base (bootloader + environment) is healthy, the procedure is download a kernel using tftp, and boot it.
On u-boot, the bootloader which is almost universally used for embedded linux, the command would be
tftp image.bin 30010000 bootm 30010000
which means, load a file image.bin from the tftp server (which IP is in the environment) to memory address 30010000, and then boot the module at address 30010000.
This box uses barebox, which was supposed to be the successor of u-boot, and everything is slightly different. You already managed to load a module in memory, now you only need to boot it. Maybe the instructions are in the same thread?
If you manage to boot that kernel, you can use your upgrade flash disk to flash new firmware. But of course you did that before, and in didn't lead to a working box. The log looks normal to me. Some complaints about a missing sqlite3 and other tools, but hey, this is ZyXEL. It's normal that the scripts are not cleaned up after adapting them from another model.
0 -
I found some solution:
eth0.ipaddr=192.168.1.191
eth0.serverip=192.168.1.139
addpart /dev/mem 8M@0x8000 (kernelraw)
addpart /dev/mem 8M@8M (kernel)
netload="/dev/mem.kernel"
tftp uImage.520.bin $netload
bootm ${netload}
После перезагрузки загрузилась флешка с telnet.
/ $ /firmware/sbin/info_printenv
Open /dev/mtd2 voidThis works until reboot. Then you have to do everything all over again.Tried flashing from a flash drive - no result.
0 -
/ $ /sbin/flash_erase /dev/mtd2 0 0
flash_erase: error!: /dev/mtd2
error 13 (Permission denied)
/ $ dd if=/mnt/partnerkey/nas540.mtd2 of=/dev/mtd2 bs=64k
dd: can't open '/mnt/partnerkey/nas540.mtd2': No such file or directory0 -
FW_FILE=/mnt/partnerkey/nas5xx_fw/ras.bin
NANDPATH=/firmware/mnt/nand2
/firmware/sbin/info_printenv curr_bootfrom
awk -F= {print $2}
CURR_BOOTFROM=
[ -eq 1 ]
sh: 1: unknown operand[ -eq 2 ]
sh: 2: unknown operandecho ERROR!!! Invalid INFO value 'curr_bootfrom'!
ERROR!!! Invalid INFO value 'curr_bootfrom'!setLED SYS RED BLINK
led_state_map_addr = 409setLED HD RED BLINK
Unknown LED
Turn on LED
Usage: setLED LED_NAME LED_COLOR LED_STATE
LED_NAME: The name of LED. (HDD1, HDD2, HDD3, HDD4, SYS, COPY)
LED_COLOR: LED color. (RED , GREEN)
LED_STATE: ON, BLINK, FAST_BLINK, SLOW_BLINK
ATTENTION: LED2 can only be red colorTurn off LEDUseage: setLED LED_NAME OFF
LED_NAME: The name of LED. (HDD1, HDD2, HDD3, HDD4, SYS, COPY)
OFF : OFFsetLED COPY RED BLINK
led_state_map_addr = 509exit 1
0
Categories
- All Categories
- 438 Beta Program
- 2.7K Nebula
- 189 Nebula Ideas
- 121 Nebula Status and Incidents
- 6.2K Security
- 458 USG FLEX H Series
- 304 Security Ideas
- 1.6K Switch
- 81 Switch Ideas
- 1.3K Wireless
- 44 Wireless Ideas
- 6.8K Consumer Product
- 279 Service & License
- 438 News and Release
- 88 Security Advisories
- 31 Education Center
- 10 [Campaign] Zyxel Network Detective
- 4.3K FAQ
- 34 Documents
- 34 Nebula Monthly Express
- 85 About Community
- 91 Security Highlight