I own a Xiaomi Ax9000 which has been running OpenWrt for months. It was first converted from stock over UART, long before this incident, and after that it was kept current with plain sysupgrade, so the serial console was never needed again.
The brick was self-inflicted. The build in use was an NSS snapshot whose low 5 GHz radio (QCN9024) would not accept a single client, so an upstream OpenWrt snapshot was built with the ImageBuilder, fully configured, and forced with sysupgrade -n. The image itself was valid and the flash completed, but it carried the target's default FIT load address (0x41000000) while this unit's u-boot only boots a FIT loaded at 0x43000000. After the reboot the board came up in a loop: no DHCP, no SSH, no web UI, nothing.
At that point there was no 1.8 V USB-TTL adapter at hand. The console pads on this board are 1.8 V, so a 3.3 V or 5 V adapter was not an option (it would take the SoC with it), and the case was not going to be opened. Everything below was done with the router plugged into a PC over Ethernet, and it ends with persistent OpenWrt on the NAND and no Xiaomi firmware left.
Procedure verified in November 2026 on an international AX9000.
The Xiaomi firmware installed in phase 1 is only a bridge to get a shell. It is wiped in phase 4.
Warning: this is for your own hardware. It voids the warranty, it can kill the router for good and there is no safety net if you pick the wrong partition. Everything below was done with the router connected to a PC over Ethernet, without opening anything.
Index
1. Summary
| Phase | What it does | Outcome |
| 1 | Recovery TFTP | Back to stock, SSH closed |
| 2 | xmir-patcher exploit | Root shell over SSH on stock |
| 3 | OpenWrt initramfs | OpenWrt in RAM, nothing written to flash |
| 4 | Patched sysupgrade | Persistent OpenWrt on the NAND |
| 5 | Verification | Kernel, overlay, radios |
2. How the brick presents itself
- The router powers on and the LED does something, but there is no DHCP and it answers neither on
192.168.31.1 (stock) nor on 192.168.1.1 (OpenWrt).
- The PC does not get an IP over cable on either network.
ping to 192.168.31.1 and to 192.168.1.1: no reply.
- Without UART you cannot see the boot loop, so you diagnose by elimination.
Cause in this case, an empirical finding rather than something traced at bootloader level because there was no console: the factory u-boot on this unit would not boot the OpenWrt FIT with the default load address. It only booted when the FIT kernel node carried:
load = 0x43000000
entry = 0x43000000
and, on top of that, the bootloader environment had atf=1. Setting atf=1 only in the stock /etc/config was not enough. It had to be written to the NAND (bdata) and committed with nvram commit.
Checking those addresses inside an image:
fdtdump initramfs-0x43000000.itb | grep -E "load|entry"
load = <0x43000000>
entry = <0x43000000>
3. Requirements
- A Linux PC, an Ethernet cable and a free port.
dnsmasq built with TFTP support.
- International stock firmware for the AX9000 (3.0.40 INT in this case).
- xmir-patcher.
python3 with venv.
- An OpenWrt image for
xiaomi_ax9000 with the FIT at 0x43000000, in two formats: initramfs and sysupgrade.
- Patience: expect waits of 2 to 10 minutes between phases.
Directory layout used for this procedure:
<workdir>/tftp-recovery/
stock-xiaomi-3.0.40_INT.bin
C0A81F01.img ... C0A81F04.img (renamed copies)
<workdir>/xmir-patcher/
<workdir>/ax9000-intl/
initramfs-0x43000000-factory.ubi
sysupgrade-ib-0x43000000.bin
4. Phase 1: back to stock over TFTP
The Xiaomi u-boot has boot_wait enabled and, on boot, brings up 192.168.31.1 and requests a file over TFTP whose name is an IP address in hexadecimal. That is why the image has to be served under that exact name.
4.1 Prepare the PC
Put the PC interface on 192.168.31.2 and connect the cable to a LAN port on the router.
ip addr add 192.168.31.2/24 dev eth0
ip link set eth0 up
4.2 Prepare the TFTP directory
The file is served under the hex name of the IP involved. Here it worked with the copies for .1 through .4. Also keep the .100 one in case your unit uses a different serverip.
cd /path/to/tftp-recovery
cp stock-xiaomi-3.0.40_INT.bin C0A81F01.img
cp stock-xiaomi-3.0.40_INT.bin C0A81F02.img
cp stock-xiaomi-3.0.40_INT.bin C0A81F03.img
cp stock-xiaomi-3.0.40_INT.bin C0A81F04.img
cp stock-xiaomi-3.0.40_INT.bin C0A81F64.img
4.3 Start dnsmasq in TFTP mode
Reference config, adjust the interface and the path:
sudo dnsmasq --no-daemon \
--port=0 \
--interface=eth0 --bind-interfaces \
--dhcp-range=192.168.31.2,192.168.31.2,255.255.255.0,1h \
--dhcp-option=3,192.168.31.2 \
--dhcp-option=6,192.168.31.2 \
--enable-tftp --tftp-root=/path/to/tftp-recovery \
--log-dhcp
4.4 Power on the router
With dnsmasq in the foreground, plug in the power. The log must show the TFTP request for the .img file. If nothing shows up within 2 minutes, power off, recheck the PC IP and the file name, and repeat.
Once the transfer starts, do not touch anything. It takes several minutes and the router reboots by itself. At the end it is back on stock:
http://192.168.31.1
This step only exists to get a system with the vulnerable SSH. The stock firmware is wiped completely in phase 4.
4.5 Stop the TFTP server
sudo pkill -x dnsmasq
And remove the temporary IP from the PC once it is no longer needed.
5. Phase 2: open SSH with xmir-patcher
International stock 3.0.40 carries the exploit that xmir-patcher uses. No need to open the router or solder anything.
git clone https://github.com/openwrt-xiaomi/xmir-patcher
cd xmir-patcher
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
./run.sh
In the menu:
| Option | What it does |
| 1 | Set IP-address to 192.168.31.1 |
| 2 | Connect to device, installs the exploit |
| 3 | Read full device info, confirms model and partitions |
| 4 | Create full backup, full dump, store it somewhere outside |
| 6 | Install permanent SSH, SSH that survives reboots |
Before flashing anything, write down the partition table from option 3 (name, address and size of rootfs and rootfs_1). That is what lets you go back if something goes wrong.
5.1 The atf patch
The bootloader environment had to carry atf=1 written to NAND. It was added to install_fw.py, in the block that prepares the nvram, before the commit:
cmd.append("nvram set bootdelay=3")
cmd.append("nvram set boot_wait=on")
cmd.append("nvram set ssh_en=1")
cmd.append("nvram set uart_en=1")
cmd.append("nvram set atf=1") ...
nvram commit
Without it, the FIT was written correctly but the router would not boot from flash.
6. Phase 3: OpenWrt in RAM
Goal: boot OpenWrt without touching the good partition, so the sysupgrade can be launched from a system that is already OpenWrt.
6.1 Copy the initramfs
scp initramfs-0x43000000-factory.ubi root@192.168.31.1:/tmp/
6.2 Write it to the opposite rootfs
With xmir-patcher this is option 7 (Install firmware) pointing at the firmware/ directory, with the initramfs inside. The program locates rootfs and rootfs_1 and writes to the one not currently in use.
By hand, the pattern is:
cat /proc/mtd
mtd -e rootfs_1 write /tmp/initramfs-0x43000000-factory.ubi rootfs_1
6.3 Tell the bootloader which partition to boot
Stock is A/B and uses flag_boot_rootfs. If you wrote to rootfs_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
6.4 Check
Within 2 or 3 minutes it answers on 192.168.1.1 with OpenWrt in RAM. The configuration does not persist: reboot here and you are back on stock. That is why phase 4 is done right away, without powering off.
ssh root@192.168.1.1
ubus call system board
ip -4 addr show br-lan
df -h /
7. Phase 4: persistent sysupgrade
This is where OpenWrt is actually written to the NAND, with the FIT at 0x43000000.
7.1 Send the image
cat sysupgrade-ib-0x43000000.bin | ssh root@192.168.1.1 "cat > /tmp/fw.bin"
7.2 Verify the hash before flashing
ssh root@192.168.1.1 "sha256sum /tmp/fw.bin"
Compare it with the local sha256. If they differ, stop.
7.3 Flash
ssh root@192.168.1.1 "sysupgrade -n /tmp/fw.bin"
The -n is mandatory: without it, sysupgrade tries to keep the previous system configuration and you end up with leftovers that do not fit.
7.4 Wait
Between 2 and 5 minutes. The router reboots by itself and comes back on 192.168.1.1. Do not cut the power.
8. Phase 5: verification
ssh root@192.168.1.1 "ubus call system board"
ssh root@192.168.1.1 "ip -4 addr show | grep -E 'inet |pppoe'"
ssh root@192.168.1.1 "cat /proc/mtd"
ssh root@192.168.1.1 "mount | grep -i ubi"
ssh root@192.168.1.1 "df -h /overlay"
ssh root@192.168.1.1 "iw dev"
What you need to see:
- An OpenWrt kernel, not the Xiaomi one.
- Overlay mounted on UBI (
/dev/ubi0_1 on this unit), with free space.
- All four AX9000 radios present.
- PPPoE or WAN holding an IP if fibre is connected.
Real persistence test: change something, reboot and confirm it is still there. If stock comes back, flag_boot_rootfs did not stick.
9. AX9000 pitfalls under OpenWrt
These cost hours and have nothing to do with flashing.
9.1 bss_transition takes the whole WiFi down
The UCI option bss_transition comes from GL.iNet firmware and the OpenWrt hostapd does not know it. A single invalid option makes hostapd reject the entire radio file:
unknown configuration item 'bss_transition'
1 errors found in configuration file
hostapd.add_iface failed for phy phy2 ifname=phy2-ap0
Symptom: the interface shows up in ubus but with Channel 0, Tx-Power 0 dBm and zero clients.
uci delete wireless.default_radio2.bss_transition
uci delete wireless.default_radio3.bss_transition
uci commit wireless
wifi reload
The correct way for 802.11v is ieee80211v=1, which is a different option.
9.2 The QCN9024 BDF
The board-2.bin shipped by ipq-wifi-xiaomi_ax9000 does not accept clients on the low 5 GHz radio: it beacons and drops associations without logging a single attempt. Replace it with CodeLinaro's official BDF at /lib/firmware/ath11k/QCN9074/hw1.0/board-2.bin:
| Item | Value |
| Source | QCN9074/hw1.0/WLAN.HK.2.9.0.1-01977-QCAHKSWPL_SILICONZ-1/board-2.bin |
| Size | 811180 bytes |
| SHA-256 | 2379460b1f9d44bb2d23d50712d6acf04cd067b5fd748043aeba3554190a84e9 |
9.3 Never 160 MHz
It breaks the AX9000 radios. Use 80 MHz (ch36 on the low 5 GHz radio).
9.4 802.11r
There is a history of disconnections with 802.11r on this model. If you see drops, ieee80211r is the first suspect: try without it and stay on 802.11k/v.
9.5 There is no /etc/init.d/wifi in recent snapshots
That is normal: netifd starts the radios. If WiFi does not come up, the problem is in the hostapd configuration, not in a missing init script.
10. What did not work
- UART: ruled out. The AX9000 console is 1.8 V. With 3.3 or 5 V you kill the SoC, and there was no adapter and no way to open the case.
atf=1 only in the stock /etc/config: not enough, the bootloader reads its environment from NAND. You need nvram set plus commit.
- Official image without touching the FIT: the router would not boot with the default load address (
0x41000000). It needs a FIT loaded at 0x43000000.
- Recovering the old overlay from the NAND dump: the
rootfs_data volume was corrupt (broken node at LEB 373) and ubireader could not extract it. The configuration was rebuilt by hand from uci-export.txt, which was complete.
- Installing
apk packages built for a different architecture: apk 3.0 rejects them. The architecture must be aarch64_cortex-a53.
11. Going back to stock
Rescue only. The image you go back to must have the FIT with the address this u-boot accepts, or you repeat the brick.
cat previous-build-xiaomi_ax9000-sysupgrade.bin | \
ssh root@192.168.1.1 "cat > /tmp/back.bin"
ssh root@192.168.1.1 "sha256sum /tmp/back.bin"
ssh root@192.168.1.1 "sysupgrade -n /tmp/back.bin"
If the router no longer answers over SSH either, go back to phase 1 (TFTP).
12. File inventory
Keep a durable copy of these files outside the working directory, for example in a backup folder on another disk.
| File | What it is | SHA-256 |
stock-xiaomi-3.0.40_INT.bin | Bridge firmware | - |
pre-migration-config-backup.tar.gz | Previous config backup | - |
uci-export.txt | Full exported configuration | - |
nand-dump/ | NAND dump | - |
previous-build-xiaomi_ax9000-sysupgrade.bin | Earlier NSS build | dbfa774ac4cd055ab45b13beccd1a8bd972726059853753f80044348652a2412 |
openwrt-official-r38574-full-xiaomi_ax9000-sysupgrade.bin | Official OpenWrt plus packages | 06ee75197e624905fadef860bbcdd8f9f64a90898de33a4d40821e502326178b |
bdf-qcn9074-codelinaro-WLAN.HK.2.9.0.1-01977.bin | Good BDF for the QCN9024 | 2379460b1f9d44bb2d23d50712d6acf04cd067b5fd748043aeba3554190a84e9 |
FLASH-OFFICIAL.md | Notes on the official flash | - |
Working artifacts, temporary:
<workdir>/ax9000-intl/initramfs-0x43000000-factory.ubi
<workdir>/ax9000-intl/initramfs-0x43000000.itb
<workdir>/ax9000-intl/sysupgrade-ib-0x43000000.bin
<workdir>/xmir-patcher/ with patched install_fw.py
<workdir>/tftp-recovery/ C0A81F0*.img images
Working artifacts older than a few days tend to get wiped by cleanup jobs. If you need to repeat this, rebuild the initramfs and the sysupgrade from the ImageBuilder and patch the FIT back to 0x43000000.
13. Real timings
| Phase | Time |
| 1, TFTP to stock | 10-20 min, mostly waiting |
| 2, exploit and backup | 10 min |
| 3, initramfs | 5-10 min |
| 4, persistent sysupgrade | 5 min |
| 5, verification | 10 min |
| Total with surprises | an afternoon |
If you repeat this, change the interface names and the paths, but do not change the FIT addresses or atf=1 without understanding why they are there.
14. Where this ended
The NSS fork is gone. The router now runs upstream OpenWrt main, which means no more waiting on a frozen fork to fix a radio, and it is measurably healthier than it ever was on the NSS build: both 5 GHz radios serve clients, the wired side is offloaded through the PPE with the CPU close to idle, and temperatures sit well below the fan trip point.
On top of that, NetGrip gives it a simple web UI for day to day management, so checking clients, radios, channels or pending updates no longer means SSHing in and remembering UCI paths.