How to flash Xiaomi smartphone through MiFlash: a complete guide to unlock the bootloader

Firmware Xiaomi smartphone through MiFlash is one of the most reliable ways to bring the device back to life after crashes, update to the current version or install custom firmware. This method is suitable for most models of the brand, including Redmi, POCO, Mi and even the gaming Black Shark, but requires pre-unlock the bootloader and follow the instructions. Unlike the update via Ota Updater, firmware through MiFlash allows you to completely rewrite the system partition, which helps to eliminate critical errors caused by incorrect updates or viruses.

However, the process has its pitfalls: the wrong firmware can turn a phone into a brick, and errors when unlocking a bootloader can lock the device forever. In this article, we will examine all the stages of firmware from preparing drivers to the final restart, and also tell you how to avoid typical errors such as Invalid image format or Flash is not done. If you are a beginner, we recommend you to carefully study each section: skipping even a small step (for example, checking the version of MiFlash) can lead to irreversible consequences.

1. Firmware Preparation: What to Do Before Starting

Before you start firmware, make sure that all the prerequisites are met, which takes up to 70% of the success of the operation.

First, check your device model. Xiaomi firmware is strictly bound to the model code (e.g. Redmi Note 10 Pro has the code sweet, POCO F3 is alioth).

  • ๐Ÿ“ฑ In the phone settings: Settings โ†’ The phone. โ†’ Model (or Version) MIUI).
  • ๐Ÿ” Through the command line, connect the phone to the PC and type: adb shell getprop ro.product.device
  • ๐Ÿ› ๏ธ On the device box or under the battery (for collapsible models).

Second, back up your data. The firmware in MiFlash erases all internal memory (partition /data). Use Mi Cloud, Google Drive, or local copying on your PC.

  • ๐Ÿ“ธ Photo and video (folder) DCIM).
  • ๐Ÿ“ฑ Contact and SMS (Export through Contacts โ†’ Management โ†’ Exports).
  • ๐ŸŽฎ Game savers (use Helium or root managers if there is root).

โš ๏ธ Note: If the Find Device function is enabled on the phone, it must be turned off in Settings. โ†’ Mi Account โ†’ Find Device.Otherwise, after firmware, the phone may be locked with a requirement to enter a password from the old Mi Account.

๐Ÿ“Š What Xiaomi model are you using?
Redmi (Note, K-series, etc.)
POCO (F, X, M-series)
Mi (11, 12, Mix, etc.)
Black Shark
Another model

2 Unlocking the bootloader: a mandatory step before the firmware

Without an unlocked bootloader, it is impossible to flash Xiaomi through MiFlash. By default, all Xiaomi devices come with a bootloader locked, and unlocking it requires official permission from the manufacturer. The process takes 3 to 15 days (depending on the model) and involves linking the Mi Account to the device.

Instructions for unlocking:

  1. Link your Mi Account to your phone: ๐Ÿ“ฑ Go to Settings. โ†’ Mi Account โ†’ Synchronize and enable all options. ๐Ÿ”— Make sure your phone is connected to the internet via mobile data (Wi-Fi may not work).
  2. Apply for unblocking: ๐ŸŒ Go to the site. en.miui.com/unlock (Use your browser on PC). ๐Ÿ“ Fill out the form stating the reason for unlocking (for example, โ€œInstall official firmwareยป). โณ Wait. SMS with confirmation (may come in a few days).
  3. Unlock the bootloader through the Mi Unlock Tool: ๐Ÿ–ฅ๏ธ Download the utility from the official website. ๐Ÿ”Œ Connect your phone in Fastboot mode (clip Volume Down) + Power with the device switched off). ๐Ÿ”“ Launch Mi Unlock Tool, log in to Mi Account and click Unlock.

โš ๏ธ Note: Some models (e.g. Redmi Note 12 or Redmi Note 12) POCO F5) Unlocking may require confirmation via video call to Xiaomi support. Without this step, the utility will give an error Couldn't unlock.

What if the Mi Unlock Tool can't see the phone?
1. Check if Qualcomm drivers are installed HS-USB QDLoader 9008 (download via MiFlash). 2. Try another one USB-port (preferably) USB 2.0 on the back of the PC). 3. Disable driver signatures in Windows: restart the PC with the Shift key clamped, select Diagnostic โ†’ Additional parameters โ†’ Loading parameters โ†’ Disable mandatory driver signature verification.

3. Selection of firmware: official vs custom

The type of firmware depends on the stability of the device and the available functionality. Xiaomi offers several options:

