Install official firmware on Xiaomi via MiFlash: the full guide

Xiaomi’s firmware via MiFlash is the only official way to return the device to factory status if it’s locked, unstable, or requires an update to the current version. MIUI. This method is suitable for all models of the brand, from the budget Redmi to the flagship Xiaomi 14, but requires strict adherence to the algorithm. OTA-Updates, firmware through fastboot allows you to choose any version of the software - from a stable global to a Chinese developer.

Many users fear this process because of the risk of β€œbricking” the device, but in practice, problems arise only when you ignore the key rules: incorrectly unlock the bootloader, use incompatible firmware or interrupt the process. In this article, we will discuss all the steps from preparation to the final restart, and also tell you how to avoid typical errors and what to do if something goes wrong.

πŸ“Š How often do you update your firmware on Xiaomi?
Only through OTA.
Once a year manually
When critical bugs appear
Never update.
I don't know what it is.

Preparation of the device: unlocking the loader

Before you use MiFlash, you need to unlock the bootloader, a mandatory requirement for Xiaomi for all devices released after 2016. Without it, the program simply will not see your smartphone. The process takes 3 to 15 days (depending on company policy) and requires you to link your Mi Account to the device.

To start unlocking:

  • πŸ“± Activate Developer Mode: Go to Settings β†’ The phone. β†’ Version. MIUI And tap it 7 times.
  • πŸ”“ Turn it on. OEM-unlocking and debugging USB Settings menu β†’ Additionally. β†’ For developers.
  • 🌐 Link your device to your Mi Account in the same menu (Mi Unlock Status).
  • πŸ–₯️ Download the Mi Unlock Tool utility (official website) and run it on your PC under an account linked to your phone.

Once you submit a request to unlock, you will have to wait for confirmation. In 2026, Xiaomi tightened the rules: for new models (for example, the Redmi Note 13 Pro+), the wait can be up to 360 hours. Old devices (until 2020) unlock faster – in 72-168 hours.

⚠️ Warning: If you bought a smartphone with your hands, make sure the previous owner untie his Mi Account from the device. Otherwise, unlocking will be impossible without his participation.

2. Choosing the Right Firmware: Stable vs. Developer

Official firmware for Xiaomi is divided into three types: stable global (Global), stable Chinese (China) and developer versions (Developer). The first two versions are suitable for everyday use, and the third contain fresh features but may have bugs.

  • 🌍 Global MIUI β€” International versions (the global designation in the file name).
  • πŸ‡¨πŸ‡³ China MIUI β€” for Chinese devices (designation cn).
  • πŸ› οΈ XiaomiROM – unofficial archive (use at your own risk).

It is important to choose the firmware that matches the model code of your device. For example, for the Redmi Note 12 Pro, it can be sweet (global version) or sweetin (Indian). You can find out the code in the Settings β†’ About Phone β†’ Model application or through the fastboot getvar product command in the terminal.

Type of firmwareAdvantagesDeficienciesWho's right for?
A stable globalMaximum compatibility and support for Google servicesUpdates are less common than in Chinese versions.90% of users
Stable ChineseMore recent updates, optimization for ironNo Google Services, Chinese AppsEnthusiasts ready to install GApps manually
Developer (Developer)Newest features, weekly updatesPossible bugs, unstable workTesters, developers

⚠️ Note: Installing Chinese firmware on a global device (and vice versa) can lead to problems with the modem, camera or sensors, in some cases this can only be fixed by flashing it to the β€œnative” version.

3. Installation of drivers and setting up MiFlash

To work MiFlash on PC requires drivers Qualcomm HS-USB QDLoader 9008 (for most Xiaomi models) and the right environment. Download the latest version of the utility from the official website (avoid third-party sources - they may contain viruses).

Algorithm of installing drivers:

  1. Connect the switched off smartphone to the PC, holding Volume down + Power to log in to fastboot.
  2. In Device Manager, find a device with an exclamation point (usually Android Bootloader Interface).
  3. Update the driver manually by specifying the folder with drivers from the MiFlash archive.
  4. Restart your PC and check that the device is determined by the command of fastboot devices.

The MiFlash utility itself does not require installation - just unpack the archive. When you first start, select the language (there is Russian) and check the settings:

  • πŸ”„ Select tab – specify the path to the unpacked firmware (folder should contain files with the.img extension).
  • πŸ“‹ Advanced tab – select firmware mode: clean all – complete cleaning (recommended when changing version) MIUI). Clean all and lock - cleaning + bootloader lock (only for power users!) save user data - saving user data (risky when switching to another version).

β˜‘οΈ Preparing MiFlash for work

Done: 0 / 4

4. Step-by-step instructions for firmware

When you are ready, follow this algorithm:

  1. Turn off your smartphone and press Volume Down + Power to enter fastboot. The screen should display the hare in the hat-eared (mode logo).
  2. Connect the device to the PC through the original USB-cable (use the port) USB 2.0 on the back of the system unit for stability).
  3. Run MiFlash on behalf of the administrator. The Device field should show the name of your model (e.g. sweet).
  4. Select firmware mode (clean all for most cases) and press Refresh to let the utility detect the device.
  5. Press Flash and wait for the process to be completed (usually 5-15 minutes).
  6. After success (Flash Done message), turn off the device and turn it on with the power button. The first start can take up to 10 minutes.

