Xiaomi Firmware through Fastboot and MiFlash: A Complete Guide from Preparation to Installation

Why is Fastboot the most reliable way to run Xiaomi?

Firmware from Xiaomi smartphones via Fastboot and MiFlash is considered one of the most stable methods of updating or restoring the system. Unlike recovery firmware, this method works even on β€œbricks” – devices that are not turned on or stuck on the logo. The main advantage is that the firmware goes directly into the memory of the phone, bypassing the limitations of the standard recovery mode.

The method is relevant for all Xiaomi lines: from budget Redmi Note to flagship Mi 13 However, there are nuances: for example, for new models (released after the release of the new model). 2022 Mi Account authorization may be required before unlocking the bootloader. In this article, we will discuss the process from A to Z, from preparing drivers to solving common errors such as: flash_all_lock.bat or anti-rollback.

Important: Fastboot completely erases user data (including photos, contacts, and apps). If the phone is still turned on, back up via Settings β†’ About Phone β†’ Backup or Mi Cloud.

Preparation for firmware: what will be needed?

Before you start, make sure you have everything you need.

  • πŸ”Œ Cable USB (Preferably original from Xiaomi – cheap cables can cause connection errors).
  • πŸ’» Computer on Windows 7/10/11 (MiFlash is unstable on macOS and Linux).
  • πŸ“± Battery charge of at least 50% (when discharged during firmware, the phone can turn into a brick").
  • πŸ”“ Unlocked bootloader (if you are flashing unofficial firmware or changing region).
  • πŸ“ Firmware in.tgz or.zip format (download only from official sources - see the section below).

Pay special attention to drivers, without them, the computer will not recognize the phone in Fastboot mode.

  • πŸ–₯️ Official Xiaomi drivers (choose version for your OS).
  • πŸ”§ MiFlash Tool (the latest version can be found here).
  • πŸ”„ ADB Fastboot (part of Android) SDK Platform-Tools).
πŸ“Š What tool do you use for Xiaomi firmware?
MiFlash
SP Flash Tool
TWRP
ADB Sideload
Other

Where to download the official firmware for Xiaomi?

Never use firmware from questionable forums or torrents! this can lead to:

  • 🚨 Blocking IMEI (The phone will lose communication with the networks of operators).
  • πŸ”’ Anti-rollback error (if the firmware is older than the current version).
  • πŸ“΅ Loss of warranty (when using custom firmware).

The official firmware for Xiaomi is available on three resources:

SourceType of firmwareReferenceNotes
Miui DownloadsStable/BetaWebsiteFirmware for all regions (Global, China, EEA, Russia)
Xiaomi Firmware UpdaterStable/Beta/ArchiveWebsiteAutomatically Updated Firmware Archive
4PDA (Section Xiaomi)Castomic/PortedForumOnly for experienced users!

When choosing a firmware, pay attention to:

  • πŸ“Œ The phone model (e.g. Redmi Note 10 Pro is codenamed Sweet).
  • 🌍 Region (Global, China, EEA β€” The squirrels are incompatible with each other!).
  • πŸ”’ Version MIUI (You can’t stitch the old version over the new one because of the anti-rollback).
adb shell getprop ro.product.device

Or look at the sticker under the battery (for collapsible models).-->

Unlocking the bootloader: a mandatory step before the firmware

If you are flashing informal firmware (like LineageOS or Pixel Experience) or changing region (from China to Global), you first need to unlock the bootloader.

The unlocking process:

  1. Link your Mi Account to your phone in Settings β†’ Xiaomi account.
  2. Activate USB debugging in Settings β†’ About Phone β†’ MIUI version (click 7 times, then go back to Additional β†’ For Developers).
  3. Download Mi Unlock Tool and log in to the program.
  4. Connect your phone in Fastboot mode (clip Volume Down + Power) and follow the instructions in the utility.