Type of firmwareDescriptionPlusesCons
Official stable.Xiaomi firmware with the mark Stable.โœ… Maximum stabilityโœ… Support OTA-updateโŒ Delayed updates (released later than for Beta)
Official betaTest builds (Beta or Developer)โœ… New functions before allโœ… Frequent updatesโŒ Possible bugs and overheating
Castomic (AOSP)Community Firmware (LineageOS, Pixel Experience)โœ… Pure Android without a MIUIโœ… Additional settingsโŒ No guarantee of stabilityโŒ The camera may not be working or NFC
Port from another deviceA firmware adapted for another model.โœ… Unique functionsโŒ High risk of "brickingยปโŒ No support from developers

For most users, the best choice is the official stable firmware.

  • ๐ŸŒ On the Miui Download website (select a version for your model and region).
  • ๐Ÿ”— Through telegram channels, like, @MIUIUpdatesTracker (Relevant links to the latest builds).
  • ๐Ÿ“ Forums 4PDA XDA-Developers (if you need a modified version).

Important: The firmware file name must match the model. For example, for Redmi Note 11 Pro+ 5G (veux) fits the file form: veux_global_images_V13.0.4.0.SKCMIXM_20221010.0000.00_12.0_global_100d0a3a0d.tgz

๐Ÿ’ก

If you downloaded firmware in.tgz format, it should be unpacked into a folder using 7-Zip or WinRAR. MiFlash works only with unpacked files (.img,.mbn, etc.).

4. Installation of drivers and setting up MiFlash

Without the right drivers, MiFlash wonโ€™t see your device. For Xiaomi, Qualcomm chips (most models) will require QDLoader HS-USB drivers, and for Mediatek, MTK VCOM drivers.

Step-by-step installation:

  1. Download MiFlash: ๐Ÿ–ฅ๏ธ Official version: download page. ๐Ÿ”ง Alternative (if the official one does not work): MiFlash Pro or XiaoMiFlash.
  2. Install the drivers: โ˜‘๏ธ Driver Preparation Download Qualcomm Drivers (for Snapdragon)Install Mi Phone Manager (automatically installs basic drivers)Deactivate driver signature verification in WindowsReboot PCReloaded: 0 / 4
  3. Set up MiFlash: ๐Ÿ“ Unpack the firmware in a folder without Cyrillic characters (for example, C:\MIUI\veux). ๐Ÿ”ง In MiFlash, click Select and point the path to the firmware folder. ๐Ÿ”„ Select firmware mode: Clean all - complete cleaning (recommended for changing region or after crashes). Clean all and lock - cleaning + Save user data - Save user data - data storage (not always working correctly).

If MiFlash doesn't see the phone in Fastboot mode, check:

  • ๐Ÿ”Œ Connection to USB 2.0 (USB 3.0 may not work).
  • ๐Ÿ”„ Reinstall drivers through Device Manager (remove old and reinstall).
  • ๐Ÿ–ฅ๏ธ Launching MiFlash on behalf of the Administrator.

5. Step-by-step firmware through MiFlash

Now, let's get to the most critical point.

  • ๐Ÿ”‹ The phone is charged at least 50 times%.
  • ๐Ÿ”Œ Used by the original USB-cable (cheap cables can interrupt communication).
  • ๐Ÿ–ฅ๏ธ Antiviruses are disabled on PCs (they can block MiFlash).

Instructions:

  1. Transfer the phone to Fastboot mode: ๐Ÿ“ฑ Turn off the device. ๐Ÿ”˜ Hold the Loud down. + 10 seconds power. ๐Ÿ–ฅ๏ธ Connect your phone to your PC (should be defined as a Fastboot).
  2. Run the firmware: ๐Ÿ”ง In MiFlash, press Refresh โ€“ your device should appear in the list. ๐Ÿ“ Make sure the path to the firmware is correct (the Device field displays the model). ๐Ÿš€ Press Flash and wait until the end (usually 5-15 minutes).
  3. Wait for completion: โœ… Successful firmware will end with a Flash Done message. โŒ Flash is not done error means driver or firmware problems.

What if the firmware is frozen? If the process doesn't move for more than 20 minutes:

  • ๐Ÿ”„ Restart your PC and phone and try again.
  • ๐Ÿ“ Check the integrity of the firmware files (the archive may have been downloaded with errors).
  • ๐Ÿ”ง Try a different version of MiFlash (e.g. MiFlash 2018 instead of MiFlash 2021).

๐Ÿ’ก

If the phone doesn't turn on after you've run the firmware, try slamming Volume Up + Power for 30 seconds to force you to restart. If that doesn't work, repeat the firmware with Clean all mode.

