Dynalink WRX-36 bricked

Hi! I recently got my hands on a Dynalink WRX-36 as I wanted to replace the Spectrum router that I am using. As I was installing openwrt, I skipped this command in step 4 "ubiformat /dev/mtd20 -y -f /tmp/factory_image.ubi" as it was spitting an error about how I needed to unmount mtd20 from ubi0 (can't remember words exactly), and I got impatient, skipped ONLY that step, and now can't boot correctly .


This is what I got from a serial connection to the router. It appears that what happened is that since it wasn't formatted correctly, it's getting stuck on boot trying to load an incorrectly formated ubi0. I was wondering if I could correctly format mtd20 from serial or at least reset it so I can try again (perhaps from usb via serial?).

If you have serial console access, you should be able to tftpboot an OpenWrt initramfs image and fix your installation from there (respectively booting from USB, with the according bootloader configuration).

What @slh said.

just follow the serial install alternative, instead of the ssh.

https://openwrt.org/toh/dynalink/dl-wrx36#tab__part_1_option_b_-_use_a_serial_connection_33v_to_copy_and_boot_initramfs

I have already done the serial install alternative, but I am unable to actually boot as the rootfs partitions are messed up (so I can't do part 2 requiring ssh). It hangs in the above image.

Sorry, we can't help you with "it doesn't work".

I have never heard about that exact error condition, so below is partly based on guesses...

So, you have apparently completed the mtd18 part in step 4 ?
And you can still get into u-boot console during the boot, as you have serial.
Right?

In that case you should now have OpenWrt image in mtd18, and you are now trying to boot from failed mtd20.

We are writing two OpenWrt images, one to both of OEM dual-boot partitions, although we only support single-parition boot. That might help you.

I think that you might recover by toggling the one u-boot variable "mtdparts" (= the offset to the correct image) to point to the alternative partition. not mtd20 but mtd18...

7. Set U-boot env variable:
   If current OEM slot is 1, run:
   # fw_setenv mtdparts 'mtdparts=nand0:0x6100000@0x1000000(fs),0x6100000@0x7a00000(fs_1)'
   If current OEM slot is 2, run:
   # fw_setenv mtdparts 'mtdparts=nand0:0x6100000@0x7a00000(fs),0x6100000@0x1000000(fs_1)'

Check the current variable value there, and set it to the the other offset.

Environment variables are set using “env set” (alias “setenv”), printed using “env print” (alias “printenv”), and saved to persistent storage using “env save” (alias “saveenv”). Using “env set” without a value can be used to delete a variable from the environment. As long as you don’t save the environment, you are working with an in-memory copy. In case the Flash area containing the environment is erased by accident, a default environment is provided.

2 Likes

The caveat here is that I am not quite sure if that variable only concerns the rootfs, or also kernel. The kernel start offset might just be determined from the OEM dual-boot toggle. :frowning:

The other route might be to look into u-boot variables controlling dual-boot, and try to toggle that, so that it would try mtd18 instead of mtd20. (might be just 1 or 2, or even 1 and 0)
Note that this might require also doing the action I mentioned in my previous message.

EDIT:
Looking at my own DL-WRX36, there seems to be no other relevant variable except 'mtdparts':

 OpenWrt SNAPSHOT, r26300-da0cd9d764
 -----------------------------------------------------
root@router5:~# fw_printenv
baudrate=115200
bootcmd=run openwrtusb; run openwrtboot
bootdelay=2
console_unlock=1
defaultbootcmd=setenv bootargs console=ttyMSM0,115200n8 ubi.mtd=rootfs rootfstype=squashfs rootwait; ubi part fs; ubi read 0x44000000 kernel; bootm 0x44000000#config@rt5010w-d350-rev0
eth1addr=2c:ea:dc:85:e3:3c
eth2addr=2c:ea:dc:85:e3:3c
eth3addr=2c:ea:dc:85:e3:3c
eth4addr=2c:ea:dc:85:e3:3c
ethact=eth0
ethaddr=2c:ea:dc:85:e3:3b
fdt_high=0x4A400000
fdtcontroladdr=4a971480
flash_type=2
machid=8850105
mtdids=nand0=nand0
mtdparts=mtdparts=nand0:0x6100000@0x1000000(fs),0x6100000@0x7a00000(fs_1)
openwrtboot=setenv bootargs console=ttyMSM0,115200n8 ubi.mtd=rootfs rootfstype=squashfs rootwait; ubi part fs; ubi read 0x44000000 kernel; bootm 0x44000000#config@rt5010w-d350-rev0
openwrtusb=usb start && fatload usb 0:1 0x44000000 openwrt-ipq807x-generic-dynalink_dl-wrx36-initramfs-uImage.itb && bootm 0x44000000
soc_version_major=2
soc_version_minor=0
stderr=serial@78B3000
stdin=serial@78B3000
stdout=serial@78B3000

Note that I have there also the USB fallback defined in bootcmd and related new variables. You might also use that, to boot a initramfs image from an USB stick.

As long as you have serial and access to u-boot console, you can recover.

bootcmd=run openwrtusb; run openwrtboot
openwrtboot=setenv bootargs console=ttyMSM0,115200n8 ubi.mtd=rootfs rootfstype=squashfs rootwait; ubi part fs; ubi read 0x44000000 kernel; bootm 0x44000000#config@rt5010w-d350-rev0
openwrtusb=usb start && fatload usb 0:1 0x44000000 openwrt-ipq807x-generic-dynalink_dl-wrx36-initramfs-uImage.itb && bootm 0x44000000