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!
β οΈ 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:
- 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.
- Apply for unlocking through the official Mi Unlock Tool. You will need to specify the reason for unlocking (select "For personal use").
- 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.
- 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 firmware | Expansion | For what occasions? | Installation via Fastboot |
|---|---|---|---|
| Fastboot (full) | .tgz or.zip | Complete flashing, recovery after failures | β Yes. |
| Recovery (update) | .zip | Update 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.zip | Installation 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?
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:
- Open the command line in the folder with fastboot (press Shift + PCM β Open the command window).
- Check the phone connection: fastboot devices must display the serial number of the device.
- 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
- Clear the cache: fastboot erase cache fastboot erase userdata
- 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
β οΈ 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 unpacked | Re-download the firmware and check the integrity of the archive |
| Mi Flash: 0x80070002 | Incompatibility of the Mi Flash Tool and the firmware | Use Mi Flash Tool 2020.3.14.0 or manually swipe it |
| Anti-Rollback check fail | Trying to flash the old version of MIUI | Find firmware with the same or newer Anti-Rollback number |
| The phone does not turn on after the firmware | No critical sections (e.g. modem) are stitched | Repeat 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:
- Download the recovery.img image for your model from the official TWRP website.
- Put your phone in Fastboot mode.
- Recovery: Fastboot Flash Recovery twrp-3.7.0_12-alioth.img
- 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):
- Download firmware in.mbn format (for example, from xiaomiflash.com).
- Connect your phone to your PC by holding the Volume Up + Volume Down + Power (to log into EDL).
- 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.