OpenWrt support for Asus RT-AX53U

Hi,

Can you please describe very briefly what is the TFTP procedure for this router?
I tried so far both server and client mode, without being able to trigger the tftp transfer.

Here is what I did so far:

  • set router LAN IP: 192.168.1.1
  • set laptop IP (running win 11) to 192.168.1.2
  • downloaded tftpd64 and configured to listen to the appropriate interface (the laptop's ethernet 192.168.1.2)
  • in tftpd64 I have exposed the directory containing file openwrt-ramips-mt7621-asus_rt-ax53u-squashfs-factory.bin
  • turned off/on router with ethernet cable connected to LAN port 1 (tried also LAN 3)
  • waited for the system to boot (takes about 30-40 seconds until it loads the OS)
  • nothing happens in this time
  • I have also tried turning on the router with the Reset button pressed - same result, nothing happens
  • I have tried also to use the tftp client command tftp -i 192.168.1.1 PUT openwrt-ramips-mt7621-asus_rt-ax53u-squashfs-factory.bin

Thanks!

Before this you need to

  • set up the usb-to-serial connected to the router board as instructed on the wiki
  • plug the usb-to-serial to your pc and open a serial emulator terminal

at this point you should see data coming off the previously set terminal, you must interrupt u-boot in order to flash the openwrt factory image

the whole process (with example of what you should see on the console) is documented here

Thank you, @darca, it's very clear now.
I was under the impression that the tftp transfer can be done without the usb-to-ttl dongle.
In fact, it was pretty obvious that the only way the Uboot menu described above "2. Upgrade firmware; 0 - TFTP client (Default)" could be shown, is via a serial terminal connected to the COM port of the dongle.

Has anyone succeded uploading the openwrt binary using the mtd-write command ?

you need to upgrade to the latest snapshots
if the version of the kernel changes on the snapshot, the other official packages will be updated to the compatibility with the new kernel, and if you stay on the older one you'll get this message since package and kernel are not compatible

the upgrade process is easy, it even keeps your configuration, you can do it through luci
only thing to keep in mind is that any "custom" package you have installed after the initial flash, will need to be manually reinstalled after the snapshot update. this includes luci itself (as it's not bundled with snapshot releases)

ssh is not sufficient unfortunately. there are two options to flash firmware without usb-to-serial adapter from OEM firmware:

  • asus own utility for restoring the firmware (not working)
  • OEM web interface flash (not working)

the second one, might be interesting to "hack" since asus uploaded the sourcecode and build tools for the OEM firmware
we just need someone with the time to

  • find the firmware check on the oem web ui
  • remove it
  • make a custom build that we can use as a stepping stone to flash openwrt without any hardware tinkering

Actually, this utility acts as a TFTP client, and the router as a TFTP server (when powered on while holding the reset button).
I was able to flash OpenWRT in this mode, however if failed boot, see . It looks like the image should be built differently for the restoration flash method.

Flashing with mtd-write via ssh also works. Just need to flash factory image to "Kernel" partition instead of "linux".

This is what I did:

wget https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-asus_rt-ax53u-squashfs-factory.bin
mtd-write -i openwrt-ramips-mt7621-asus_rt-ax53u-squashfs-factory.bin -d Kernel
3 Likes

This works without usb to serial adapter directly from ssh or?

Yes, you don't need to do anything physically with the router. Just enable ssh in stock fw settings and then login with the same credentials that you login to the web ui.

1 Like

I confirm it works! I have successfully installed openwrt by using the mtd-write command via ssh.
@vvoland, thanks a lot for your extremely useful hint!

LE: I am a bit surprised that the size of the root partition is only 33.3 MB:

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.8M      3.8M         0 100% /rom
tmpfs                   122.1M      1.2M    120.8M   1% /tmp
/dev/ubi0_1              33.3M      5.8M     25.7M  18% /overlay
overlayfs:/overlay       33.3M      5.8M     25.7M  18% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000e0000 00020000 "u-boot"
mtd1: 00100000 00020000 "u-boot-env"
mtd2: 00100000 00020000 "factory"
mtd3: 00100000 00020000 "factory2"
mtd4: 00400000 00020000 "kernel"
mtd5: 02e00000 00020000 "ubi"
mtd6: 03200000 00020000 "firmware2"
1 Like

Anyone tested CAKE performance / WiFi throughput using iperf3?

2 Likes

thank you man! that is really good to know and I see that the wiki has already been updated, wonderful!

1 Like

Can you please confirm what is the size of the overlay partition on your AX53U routers?
I know the device has 128MB, but in my case it seems that only 33.3 MB are available (which is quite small even for a minimal list of packages):

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.8M      3.8M         0 100% /rom
tmpfs                   122.1M      1.2M    120.8M   1% /tmp
/dev/ubi0_1              33.3M      5.8M     25.7M  18% /overlay
overlayfs:/overlay       33.3M      5.8M     25.7M  18% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000e0000 00020000 "u-boot"
mtd1: 00100000 00020000 "u-boot-env"
mtd2: 00100000 00020000 "factory"
mtd3: 00100000 00020000 "factory2"
mtd4: 00400000 00020000 "kernel"
mtd5: 02e00000 00020000 "ubi"
mtd6: 03200000 00020000 "firmware2"

Thanks

I agree. Same with me. how to fix it?

Modify the source code, test it and if it works submit a patch :v:

Has anyone tried to test another GPIOs for missing leds?

According to SDK, GPIO 14 should control USB led.
There is also commented code about 2GHz WiFi LED on GPIO 18 and 5GHz WiFi LED on GPIO 28.
Have not checked it.

I found the dts file containing the RT-AX53U definitions:

Only the last 3 partitions are r/w: kernel, ubi and firmware2.

mtd layout in dmesg log output:

Creating 7 MTD partitions on "mt7621-nand":
0x000000000000-0x0000000e0000 : "u-boot"
0x0000000e0000-0x0000001e0000 : "u-boot-env"
0x0000001e0000-0x0000002e0000 : "factory"
0x0000002e0000-0x0000003e0000 : "factory2"
0x0000003e0000-0x0000007e0000 : "kernel"
0x0000007e0000-0x0000035e0000 : "ubi"
0x0000035e0000-0x0000067e0000 : "firmware2"

Converted to decimal and further converted to kB:

start (kB) end (kB) size (kB) partition name
0 896 896 u-boot
896 1920 1024 u-boot-env
1920 2944 1024 factory
2944 3968 1024 factory2
3968 8064 4096 kernel
8064 55168 47104 ubi
55168 106368 51200 firmware2

Assumingly, the overlay partition is the one labelled "ubi" (I couldn't find too much information about the mediatek flash layout), with a size of 47104 kB.
Why only 46 MB?
Perhaps the last partition (firmware2) should be concatenated to ubi, for a total amount of 46MB+50MB=96MB?
This would be much closer to the real flash size...

Can someone (who still has the original FW) post the flash layout stored in the dmesg log? thanks

PS: for comparison, here is the flash layout of a Xiaomi Mi Router 3, also with 128MB flash, running X-Wrt (as you can see, the size of the ubi partition is 118 MB):

Creating 10 MTD partitions on "ra_nfc":

start (kB) end (kB) size (kB) partition name
0 256 256 Bootloader
256 512 256 Config
512 768 256 Bdata
768 1024 256 factory
1024 1280 256 crash
1280 1536 256 crash_syslog
1536 2048 512 reserved0
2048 6144 4096 kernel_stock
6144 10240 4096 kernel
10240 131072 120832 ubi

The overlay partition size is 91.6 MB:

[root@tlc76] ~$ df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                10.3M     10.3M         0 100% /rom
devtmpfs                 59.0M         0     59.0M   0% /rom/dev
tmpfs                    59.5M      1.3M     58.2M   2% /tmp
/dev/ubi0_1              91.6M     29.6M     57.3M  34% /rom/overlay
overlayfs:/overlay       91.6M     29.6M     57.3M  34% /
tmpfs                     1.0M         0      1.0M   0% /mnt
tmpfs                   512.0K         0    512.0K   0% /dev

I believe the correct partition table should be like this:

start (kB) end (kB) size (kB) partition name
0 896 896 u-boot
896 1920 1024 u-boot-env
1920 2944 1024 factory
2944 3968 1024 factory2
3968 8064 4096 kernel
8064 131072 123008 ubi

I created PR #10502

1 Like

Should the update (using sysupgrade with preserving conf-files) work after this PR?