How to install firmware on Xiaomi via Fastboot from your computer: the full guide

Installing firmware on Xiaomi smartphones via Fastboot mode is one of the most reliable ways to bring a device back to life after a crash, upgrade to the latest version of MIUI or upgrade to custom firmware. Unlike Recovery, Fastboot allows you to stitch even β€œbricks” β€” phones that do not turn on or hang on the logo. But the process requires care: an error at any stage can lead to complete loss of data or inoperability of the device without the possibility of recovery through standard means.

In this guide, we will go through the entire process in detail, from preparing your computer and unlocking the bootloader to choosing the right firmware and installing it. This guide is suitable for all modern Xiaomi, Redmi, POCO and Black Shark models, including devices on the Qualcomm Snapdragon and Mediatek platform, and pay special attention to the typical mistakes that users make and how to avoid them.

1. Preparation of the computer and smartphone

Before you start firmware, you need to make sure that both the PC and the phone are ready for the procedure, and skipping either of these steps can cause failures during the installation process.

The computer must be installed:

  • πŸ–₯️ Drivers for Xiaomi – without them, the system will not recognize the device in Fastboot mode. Download the official Mi Flash Tool package or use universal drivers ADB/Fastboot Google.
  • πŸ“ Mi Flash Tool is a Fastboot firmware utility, the current version (2026) supports all modern models.
  • πŸ”Œ Cable USB β€” It's preferably original or high-quality, data-enabled charging cables are often not suitable!

From the smartphone side:

  • πŸ”‹ Battery charge at least 60% β€” The firmware may take up to 15-20 minutes, and the discharge in the process will lead to failure.
  • πŸ“± Unlocked bootloader – without this firmware through Fastboot is impossible (more in the next section).
  • πŸ“‚ Backup – all files on internal memory will be deleted!
πŸ“Š What is your experience with Xiaomi firmware?
First time.
I stitched it 1-2 times.
Experienced user
Never stitched.

⚠️ Note: If your device was purchased in China (suffixed version) CN), firmware MIUI This can cause problems with the modem (no network), in which case additional firmware of non-persist files or the use of special patches is required.

2 Unlocking the Xiaomi bootloader

The bootloader on all Xiaomi smartphones is locked by default, a security measure that prevents unauthorized changes to system files, and to flash the device through Fastboot, it must be unlocked.

The unlocking process includes several stages:

  1. Linking your Mi Account to your device is impossible without this. Go to Settings β†’ Mi Account β†’ Linked Devices and make sure your phone is linked to your account.
  2. Apply for unlocking through the official Mi Unlock Tool. You will need to specify the reason for unlocking (select "For personal use").
  3. The approval process usually takes 3 to 7 days, and Xiaomi may refuse if the device is new (less than 7 days after the first activation) or if the account is not confirmed.
  4. Direct unlock through Mi Unlock Tool in Fastboot mode. Connect your phone to your PC, launch the utility and follow the instructions.

Once you successfully unlock it, the phone will have Unlocked on the screen when you boot it, and you can start the firmware.

πŸ’‘

If the Mi Unlock Tool gives you a β€œCouldn’t unlock” error, try using the 2022 version (3.5.1118.51) – it often works more stable than new releases.

3. Choosing the Right Firmware

Firmware error is the most common reason for β€œbricking” devices. Xiaomi produces several types of firmware, and not all of them are suitable for installation through Fastboot.

The main types of firmware:

Type of firmwareExpansionFor what occasions?Installation via Fastboot
Fastboot (full).tgz or.zipComplete flashing, recovery after failuresβœ… Yes.
Recovery (update).zipUpdate via stock Recovery❌ No.
Anti-Rollback.zip (as part of Fastboot)Downgrading the version of MIUIβœ… Yes (with the risk of lockdown)
Castomic (AOSP, LineageOS).img or.zipInstallation of alternative firmwareβœ… Yes (requires unlocking)

Where to download the official firmware:

  • 🌍 Global versions - official website MIUI (Choose Fastboot in the filters).
  • πŸ‡¨πŸ‡³ Chinese version - miui.com (translator required).
  • πŸ”§ Castom firmware - forums XDA Developers or Telegram channels (for example, MIUI Pro).

⚠️ Attention: Firmware version MIUI older than the one installed on the device initially, can trigger the mechanism Anti-Rollback, in which case the phone locks at the bootloader level, and it can only be unlocked through the Xiaomi service center (cost) ~30-50$).

4. Step-by-step instructions for firmware through Fastboot

When you're done, you can start firmware. Follow the instructions strictly by step, and you can make mistakes.

