Xiaomi 4A 3-Gigaport cannot flash OpenWrt 21.02

Hey guys, I brought a Xiaomi 4A with 3 gig ports and flashed breed for it.
The hardware specs are as follows:
CPU MediaTek MT7621A ver1, eco3
Memory 128MB DDR3
Flash EON EN25QX128@44MHz (16MB)
Clock: CPU: 880MHz, DDR: 1040MHz, Bus: 220MHz, Ref: 40MHz

The breed version is build 2021-12-15 git-f9b74d0, v1.1 r1337

After this preliminary work, I have downloaded OpenWRT 21.02.2 for Xiaomi 4A Gig from https://downloads.openwrt.org/releases/21.02.2/targets/ramips/mt7621/openwrt-21.02.2-ramips-mt7621-xiaomi_mi-router-4a-gigabit-initramfs-kernel.bin, after firmware upgrade, I'm trying upgrade to xiaomi_mi-router-4a-gigabit-squashfs-sysupgrade.bin

But after this upgrade, it seems not upgrade normally, the squashfs sysupgrade is not work, system is always what initramfs firmware like, no wireless, lost config and software after reboot.
Then I have tried flash squashfs-sysupgrade.bin from breed directly, but the system goes into infinite reboot.

I have tried 21.02.2, 21.02.1, 21.02.0 even snapshot, but problems keep happening same.
Can anyone help with this problem?

make sure it's not a device with the new 16mb flash chip - https://openwrt.org/inbox/toh/xiaomi/xiaomi_mi_router_4a_gigabit_edition

Exactly, it's EON EN25QX128 the NEW flash chip. :rofl:

Did your R4AG ship with chinese language, or Global international Xiaomi firmware?

with Chinese Language

1 Like

Latest breed bootloader support some new chips. Full table for EON chips:

EON EN25Q80A  1c3014
EON EN25F80   1c3114
EON EN25F16   1c3115
EON EN25Q16   1c3015
EON EN25QH16  1c7015
EON EN25F32   1c3116
EON EN25P32   1c2016
EON EN25Q32   1c3016
EON EN25QA32  1c6016
EON EN25QH32  1c7016
EON EN25P64   1c2017
EON EN25Q64   1c3017
EON EN25QA64  1c6017
EON EN25QH64  1c7017
EON EN25QX64  1c7117
EON EN25Q128  1c3018
EON EN25QH128 1c7018
EON EN25QX128 1c7118
EON EN25QH256 1c7019

You can try to add support for openwrt. Just add line for EN25QX128 into spi_nor_ids flash table in drivers/mtd/spi-nor/spi-nor.c and recompile firmware.

1 Like

Welp my global version came in with this chip:

GigaDevice GD25Q128E

Another sucky 16MB flash :confused:

Is it not possible to just solder on a new chip on these models? Does anyone know some chips that are similar but not 16MB lol

Edit: this reply of mine is dumb but I did bricky my device lol

Device page shows same flash chip fitted to a R4AG purchased in March 2022, reported to be successfully flashed with OpenWrt ?
https://openwrt.org/inbox/toh/xiaomi/xiaomi_mi_router_4a_gigabit_edition#photos

0gigaflash

According to commit
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=17e690017d76c49070bc99d6a376b1926259c5ff
GD25Q128C is supported.

My other MIR4A Gigabit also has the same chip, it seems like the OpenWRT install link on here is wrong (I think so):

It's this: https://downloads.openwrt.org/releases/21.02.2/targets/ramips/mt7621/openwrt-21.02.2-ramips-mt7621-xiaomi_mi-router-4a-gigabit-squashfs-sysupgrade.bin

But it should be: https://downloads.openwrt.org/releases/21.02.2/targets/ramips/mt7621/openwrt-21.02.2-ramips-mt7621-xiaomi_mi-router-4a-gigabit-initramfs-kernel.bin

