Flashing carries a risk of bricking the device. Always complete a full backup before proceeding and copy the backup to another device for safekeeping.
Never power off the device while writing BL2, FIP, or running sysupgrade.
1. Compatible Models
| Item | Details |
|---|---|
| Model | Xiaomi AX3000T (China version) |
| Variant | RD03 |
| Stock firmware version | 1.0.84 |
| Target firmware | ImmortalWrt 25.12.1 |
| Target layout | OpenWrt U-Boot layout / ubootmod |
Firmware download page:
This guide applies only to the MediaTek version RD03.
The RD03V2 Qualcomm version uses a different process and must not follow these steps.
Use only ubootmod firmware throughout. Do not mix with stock layout images.
2. Preparation
Hardware
- Xiaomi AX3000T
- Windows PC
- One Ethernet cable
- Router LAN port
Connect the PC to a LAN port on the router; do not use the WAN port.
Software
- xmir-patcher
- PowerShell or Windows Terminal
- Web browser
Firmware Files
Download the following 5 files from the Firmware Selector:
| File | Purpose |
|---|---|
initramfs-factory.ubi | Boot from stock into temporary ImmortalWrt |
preloader.bin | Write BL2 |
bl31-uboot.fip | Write FIP / U-Boot |
initramfs-recovery.itb | Recovery image |
squashfs-sysupgrade.itb | Final system image |
Example:
immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-factory.ubi
immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-preloader.bin
immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-bl31-uboot.fip
immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-squashfs-sysupgrade.itb
Image directory:
https://downloads.immortalwrt.org/releases/25.12.1/targets/mediatek/filogic/
3. Enable SSH and Create a Backup
Confirm you can access in a browser:
http://192.168.31.1
Extract xmir-patcher and run:
run.bat
Execute the following in order:
| Action | Menu |
|---|---|
| Set router IP | 1 |
| Connect to router and enable SSH | 2 |
| Create a full backup | 4 |
| Change root password | 8 → 2 |
| Return to main menu | 0 |
| Persist SSH | 6 |
The backup directory is usually at:
backups/
It should at least contain:
mtd1_BL2.bin
mtd4_Factory.bin
mtd5_FIP.bin
mtd8_ubi.bin
It is recommended to back up the entire backups folder.
Main menu 6 persists SSH; option 6 in the extended menu changes the boot address—do not select it by mistake.
If you enter it by mistake, press Ctrl+C to exit, then enter 0 to return to the main menu.
Verify SSH
Host: 192.168.31.1
User: root
Password: the root password you just set
After logging in you should see:
Welcome to XiaoQiang!
This indicates SSH has been successfully enabled.
4. Upload Firmware
Stock Xiaomi Dropbear has poor SFTP compatibility; use PowerShell scp instead.
After entering the firmware directory, run:
scp -O `
-o HostKeyAlgorithms=+ssh-rsa `
-o PubkeyAcceptedAlgorithms=+ssh-rsa `
.\immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-* `
root@192.168.31.1:/tmp/
On first connection, enter:
yes
Then enter the root password.
Log in to the router and check:
ls -lh /tmp/immortalwrt*
cat /proc/mtd
You should see the 5 firmware files and partitions similar to:
mtd8: "ubi"
mtd9: "ubi1"
5. Flash Temporary ImmortalWrt
First confirm the current boot partition:
cat /proc/cmdline
nvram get flag_boot_rootfs
nvram get flag_last_success
Currently running on mtd8
If you see:
firmware=0
mtd=ubi
flag_boot_rootfs=0
This means the current system is running on mtd8; write the factory image to the free mtd9:
ubiformat /dev/mtd9 -y -f /tmp/immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-factory.ubi
Then switch the boot partition:
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
reboot
Currently running on mtd9
If it shows firmware=1, write to mtd8:
ubiformat /dev/mtd8 -y -f /tmp/immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-factory.ubi
And set the following two values to 0:
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
Keep the other boot parameters the same, commit, then reboot.
The currently running UBI partition cannot be formatted directly.
If you get Permission denied, you have usually selected the partition where the current system is running; flash the other one instead.
6. Enter the Temporary System
After reboot, wait about 1–2 minutes, then access:
http://192.168.1.1
SSH:
ssh root@192.168.1.1
The temporary system usually has no root password.
If you cannot access it, temporarily set a static IP on the PC:
IP: 192.168.1.10
Subnet mask: 255.255.255.0
Gateway: 192.168.1.1
At this point you have only entered temporary ImmortalWrt; the U-Boot layout conversion is not yet complete.
7. Write the U-Boot Layout
After reboot, /tmp is cleared, so you need to re-upload the firmware:
scp -O `
-o HostKeyAlgorithms=+ssh-rsa `
-o PubkeyAcceptedAlgorithms=+ssh-rsa `
.\immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-* `
root@192.168.1.1:/tmp/
Log in:
ssh `
-o HostKeyAlgorithms=+ssh-rsa `
-o PubkeyAcceptedAlgorithms=+ssh-rsa `
root@192.168.1.1
7.1 Install mtd-rw
apk --update-cache add kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
No error from insmod is fine.
If during installation you see:
Killed
This is usually due to insufficient memory on the temporary system; try running the command again, or first confirm the WAN is connected to the internet.
7.2 Rebuild UBI
ubidetach -p /dev/mtd8
ubiformat /dev/mtd8 -y
ubiattach -p /dev/mtd8
If ubidetach reports:
No such device
It can usually be ignored.
Create U-Boot environment volumes:
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
7.3 Write Recovery
The ImmortalWrt 25.12.1 recovery image is about 13.1 MB, so create a 14MiB volume:
ubimkvol /dev/ubi0 -n 2 -N recovery -s 14MiB
ubiupdatevol /dev/ubi0_2 /tmp/immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
If you previously created it as 10MiB by mistake:
ubirmvol /dev/ubi0 -n 2
ubimkvol /dev/ubi0 -n 2 -N recovery -s 14MiB
ubiupdatevol /dev/ubi0_2 /tmp/immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
7.4 Write BL2 and FIP
This is the most critical step. Confirm the filenames are correct and ensure the router does not lose power.
mtd write /tmp/immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-preloader.bin BL2
mtd write /tmp/immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-bl31-uboot.fip FIP
Seeing output similar to the following and returning to the command line means the write is complete:
Unlocking ...
Writing ...
7.5 Flash the Final System
sysupgrade -n /tmp/immortalwrt-25.12.1-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-squashfs-sysupgrade.itb
Under normal circumstances you will see:
Signature check OK
Then SSH will disconnect automatically:
Connection closed
This is normal. Wait about 2–3 minutes and do not power off during this time.
8. Verification
Access:
http://192.168.1.1
The status page should show something like:
Hostname: ImmortalWrt
Model: Xiaomi Mi Router AX3000T (OpenWrt U-Boot layout)
Target platform: mediatek/filogic
Firmware version: ImmortalWrt 25.12.1
After completion, it is recommended to:
- Set a root password
- Set the PC network adapter back to DHCP
- Connect the upstream network to the WAN port
- Test wired, wireless, and reboot
- Safely store the stock backup
9. Common Issues
SFTP refresh fails or NullPointerException
This is a compatibility issue with stock Dropbear and does not mean the router is bricked.
Use instead:
- PowerShell
scp - WinSCP in SCP mode
SCP reports ssh-rsa not supported
Error:
no matching host key type found
Add the parameters:
-o HostKeyAlgorithms=+ssh-rsa
-o PubkeyAcceptedAlgorithms=+ssh-rsa
ubiformat reports Permission denied
This means you are trying to format the UBI partition where the current system is running.
Check:
cat /proc/cmdline
Then write the factory image to the other free partition.
Recovery reports insufficient space
The error is usually similar to:
will not fit volume
Delete the original volume and recreate it as 14MiB:
ubirmvol /dev/ubi0 -n 2
ubimkvol /dev/ubi0 -n 2 -N recovery -s 14MiB
apk is Killed
The temporary initramfs has limited available memory.
You can try:
- Re-run the install command
- Ensure WAN has internet access
- Close unnecessary SSH sessions and retry
SSH disconnects after sysupgrade
This is part of the normal reboot process. Wait for the system to start, then access again:
http://192.168.1.1
Does having a backup guarantee unbricking?
Not completely.
A full backup can resolve most software and partition issues, but if BL2 or FIP is severely damaged, you may still need:
- UART
- A programmer
- Dedicated recovery tools
Therefore backups are essential, but more importantly, do not power off while flashing the bootloader and do not mix firmware images.
10. Process Overview
Stock firmware
↓
Enable and persist SSH with xmir-patcher
↓
Create full backup
↓
Upload the five ubootmod files
↓
Write factory image to free UBI partition
↓
Switch boot partition
↓
Enter temporary ImmortalWrt
↓
Re-upload firmware
↓
Install and load kmod-mtd-rw
↓
Rebuild UBI, ubootenv, and recovery
↓
Write BL2 and FIP
↓
sysupgrade final firmware
↓
ImmortalWrt OpenWrt U-Boot layout
References
Hands-on record:
RD03 / 1.0.84→ImmortalWrt 25.12.1 U-Boot layout, including Recovery.