Make sure the bootloader is unlocked | Download Fastboot firmware for your model |Install Mi Flash Tool and drivers | Disable antivirus (it can block the process) | Connect the phone to the PC with the original cable-->

Step 1: Transfer your phone to Fastboot mode

Turn off the device. Press and hold the Loud Down + Power buttons until the Fastboot logo appears. The Android Bootloader Interface should appear on the computer screen in Device Manager.

Step 2: Launch the Mi Flash Tool

Unpack the archive from the Mi Flash Tool and launch the file XiaoMiFlash.exe on behalf of the administrator. In the program, click Select and specify the path to the unpacked firmware (the folder must contain files with the.img extension).

Step 3: Connecting the phone and selecting the firmware mode

Connect your phone to your PC. The Mi Flash Tool will appear COM-port of your device. At the bottom of the program, select one of three modes:

  • πŸ”„ Clean all – complete data cleanup (recommended for version change) MIUI).
  • πŸ—ƒοΈ Clean all and lock - cleaning + Loader lock (only for official firmware!).
  • πŸ› οΈ Save user data – saving user data (not always stable).

Step 4: Starting the firmware

Press Flash and wait until the process is complete. In the program log, you will see progress (green ticks next to each file). The firmware takes 5 to 20 minutes depending on the model and speed. USB-port.

Step 5: First download

Once the firmware is successful, the phone will automatically restart. It can take up to 10-15 minutes to boot up the first time -- don't interrupt the process! If the device has been stuck on the logo for longer than 20 minutes, try reflashing.

What if the Mi Flash Tool can't see the phone?
1. Check if drivers are installed (there should be no exclamation points in Device Manager). 2. Try another one. USB-port (preferably) USB 2.0 back-panel). 3. Disable driver signature in Windows: run the command line from the administrator and execute bcdedit /set nointegritychecks on, then restart the PC. 4. Use a different cable (original from Xiaomi). 5. If the phone is still not determined, try flashing through fastboot manually (instructions in the next section).

5. Firmware through Fastboot manually (alternative method)

If the Mi Flash Tool fails to work (e.g., it produces an error of 0x80070002 or 0x80004005), you can manually flash the device through the command line. This method requires knowledge of the basic commands of fastboot, but gives you more control over the process.

Files required:

  • πŸ“‚ Unpacked Fastboot firmware (file folder *.img).
  • πŸ–₯️ ADB Fastboot – download Platform Tools from Google.

Step-by-step teams:

  1. Open the command line in the folder with fastboot (press Shift + PCM β†’ Open the command window).
  2. Check the phone connection: fastboot devices must display the serial number of the device.
  3. Scroll each section in turn (example for Redmi Note 10 Pro): fastboot flash boot boot.img fastboot flash recovery.img fastboot flash recovery system.img fastboot flash vendor.img fastboot flash dtbo dtbo.img fastboot flash vbmeta vbmeta.img
  4. Clear the cache: fastboot erase cache fastboot erase userdata
  5. Reboot the device: fastboot reboot

For convenience, you can create a.bat file with all commands and run it automatically. Example script for POCO X3 Pro:

Example of a bat file for automatic firmware
@echo off fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash dtbo dtbo.img fastboot flash vbmeta vbmeta.img fastboot flash system system.img fastboot flash vendor vendor.img fastboot flash product product.img fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img fastboot erase cache fastboot erase userdata fastboot reboot

⚠️ Note: With manual firmware, it is easy to skip a critical partition (e.g. modem or bluetooth). If the network or Wi-Fi is not working after the reboot, scrolle the missing partitions separately. A list of all available partitions can be obtained by command: fastboot getvar all

Typical errors and their solutions

Even if you follow the instructions, you can make mistakes, and let's look at the most common ones and how to fix them.

Mistake.Reason.Decision
fastboot: error: cannot load 'boot.img'The firmware file is damaged or not unpackedRe-download the firmware and check the integrity of the archive
Mi Flash: 0x80070002Incompatibility of the Mi Flash Tool and the firmwareUse Mi Flash Tool 2020.3.14.0 or manually swipe it
Anti-Rollback check failTrying to flash the old version of MIUIFind firmware with the same or newer Anti-Rollback number
The phone does not turn on after the firmwareNo critical sections (e.g. modem) are stitchedRepeat the firmware by adding the missing commands
This package is for "sweet" devices; this is a "tucana".The firmware is not suitable for your model.Check the code name of the device with the command fastboot getvar product