If a critical partition flashing is not allowed error appears in the log, it means you are trying to flash the locked device. Go back to the bootloader unlock step.

The firmware process is accompanied by a change in the color of the indicator on the smartphone:

  • πŸ”΄ Red - Team waiting.
  • 🟒 Green is a successful firmware.
  • πŸ”΅ Blue - error (reconnection required).

What if MiFlash can’t see the device?
1. Check the cable and USB port (try another cable or USB 2.0 port).2. Make sure the drivers are installed correctly (there should be no exclamation points in Device Manager).3. Reinstall MiFlash to another folder (no Cyrillic on the go).4. Try running the utility in Windows 7.5 compatibility mode. Disable the antivirus - it can block access to fastboot.

5. Typical errors and their solutions

Even with the correct instructions, errors can occur, and here are the most common ways to correct them:

Mistake in MiFlashReason.Decision
can't find 'flash_all.sh'The wrong structure of the firmware folderUnpack the firmware again, make sure that the folder has.bat and.sh files.
device not foundDrivers not installed or the device is not in fastboot modeReinstall drivers, check the connection (the red indicator should be on)
flash not doneInterrupted process or incompatible firmwareTry again with another firmware version, check the model code
anti-rollback check failReversed to an older version of MIUIOnly use the new version or the one recommended for your model.

If the device does not turn on after firmware or hung on the MI logo, try:

  • πŸ”„ Repeat the firmware with the choice of clean all mode.
  • πŸ”§ Switch another version MIUI (For example, instead of the Chinese, the Chinese).
  • πŸ“‘ Use it. EDL-Mode (emergency download mode) via QFil utility (requires an authorized Xiaomi account).

⚠️ Attention: The anti-rollback error is one of the most dangerous, and it occurs when you try to install firmware older than the one already on the device. EDL or contacting a service center.

6. What to do after the firmware?

Successful firmware is only half the battle.

  1. Configure the device as new (do not restore the backup from the old firmware – this can lead to conflicts).
  2. Check the operation of key functions: πŸ“Ά Modem (calls, mobile Internet). πŸ“· Camera (all modules should be focused). πŸ”‹ Charging (Make sure the battery is charging). 🎡 Speakers and microphone.

Update the applications

Google Play

App Store

GApps

Lock the loader.

MiFlash

clean all and lock

If you have stitched the Chinese version of MIUI but want to use Google services, install Open GApps (choose arm64 for modern smartphones).

  1. Download GApps from OpenGApps (Nano or Pico version is recommended).
  2. Unpack the archive and run through fastboot with the command: fastboot flash system gapps.img
  3. Reset the device.

πŸ’‘

If the IMEI is missing after the firmware (no network), restore it using the engineering menu: dial ##4636## β†’ Phone Information β†’ Select SIM and enter the original IMEI (indicated on the box or under the battery).

7. Alternative methods of firmware

If MiFlash failed, consider alternative methods:

  • πŸ“± Recovery firmware: through TWRP It is suitable for updating without loss of data, but requires an unlocked bootloader.
  • πŸ–₯️ Fastboot commands manually: if MiFlash is buggy, you can flash each section separately: fastboot flash boot boot.img fastboot flash system system.img fastboot flash vendor vendor.img fastboot reboot
  • πŸ”§ EDL-Mode: Emergency method for "brick" devices. Requires an authorized Xiaomi account and utility QFil or Mi Flash Pro.

For MediaTek processor devices (e.g. Redmi 9A or POCO C31), the SP Flash Tool is used instead of MiFlash. The algorithm is similar but requires separate drivers and a firmware scatter file.

πŸ’‘

EDL-The mode is the last chance to save the brick, but it requires authorization from Xiaomi. Unofficial methods of bypassing authorization (for example, through the Deep Flash Cable board) can lead to a breakage of the device.

FAQ: Answers to Frequent Questions

❓ Can I flash Xiaomi without unlocking the bootloader?
No, for all Xiaomi devices after 2016, unlocking is mandatory, except for the recovery firmware (if not standard), but it is risky and can lead to errors.
❓ Why MiFlash Writes "Flash Done" but the Phone Doesn't Turn on?
This is a typical situation when choosing a save user data mode or incompatible firmware. Repeat the process with clean all mode and check the MIUI version.
❓ How to return the official firmware after custom?
The algorithm is the same: unlock the bootloader, download the official firmware and run through MiFlash in clean all mode, TWRP), Pre-return the standard through the command fastboot flash recovery stock_recovery.img.
❓ Can I go back to an older version? MIUI?
Technically, yes, but Xiaomi blocks rollbacks through the Anti-Rollback mechanism. If you try to bypass it, the device may stop turning on. The exception is a rollback within a single branch (for example, from MIUI 14.0.5 to 14.0.3).
❓ Where to get firmware for a rare Xiaomi model?
The official firmware for all models is stored on MIUI Downloads websites. If your model is not listed, check the code name of the device (for example, raphael for Redmi K20 Pro) and search for firmware on it on the XDA Developers or 4PDA forums.