OpenWrt support for Xiaomi AX3000T

Great news. In any case, we can already use self-compiled U-boot, and in the future - use U-boot from a snapshot for 24.10.

Deja vu, 3 months ago tried to start the discussion
OOB size is not a convenient question :slight_smile:

Not to my knowledge, sorry. In my experience it's often times less a converged effort and more various targets that started from upstream u-boot and had a couple of select tweaks applied.

2 Likes


Does this work for anyone?
It doesn't work for me. I tried it on several routers.
The firmware file download hangs at 4-5% and you can wait forever.
In the log it hangs at the following:

GET /
GET /main.js
GET /style.css
GET /version
GET /getmtdlayout
POST /upload
    Content-Length: 12976549

The 24.10.0 tab appeared without RC.
Not available for download and build yet.

The dialogue was not easy, but now we are moving towards a solution.

Yes, it works for me. Self-compiled @hanwckf's U-Boot for OpenWrt ubootmod (with disabled nmbm) works too (but probably it is no longer needed since @DragonBluep and @serverror made all necessary changes to OpenWrt U-Boot 2025.01).

i.e. you can load the firmware into this U-Boot as in the gif animation on the author's website and after that a button appears - "flash"?
On any router it freezes at the beginning of loading the firmware into RAM, and if you flash this bootloader onto the router's flash, as well as loading it into RAM using UART.
If the firmware is already installed, then it loads and works using this bootloader.

Try to clear browser cache and set static DHCP parameters of your LAN configuration on PC.

Without static it doesn't go in, it's written on the website, although having 2 MB for the bootloader it's not possible to make a DHCP, a strange decision.
I tried different browsers, in incognito and erasing the cache. It doesn't load any firmware.
If it's already installed in the router, it works well.

And as I already wrote, the bootloader freezes completely. It is impossible to connect to it with any browser, only a complete reboot with power off.

Ok, my rd03 with W25N01KV spi-nand and OOB=64 settings still works for several months on OpenWrt 23.0.5.5

We need this working in official builds, right?

3 Likes

If this was a rhetorical question, please use my feedback as a result of testing a case where OOB is set to 64.

1 Like

According to the datasheet, it’s indeed OOB (Out-Of-Band) 64 bytes in size, with an additional 32 bytes set aside for EEC.

Here we go OpenWrt 24.10.0 r28427-6df0e3d02a

1 Like

You might want to wait for the announcement topic even if the image is already compiled.

There have been broken releases in the past that had to be rebuilt.

4 Likes

They promised to make a working U-Boot with ForeSee, but somehow it didn’t work out.

Overall, I managed to restore the device.
I originally had firmware RD03 1.0.84 (CN), but now it's 1.0.90 (CN).
With this version, the device boots without issues and does not detect any bad blocks.

