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

for applications it might work, for kmods usually not.

I have bought old equipment on second-hand websites before, which is xiaomi-4a-gigabit too. It can be directly flashed using the sysupgrade image, but the brand-new equipment I bought myself can't.I have tried other people's self-build sysupgrade image, I can also directly flash it in. but just this official image doesn't work.

I am going to try it again.

flashed directly, how ?

from xiaomi's factory image to sysupgrade image,
in this page

mtd -e OS1 -r write sysupgradeimage.bin OS1

I failed when using official sysupgradeimage.bin
I tried to flash other openwrt image which works, and flash from that openwrt to the official image, that's why I call it directly(the former) or not directly(the latter)

I failed too when using other image's luci to upgrade to the official image or use cli sysupgrade -v ...

I know how to build, how to recovery, how to build my own image,my own ipk, but I prefer using official image. it's convenient to install new ipk comparing to build it myself.

What version of Xiaomi firmware is currently installed?

fwiw, I notice some files have been updated in the last month on the OpenWRTinvasion github page. Have you considered using the windows method which uses scripts created before Sept 2020?


I can enter the shell through OpenWRTInvasion-0.0.1, my problem is that it fails to use the official sysupgrade firmware, but I can successfully use the firmware compiled by myself. I am trying to use breed now, because using MIWIFIRepairTool.x86 is too troublesome, last night I tried again Tried the official sysupgrade firmware, it failed again, I waited for a few hours after flashing, the first led on the left side of the router was always on yellow, and the second led flashed blue from time to time, I see it here This issue Warning 03/2022 Xiaomi is currently shipping Mi Router 4A Gigabit Edition devices without proper shielding. Be aware that those might cause problems due to radio interferance. I don't know if this problem caused openwrt to fail to start. I am now wondering:

  1. If flashing the breed fails, can I still restore it through MIWIFIRepairTool.x86.
  2. How to get the startup log.

xiaomi official image version is 2.28.62 provided by OpenWRTInvasion
openwrt official image version is 21.02.2

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.