Anyway I bricked my router and thought it's due to the flash, I just unbricked it and now have chinese firmware installed. But OpenWRTInvasion doesn't seem to work anymore (Can't connect via ssh or telnet) - Do you think I could simply flash OpenWRT bin file just how I unbricked my device? (Just not use the chinese firmware)

Or do you think you could point me to good known version that OpenWRTInvasion does work on?

That is incorrect. The initramfs images are normally only for loading temporarily into RAM. Prior to the OpenWrt invasion exploit, the flash chip had to be modified, to allow Uboot to be interrupted, to be able to load the initramfs image first, then followed by squashfs-sysupgrade.bin image.

I have flashed 21.02.1 & 2 sysupgrade.bin to my R4AG 'Giga Edition' using Windows OpenWrtInvasion method without any issues multiples times from stock Xiaomi firmware (GD25Q127C circa 2019?). See bottom of wikipage.
https://openwrt.org/inbox/toh/xiaomi/xiaomi_mi_router_4a_gigabit_edition#alternative_firmwares_for_4a_gigabit

Ohh aight. The router was bricked as soon as I installed OpenWRT and now I can't telnet or ssh into the router with chinese firmware.

Though the OpenWRT version I use on my other device is 21.02.1

Where do you think I could find the older image? (I couldn't find it on the wiki page)

Also, what do you think might be the problem with telnet? I've tried rebooting and switching to AP mode too.

Thanks a lot!

Don't you have to use OpenWrt exploit to be able to use telnet or ssh into stock firmware?

I've not witnessed any issues flashing 21.02.2 sysupgrade.bin from stock firmware using windows method on two of my older 'Giga' models.

21.02.1 can be found here
https://downloads.openwrt.org/releases/21.02.1/targets/ramips/mt7621/

Did you try to use MiWifiRepairTool to restore Global firmware?

Otherwise, please read last paragraph of Debricking section.
https://openwrt.org/inbox/toh/xiaomi/xiaomi_mi_router_4a_gigabit_edition#debricking
links to:
https://forum.openwrt.org/t/mi-router-4a-gigabit-extremely-slow/117975/31

Yes I did.

Only the MIWIFIRepairTool worked for me but I can't flash the global firmware on it for some reason. As soon as the flash completes(Which is instantaneous btw), the light is white-blue and blinks rapidly and after the reboot it loads right back into the chinese firmware. (I probably should've flashed the global firmware when it was bricked but I couldn't find it at that time)

Any ideas why that might be happening? I wish the invasion just worked but welp

Out of curiosity, which chinese version is currently installed?

fwiw, have you tried resetting the router to clear down all settings back to defaults.

Then try windows openwrtinvasion method to install openwrt?

fwiw, the Windows openwrtinvasion instructions does mention how to change from chinese to global firmware, but it is not something I've tried using provided the interim v2 to v3 xiaomi file. But as openwrtinvasion exploit is not working, you won't be able to install it anyway.

Yes, I was just about to reply on that. I used the windows version and then was able to telnet into the router. I tried installing OpenWRT again but it's bricked again.....

I guess this router doesn't like OpenWRT or something? I'm gonna try unbricking it again by using the international version in the first place. Otherwise I'll try that 2to3 firmware properly and then go to OpenWRT again.

If that doesn't work either I'm just gonna return it :frowning:

Not sure why it keeps on bricking after I flash OpenWRT on it. The process on my other router was flawless..

It even has the same flash chip as the other one sigh

I think you said you used initramfs.bin on your other R4AG is may be only other difference?

Dare I suggest installing Padavan to see if it bricks the router?

I received an open box R4AG 'Giga' yesterday (PCB labelled 2019, 25Q127CSIG flash). I allowed router to autoupdate from v2.28.132 Global, to v3.x Global firmware.. I flashed it with Padavan. Earlier today, I reverted to v3 Global using MiWifiRepairTool, then flashed it with 21.02.2 using Windows method. No issues. Reverted to v3.x Global before flashing Padavan again.

made by GigaDevice. Datasheet claims this is a 128Mbit density chip.

Finally!! OpenWRT worked! Thanks a lot for helping out man!

What I did in the end is:

  1. Use the latest chinese firmware with MiWifiRepair Tool to unbrick the router.
  2. Use the Windows Tools (The russian ones) to upgrade from version 2 to 3.
  3. Use the same tool to flash OpenWRT instead of using telnet & downloading the firmware.

It finally booted up and worked. I think I should edit those bat files and add English translations in them and additionally create a new doc with better translations too.

Thanks again.

1 Like

fwiw, did you see the English instructions contained in separate folder, which I created in the dropbox?
dropbox folder

The bat files and python scripts have already been translated to English, but only ones I frequently use are, and known to work are:

0.start_main.bat
1.start_create_backup.bat
5.start_write_OS.bat

ps. I've added a link to your last post to the device wiki's Debrick section regarding use of 2to3 bin file.

btw, did you keep original uboot ?

Ahhh I actually used the "OlegLOM original files hosted at 4pda.to" folder.

The other folder was named "ENGLISH instructions - Partially Tested" So I thought it simply had instuctions and nothing else......

About the uboot, I did run the "2.start_write_uboot_3.bat" file just in case. But I'm not sure if that helped or not. I don't mind testing without the uboot again if there a way to revert it? (I did take a backup though, would that restore it?)

Thanks for updating the the wiki and helping me out!

TBH, I don't know why OlegLOM advises to install new uboot, and whether the 'backup' includes backup of the uboot. I have not examined the backup script to find out what it actually does.

Of the three R4AG 'Giga', I did blindly replace the Uboot' on the first unit when following the original russian instructions before installing Padavan.

But later discovered after viewing a number of non-English YouTube videos using similar Windows based batch files, it was not necessary to replace Uboot when installing OpenWrt or Padavan. For the later two units, I kept the original uboot.

1 Like