Boot log
[    0.708665] mtk-spi 1100a000.spi: Error applying setting, reverse things back
[    0.716384] spi-nand spi0.0: Foresee SPI NAND was found.
[    0.721699] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
...
[    0.864883] nmbm nmbm_spim_nand: Signature found at block 1023 [0x07fe0000]
[    0.872703] nmbm nmbm_spim_nand: First info table with writecount 0 found in block 960
[    0.882822] nmbm nmbm_spim_nand: Second info table with writecount 0 found in block 963
[    0.890827] nmbm nmbm_spim_nand: NMBM has been successfully attached 
[    0.897422] 12 fixed-partitions partitions found on MTD device nmbm_spim_nand
[    0.904558] Creating 12 MTD partitions on "nmbm_spim_nand":
[    0.910130] 0x000000000000-0x000000100000 : "BL2"
[    0.915349] 0x000000100000-0x000000140000 : "Nvram"
[    0.920713] 0x000000140000-0x000000180000 : "Bdata"
[    0.926052] 0x000000180000-0x000000380000 : "Factory"
[    0.931571] 0x000000380000-0x000000580000 : "FIP"
[    0.936781] 0x000000580000-0x0000005c0000 : "crash"
[    0.942134] 0x0000005c0000-0x000000600000 : "crash_log"
[    0.947830] 0x000000600000-0x000002800000 : "ubi"
[    0.953073] 0x000002800000-0x000004a00000 : "ubi1"
[    0.958393] 0x000004a00000-0x000006a00000 : "overlay"
[    0.963982] 0x000006a00000-0x000007600000 : "data"
[    0.969268] 0x000007600000-0x000007640000 : "KF"
...
[    5.731263] UBI: auto-attach mtd8
[    5.734606] ubi0: attaching mtd8
[    5.834106] ubi0: scanning is finished
[    5.842407] ubi0: attached mtd8 (name "ubi", size 34 MiB)
[    5.847810] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    5.854679] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    5.861458] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    5.868407] ubi0: good PEBs: 272, bad PEBs: 0, corrupted PEBs: 0
[    5.874404] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[    5.881614] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 2089598252
[    5.890733] ubi0: available PEBs: 75, total reserved PEBs: 197, PEBs reserved for bad PEB handling: 19
[    5.900030] ubi0: background thread "ubi_bgt0d" started, PID 595
[    5.900675] block ubiblock0_1: created from ubi0:1(rootfs)
[    5.911507] ubiblock: device ubiblock0_1 (rootfs) set to be root filesystem
[    5.918650] Failed to lock mtd obr
[    5.932576] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
...
[   11.277616] ubi1: attaching mtd10
[   11.372556] ubi1: scanning is finished
[   11.381012] ubi1: attached mtd10 (name "overlay", size 32 MiB)
[   11.386849] ubi1: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   11.393713] ubi1: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   11.400490] ubi1: VID header offset: 2048 (aligned 2048), data offset: 4096
[   11.407439] ubi1: good PEBs: 256, bad PEBs: 0, corrupted PEBs: 0
[   11.413435] ubi1: user volume: 1, internal volumes: 1, max. volumes count: 128
[   11.420646] ubi1: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 255938732
[   11.429676] ubi1: available PEBs: 0, total reserved PEBs: 256, PEBs reserved for bad PEB handling: 19
[   11.438889] ubi1: background thread "ubi_bgt1d" started, PID 709
UBI device number 1, total 256 LEBs (32505856 bytes, 31.0 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[   11.481383] UBIFS (ubi1:1): Mounting in unauthenticated mode
[   11.487257] UBIFS (ubi1:1): background thread "ubifs_bgt1_1" started, PID 739
[   11.515686] UBIFS (ubi1:1): recovery needed
[   11.597572] UBIFS (ubi1:1): recovery completed
[   11.602075] UBIFS (ubi1:1): UBIFS: mounted UBI device 1, volume 1, name "cfg"
[   11.609204] UBIFS (ubi1:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   11.619107] UBIFS (ubi1:1): FS size: 28315648 bytes (27 MiB, 223 LEBs), journal size 1396736 bytes (1 MiB, 11 LEBs)
[   11.629527] UBIFS (ubi1:1): reserved for root: 1337417 bytes (1306 KiB)
[   11.636134] UBIFS (ubi1:1): media format: w5/r0 (latest is w5/r0), UUID 0A350D33-DA1F-4078-BCD7-3F8F089ED648, small LPT model
[   11.660392] urandom-seed: Seed file not found (/etc/urandom.seed)

How did I restore it?

I performed a full erase.force on the NAND to remove all bad blocks information.
Then, I flashed the firmware in parts, using Nvram and Bdata dumps created by xmir-patcher during the first flashing process in the outdir directory and parts from 1.0.90 firmware.

For BL2, I used:
openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-preloader.bin.

The result?

A working device on stock firmware.

What happened when I tried to install OpenWrt again?

The same failure occurred.

The stock firmware successfully executes xqsystem/start_binding, allowing ubiformat to work without issues:

ubiformat /dev/mtd9 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi

However, as soon as the device boots into initramfs-factory, it starts marking bad blocks on the very first boot.

As a result, further execution is impossible:

sysupgrade -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin

Due to the large number of marked bad blocks, the device fails to boot.


I can only assume that this is some kind of issue with the NMBM driver in the OpenWrt kernel.

As a result, anyone who tries to install OpenWrt on this device will end up with a brick.


@remittor what do you think about this?

4 Likes
nmbm state after OpenWrt sysupgrade
MT7981> nmbm nmbm0 state
Physical blocks:

Legends:
  -     Good data block
  +     Good management block
  B     Bad block
  I     Main info table
  i     Backup info table
  M     Remapped spare block
  S     Signature block

    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ------------------------------------------------------------BBBB
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    -----------------------------------------------B-----------iiiii
    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBi+S

Logical blocks:

Legends:
  -     Good block
  +     Initially remapped block
  M     Remapped block
  B     Bad/Unmapped block

    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ------------------------------------------------------------++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++?????MT7981>

nmbm state after nand erase
MT7981> nmbm nmbm0 state
Physical blocks:

Legends:
  -     Good data block
  +     Good management block
  B     Bad block
  I     Main info table
  i     Backup info table
  M     Remapped spare block
  S     Signature block

    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    I++i+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++S

Logical blocks:

Legends:
  -     Good block
  +     Initially remapped block
  M     Remapped block
  B     Bad/Unmapped block

    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
MT7981>
2 Likes

If there is interest you can try this bootloader with the firmware version (OpenWrt U-Boot layout).
It works right now on the exact same router. I was unable to load the firmware from the web interface of this flasher, but following the instructions from WIKI, flashing it instead of the currently non-working U-Boot OpenWrt, everything works great. Perhaps with it your flash memory will not die.
Good luck!

If it is broken, that's the last we've heard of @Gizmodo1