If you boot up after firmware but there are bugs (e.g., the camera or fingerprint sensor is not working), you probably used firmware from another device modification, such as stitching the Redmi Note 9 Pro (codename joyeuse) with firmware from Redmi Note 9S (curtana), in which case you need to find firmware for your model.

πŸ’‘

Before you run your firmware, always check the code name of the device with the command fastboot getvar product. For example, for the POCO F3 it will be alioth, and for the Redmi K40 it will also be alioth (it is the same device under different brands).

7. Firmware custom Recovery and cores

In addition to the official firmware, Fastboot can install custom Recovery (such as TWRP or OrangeFox) and kernels, which opens up the possibility of installing informal firmware such as LineageOS or Pixel Experience.

Installation of TWRP:

  1. Download the recovery.img image for your model from the official TWRP website.
  2. Put your phone in Fastboot mode.
  3. Recovery: Fastboot Flash Recovery twrp-3.7.0_12-alioth.img
  4. Download to Recovery immediately so that the stock firmware doesn’t overwrite it: fastboot boot twrp-3.7.0_12-alioth.img

Installation of the custom core:

Castomic cores (such as FrancoKernel or Perseus) improve performance and autonomy, but can lead to unstable operation. Install them only if you understand the risks!

  • πŸ”§ Download the kernel in format AnyKernel3.zip or Image.gz.
  • πŸ“ If the kernel is boot.img, The command is: fastboot flash boot kernel.img
  • πŸ”„ For.zip cores, installation is required through TWRP.

⚠️ Attention: Some custom cores disable the dm-verity signature verification, which can lead to problems with SafetyNet (bank applications and Google Pay will not work). --disable-verity --disable-verification flash vbmeta vbmeta.img

8.Recovery after failed firmware

If something goes wrong and the phone stops turning on or freezes on the logo, don't panic. In most cases, the device can be restored.

Recovery methods:

  • πŸ”„ Firmware re-runs – often helps to simply repeat the process with another firmware version.
  • πŸ› οΈ Firmware through EDL β€” If Fastboot is not working, you can use Emergency Download Mode (requires an authorized Xiaomi account and Qualcomm boxing).
  • πŸ“‘ Calling the service - if the device is not determined in any mode, it remains only to carry it to the service center (restore cost) ~20-50$).

Instructions for firmware via EDL (for advanced users):

  1. Download firmware in.mbn format (for example, from xiaomiflash.com).
  2. Connect your phone to your PC by holding the Volume Up + Volume Down + Power (to log into EDL).
  3. Use the Mi Flash Pro or QFil utility to firmware in EDL-mode.

If you're not sure about yourself, you should call in the experts. The wrong actions in EDL mode can finally "kill" the device.

πŸ’‘

Before you go to the service, check if your device is under warranty. If so, don't tell me you tried to stitch your phone yourself, in which case, EDL recovery will be free.

FAQ: Frequent questions about Xiaomi’s firmware through Fastboot

❓ Can I flash Xiaomi through Fastboot without unlocking the bootloader?
No, unlocking the bootloader is mandatory for firmware through Fastboot. The only exception is the official updates via MIUI Updater, but they are installed in Recovery mode, not Fastboot.
❓ Why Mi Flash Tool is not done with the error "Flash is not done"?
This error occurs for several reasons: Incompatibility of the utility and firmware version (try Mi Flash Tool 2020.3.14.0). MD5). Problems with USB-Port or cable (try port) USB Also make sure that the Clean all mode is selected in the program settings.
❓ How to find out the code name of your Xiaomi?
Codename can be found in several ways: Fastboot: fastboot getvar product. Phone settings: Settings β†’ Phone β†’ About β†’ MIUI version (click a few times on "Core Version" - codename will appear). On the device box or under the battery (for models with a removable lid). Examples of codenames: Redmi Note 10 Pro - sweet, POCO X3 NFC - surya, Mi 11 - venus.
❓ What to do if the network or Wi-Fi does not work after firmware?
This is a typical problem when running an incompatible version of MIUI. Solutions: Sweeve the modem and nvram sections from the original firmware: fastboot flash modem modem.img fastboot flash nvram nvram.img If the problem persists, run the full firmware of the knowingly working version. For Chinese devices (CN), you may need to run a global firmware version with a modem patch.
❓ Can I go back to an older version? MIUI?
Technically yes, but with caveats: If the new firmware has a higher Anti-Rollback number, the rollback will block the bootloader. To roll back, choose firmware with the same Anti-Rollback number or higher. Before rolling back, make a backup copy of the persist partition (it is responsible for the retraction). IMEI Check the Anti-Rollback number in the file. flash_all.sh inside the firmware archive (line) anti_version).