Typical errors and their solutions

Even if you follow the instructions accurately, you can get errors.

Mistake.Reason.Decision
Invalid image formatIncorrect firmware format or corrupted files.Download the firmware again, check the unpacking.
Flash is not doneProblems with drivers or connection.Reinstall the drivers, try another one. USB-port.
Anti-rollback check failTrying to run the old version after the new one.Use the firmware with a version not lower than the current one.
Device not foundMiFlash can't see the phone.Check the Fastboot mode, drivers and cable.
The phone is stuck on the Mi logoIncompatible firmware or recording error.Repeat the firmware with a full clean (Clean all).

The Anti-rollback bug deserves special attention. Xiaomi has implemented rollback protection on older firmware versions to prevent exploits. If you see this message, you're trying to install software older than what's already on your phone.

  1. Find firmware with the same or newer version of MIUI.
  2. Use custom recaps (such as TWRP) to bypass the check (risky!).
How to get around Anti-rollback without risk?
Unfortunately, there is no official way to get around the Anti-rollback, and the only safe option is to flash a newer version of MIUI, and if you don't, you just have to wait for the update to come out or accept the current firmware.

7. What to do after the firmware

Successful firmware is only half the battle, so you need to set up your phone properly to avoid problems in the future.

First steps:

  • ๐Ÿ”„ Restart your phone (sometimes the first download takes up to 10 minutes).
  • ๐Ÿ“ถ Connect to Wi-Fi and check for updates in Settings โ†’ The phone. โ†’ Updating the system.
  • ๐Ÿ”’ Restore data from backup (but not immediately โ€“ wait for the system to be fully initialized).

Checking of operability:

  • ๐Ÿ“ž Test in order: Calls and mobile Internet, Wi-Fi and Bluetooth, camera (main and front) Fingerprint sensor.

๐Ÿ”‹ Check charging (sometimes after firmware requires battery calibration).

If something's not working:

  • ๐Ÿ” For sensor or camera problems, try flashing modules separately through Fastboot: fastboot flash persist. persist.img
  • ๐Ÿ“ก If there is no network, check. IMEI (Enter *#06# and restore it through QCN-file.

8. Alternative methods of firmware

If MiFlash failed, there are other methods:

  • ๐Ÿ–ฅ๏ธ Through Fastboot manually: For power users. Commands for firmware: fastboot flash boot boot.img fastboot flash system system.img fastboot flash vendor vendor.img fastboot reboot

Which way to choose?

  • ๐Ÿ”„ For recovery after failure - MiFlash.
  • ๐Ÿ“ฒ For custom firmware installation โ€” TWRP.
  • ๐Ÿ”ง For point-by-point updates of individual sections โ€“ Fastboot manually.

FAQ: Frequent questions about Xiaomi firmware

โ“ Can I flash Xiaomi without unlocking the bootloader?
No, unlocking is mandatory for firmware via MiFlash or Fastboot. Exceptions are an update via Ota Updater (if the phone is turned on) or firmware via TWRP (if the Recovery are already installed).
โ“ Why MiFlash doesnโ€™t see my Xiaomi?
There are several reasons: ๐Ÿ”Œ Qualcomm or Mediatek drivers not installed. ๐Ÿ”„ Phone is not in Fastboot mode (check the button combination). ๐Ÿ–ฅ๏ธ Used. USB 3.0 or non-original cable. ๐Ÿ”’ Antivirus Blocks MiFlash (Disable Protection).
โ“ How to return the official firmware after custom?
Sweep through the official firmware through MiFlash in Clean all mode. If the bootloader was blocked, it will have to be unlocked again. Attention: on some models (for example, POCO F1), after custom firmware, Anti-rollback may work, and it will be more difficult to return stockware.
โ“ How long does it take to get through MiFlash?
On average, 5-15 minutes, depending on the: ๐Ÿ“ Size of firmware (e.g, MIUI 14 weighs ~3GB). ๐Ÿ–ฅ๏ธ PC performance (preferably used) SSD). ๐Ÿ”Œ Speeds. USB-port (USB 2.0 slower USB If the process lasts longer than 20 minutes, interrupt it and check the connection.
โ“ Can I use Xiaomi on Mac or Linux?
MiFlash only works on Windows, but there are alternatives: ๐Ÿง On Linux, you can use fastboot in the terminal (the commands are the same as in Windows). ๐ŸŽ Macs will require a virtual machine with Windows or Boot Camp. TWRP or ADB Cross-platform tools are suitable without restrictions.