⚠️ Note: Xiaomi has tightened unlock rules since 2023. for new models (Redmi Note 12, POCO X5 And newer than that, 168 hours (7 days) after the account is attached, and older models unlock in 72 hours.

Once the bootloader is unlocked, the phone will reset to factory settings. This is normal, as Xiaomi protects itself from unauthorized access.

What if the Mi Unlock Tool can't see the phone?
Make sure: 1. Qualcomm HS-USB QDLoader 9008 drivers are installed (check in Device Manager). 2. The phone is really in Fastboot mode (a screen with a rabbit and the inscription Fastboot). 3. Antivirus is disabled (it can block the utility). 4. The original cable is used (try USB 2.0 ports on the back of the PC).

Step-by-step: Xiaomi firmware through MiFlash

Now, to the process itself, follow the instructions in strict order.

  1. Unpack the firmware in a folder without Cyrillic characters (for example, C:\Xiaomi\ROM). There must be a file in the archive. flash_all.bat (or flash_all_lock.bat lock-down).
  2. Run MiFlash on behalf of the administrator (right click β†’ β€œRun on behalf of the administrator”).
  3. Connect your phone in Fastboot mode (clip Volume Down + Power before the rabbit appears).
  4. In MiFlash, click Select and specify the folder with the unpacked firmware.
  5. Choose the firmware method: πŸ”„ Clean all – complete cleaning (recommended for region change). πŸ”„ Clean all and lock - cleaning + Loader lock (only for official firmware!). πŸ”„ Save user data – saving data (risky, can lead to errors).

Flash

Make sure that:

Selected the right firmware for your model|Phone's 50-charged%+|All drivers installed|MiFlash Launched on Administrator's Name|Cable connected to port USB 2.0-->

If the process is successful, the phone will automatically restart. It can take up to 10 minutes to turn on the first one, which is normal. Don't interrupt the process.

⚠️ Note: If MiFlash is an anti-rollback error, you are trying to flash an older version. MIUI, Solution: download the firmware of the same or newer version.

Typical Fastboot Firmware Errors and Their Solutions

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

Mistake.Reason.Decision
flash_all.bat not foundFirmware unpacked incorrectly or not fully downloadedRe-download the firmware and unpack it to the root of the disk (for example, C:\ROM\).
Device not foundDrivers not installed or phone not in Fastboot modeCheck the connection, install drivers manually through Device Manager
Anti-rollback check errorTrying to flash the old version of MIUIDownload the firmware of the same or newer version (check the build number in Settings β†’ About phone)
Flash is not doneConnection interrupted or lack of rightsRun MiFlash on behalf of the administrator, use the USB 2.0 port

If the phone does not turn on after firmware or hangs on the logo:

  • πŸ”‹ Try charging it for 30 minutes, then hold on to power + Volume up 20 seconds.
  • πŸ”„ Repeat the firmware with the choice of Clean all (complete cleaning).
  • πŸ“‘ If the phone is not catching the network, check that the firmware is suitable for your region (for example, Redmi Note 11 for Russia should be on firmware). EEA or Global, not China).

πŸ’‘

If the MiFlash is 99% freeze-free, don’t interrupt! This is normal for some models (like the POCO F3).

Custom Firmware: What You Need to Know?

If you decide to install an informal firmware (such as LineageOS, Pixel Experience or HavocOS), consider the following points:

  • πŸ”“ The bootloader must be unlocked (see section above).
  • πŸ“‹ TWRP required for most custom firmware (but it must be installed after unlocking the bootloader).
  • 🚫 Banking applications may not work (due to lack of Google certification).
  • πŸ”„ Updates will have to be installed manually (no) OTA).

The process of installing custom firmware through Fastboot:

  1. Unlock the bootloader (see above).
  2. Download TWRP for your model (for example, from the official website).
  3. Fastboot TWRP command: fastboot flash recovery twrp.img fastboot boot twrp.img
  4. In TWRP, reset (Wipe β†’ Format Data), then sew custom firmware and GApps (if you need Google services).

⚠️ Note: On some models (Redmi Note 10 Pro, POCO X3 Pro) after custom firmware is installed, the encryption stops working, which means that after the reboot, the phone will require a password, but will not accept it, Solution: disable encryption in the settings before the firmware or use the firmware with support FBE (File-Based Encryption).

FAQ: Answers to Frequent Questions

Can I flash Xiaomi through Fastboot without unlocking the bootloader?
Yes, but only official firmware in the same region as the current one. For example, if you have Redmi 9 with Global firmware, you can flash another version of Global without unlocking. You must unlock it to change region (from China to Global) or install custom firmware.
What if MiFlash doesn’t see the phone in Fastboot?
Try the following: Reinstall drivers manually through Device Manager (select Qualcomm) HS-USB QDLoader 9008. Use another one. USB-cable (preferably original) Connect the phone to the port USB 2.0 (usually black on the back of your PC) Disable the antivirus and firewall. Try another computer (sometimes the problem is driver conflict).
How to return the official firmware after custom?
To return to stock firmware: Download the official Fastboot firmware for your model from Xiaomi. Unpack it and swipe through MiFlash with Clean all. If the bootloader has been unlocked, it can be locked back by selecting the Clean all and lock option in MiFlash. After that, the phone will return to factory state, but unlocking the bootloader will remain in history (this does not affect work, but can be noticeable in Settings β†’ About Phone β†’ Uploader Status).
Why is the network or Wi-Fi not working after firmware?
This is a typical problem when changing the firmware region. Solutions: If you have flashed China instead of Global, go back to the correct firmware. Check the IMEI (enter *#06#). If it is missing, restore it using Engineer Mode or SN Writer Tool. Models with Modem Partition (e.g. Redmi Note 9 Pro) may need to flash a separate NON-HLOS.bin file via Fastboot.
Can I flash Xiaomi via Fastboot on Mac or Linux?
Technically yes, but it's more complicated: Macs will need to install fastboot via Homebrew and use the terminal instead of MiFlash. Linux needs sudo rights and manually install drivers for Fastboot. GUI-There are no tools for these OSes, so the process is completely console.