Xiaomi r4a gigabit upgrade to squashfs-sysupgrade.bin from initramfs-kernel.bin

I notice this

TBH, I don't know whether the MiWifiRepairTool will replace 3rd party bootloader with original Xiaomi firmwares. My understanding is routers with breed bootloader, require custom builds specific to function with breed. I could be wrong.

So it is reasonable to assume standard Xiaomi and stock OpenWrt images won't work with breed bootloader?

To get start up log, I would think you will need a serial-TTL connection to the PCB.

Have you opened up your R4AG with chinese firmware, to confirm whether it is the newer design?

I successfully flashed breed bootloader, still failed to flash the official squashfs-sysupgrade.bin, I am going to checkout openwrt 21.02.2, and build it my self.

I find that xiaomi-4a-gigabit use a new model of flash:EN25QX128
before use GD25Q128C and W25Q128BV according to this commit and this topic page,from the latter page I found GD25Q128C.
maybe that's why my old device can flash in, but the new one cannot.

from this commitfrequency of flash is down to 50Mhz,but from the breed admin page, this flash is 44Mhz.

1 Like

It seems I have the boot loop, because I can get into the breed console every few seconds, and ping to like this

the same problem as this commit

Can I suggest you raise a bug report ?


However, for a patch to be created by another developer, they would need same model of R4AG as your device to investigate.

already issued, I can make sure that it is the image file's problem,maybe caused by xiaomi's new flash, my previous device also xiaomi-4a-giga, I succeed.

fwiw, I have a pair of Global 'Giga's.

Another forum member very recently bought a new 'Gigabit' Global model. OpenWrt installed ok. But it could be older inventory because the UK retailer incorrectly describes it as 100mb 64MB RAM model so perhaps has not sold many.



I got the flash model after I open the case, it's "cFeon QH128A-104HIP"

after using https://github.com/acecilia/OpenWRTInvasion, I telnet the router and cat /proc/mtd, I got

root@XiaoQiang:~# cat /proc/mtd
dev: size erasesize name
mtd0: 01000000 00010000 "ALL"
mtd1: 00030000 00010000 "Bootloader"
mtd2: 00010000 00010000 "Config"
mtd3: 00010000 00010000 "Bdata"
mtd4: 00010000 00010000 "Factory"
mtd5: 00010000 00010000 "crash"
mtd6: 00010000 00010000 "cfg_bak"
mtd7: 00100000 00010000 "overlay"
mtd8: 00d00000 00010000 "OS1"
mtd9: 00b30000 00010000 "rootfs"
mtd10: 00180000 00010000 "disk"

but from the older device openwrt cat

root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "Bdata"
mtd3: 00010000 00010000 "factory"
mtd4: 00010000 00010000 "crash"
mtd5: 00010000 00010000 "cfg_bak"
mtd6: 00100000 00010000 "overlay"
mtd7: 00e80000 00010000 "firmware"
mtd8: 00241f43 00010000 "kernel"
mtd9: 00c3e0bd 00010000 "rootfs"
mtd10: 00920000 00010000 "rootfs_data"

is this the problem?shoud I modify the dts file and recompile it? I'm not clear about the flash process, does command mtd -e OS1 -r write firmware.bin OS1 change the partitions? or it just use the partitions already exists before,and only mkfs and change the file in the specific partition.

There is no problem.

Under root@XiaoQiang:~#, you are in xiaomi factory fw, and

You have to rename the openwrt *-sysupgrade.bin to firmware.bin and put it into /tmp foler. Then,

root@XiaoQiang:~# cd /tmp
root@XiaoQiang:~/tmp# mtd -e OS1 -r write firmware.bin OS1

the openwrt's official firmware doesn't support the new flash QH128A-104HIP, reported here

Assume it has the same functions as EN25QX128A, refer to my post to patch the linux driver:

You have to compare the Specs carefully.

1 Like

I got the datasheet of "cFeon QX128A-104HIP"

I got the infomation of INFO field from github

Hi @FredyVia - were you able to unbrick your xiaomi with this cFeon chip?

I have a device with the same chip (QX128A-104HIP) also in a bootloop, but I have not been able to recover it after a failed OpenWRT flash attempt...

I was able to recover it using tftp method after a first attempt. But after a second attempt with the latest OpenWrt, it will no longer accept the 3.0.24 xiaome firmware anymore.

see Xiaomi R4A Gigabit International - Can't unbrick 2nd time - Installing and Using OpenWrt - OpenWrt Forum for more...

yes, just follow the marked solution

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.