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

Installing firmware via Fastboot is one of the most reliable ways to upgrade or restore a Xiaomi smartphone when standard methods don’t work, and it allows you to flash the device even when the system doesn’t boot, there are critical errors or you need to roll back on the previous version of MIUI. However, the process requires care: wrong actions can turn the phone into a brick.

Unlike Recovery, Fastboot provides low-level access to the device’s memory, which allows you to bypass the limitations of a standard upgrade, but there are nuances: you need an unlocked bootloader, the right firmware and follow the instructions carefully. In this article, we will discuss the entire process from preparation to final verification, and also look at typical errors and how to fix them.

1. Firmware Preparation: What to Do Before Starting

Before you start running your firmware through Fastboot, make sure that all the preliminary steps are followed, which minimizes the risks and simplifies the process.

First, check your Xiaomi model and its code name (e.g., Redmi Note 10 Pro is sweet, Poco X3 Pro is vayu). You can find it in the settings (Settings β†’ Phone β†’ MIUI β†’ Model) or through the fastboot getvar product command in the terminal. Using firmware for another model will cause the device to fail.

  • πŸ”Œ The battery charge is at least 50 percent, and the firmware can take up to 30 minutes, and the discharge in the process will interrupt the operation.
  • πŸ’» Windows computer 10/11 (recommended macOS/Linux. Windows will require Mi Flash Tool drivers.
  • πŸ“₯ Firmware in.tgz or.zip format for your model. download only from official sources (Xiaomi Firmware Updater or Xiaomi Firmware Updater).
  • πŸ” Unlocked bootloader. Without this, the Mi Flash Tool won't be able to flash the device.

⚠️ Note: If you are flashing a device with a locked bootloader, first unlock it through the Mi Unlock Tool.The process takes up to 720 hours (30 days) of waiting for new Mi accounts.

Also prepare a USB cable (preferably the original) and disable the antivirus - it can block the Mi Flash Tool as potentially dangerous software. If you use a laptop, connect it to the network: a sudden power outage during firmware can damage the phone.

πŸ“Š How often do you update your firmware on Xiaomi?
Every month.
Six months
Only in critical errors
Never update.

2 Unlocking the bootloader: a mandatory step before the firmware

The bootloader on Xiaomi smartphones is locked by default, a security measure, but it also makes it harder to run through Fastboot. Unlocking requires linking the Mi Account to the device and waiting (up to 30 days for new accounts).

The unlocking process:

  1. Download the Mi Unlock Tool and install it on PC.
  2. Turn on the phone Developer Mode (7 times click on the MIUI version in the settings) and activate OEM Unlock in Settings β†’ Additional β†’ For developers.
  3. Link your Mi Account to your device in Settings β†’ Xiaomi Account β†’ Mi Cloud.
  4. Launch the Mi Unlock Tool, log in to your account and connect your phone in Fastboot mode (clip Volume Down + Power when your phone is off).
  5. Press Unlock and wait until it's finished. If you get a wait message, try again after the time.

⚠️ Warning: Once the bootloader is unlocked, all data on the phone will be reset. Backup through Settings β†’ Additionally. β†’ Backup and reset.

If you already have the bootloader unlocked, skip this step. You can check the status by the command:

fastboot oem device-info

In the answer, look for the line Device unlocked: true.

πŸ’‘

If the Mi Unlock Tool gives you a "Couldn't unlock" error, try using another one. USB-port or disable driver signatures in Windows via bcdedit /set nointegritychecks on (requires administrator rights).

3. Selection of firmware: official vs custom

The type of firmware depends on the stability of the device.

  • πŸ“¦ Official firmware from Xiaomi (MIUI Stable/Developer). They are tested and optimized, but may contain bloatwar (pre-installed applications).
  • πŸ› οΈ Custom firmware (e.g. LineageOS, Pixel Experience) gives more freedom, but requires experience and can work unstablely.
  • πŸ”„ Downgrade Firmware, which allows you to go back to the previous version MIUI, if the new one is working with errors.

For beginners, we recommend official firmware.

SourceType of firmwareReference
Official Xiaomi websiteStable/Developermi.com
Xiaomi Firmware UpdaterStable/Developer (archive)xiaomifirmwareupdater.com
4PDA (forum)Castomic, ported4pda.to
SourceForgeInformal assembliessourceforge.net

Pay attention to the firmware version:

  • Stable is a stable version, suitable for everyday use.
  • Developer is a test version with new features, but bugs are possible.
  • Fastboot is a firmware for installation via Fastboot (file with the extension.tgz or.zip).
  • Recovery is a firmware for installation via Recovery (not suitable for our method).
What is the danger of firmware from third-party sources?
Unofficial firmware may contain malicious code, unstable cores, or incorrect settings for your model, such as firmware for the Redmi Note 9 Pro (joyeuse) will not work for the Redmi Note 9S (curtana), although the devices are similar in appearance, leading to loading errors or complete module failure (camera, sensors, communication).

4. Installation of drivers and Mi Flash Tool

Fastboot requires drivers to connect your phone to your PC, and Windows automatically installs them when you connect your device, but there are often problems. Here's how to fix them:

Download the Mi Flash Tool and unpack the archive.

  1. Connect your phone in Fastboot mode (clip Volume Down + Power when the phone is off).
  2. Open Device Manager in Windows (Win + X β†’ Device Manager).
  3. Find a device with an exclamation point (usually Android Bootloader Interface or Other devices).
  4. Update the driver manually by specifying a folder with the Mi Flash Tool (for example, C:\MiFlash\driver).

If the driver is not installed:

  • πŸ”§ Turn off driver signature verification in Windows (Perform) β†’ gpedit.msc β†’ User configuration β†’ Administrative templates β†’ System system β†’ Installation of the driver β†’ Disable the check).
  • πŸ”„ Restart the PC and reconnect.
  • πŸ–₯️ Try another one. USB-port USB 2.0, because USB 3.0 sometimes conflicts).

After installing the drivers, run the Mi Flash Tool on behalf of the administrator. The program must identify the connected device in the list.

Download the latest version of Mi Flash Tool| Unpack the archive to the root of the drive C:|Install drivers manually | Connect your phone in Fastboot mode | Run Mi Flash Tool on behalf of the administrator-->

5. Step-by-step instruction: firmware via Fastboot

Now, to the process itself, follow the instructions carefully, because errors at this point can lead to a brick in the device.

Step. 1: Unpack the downloaded firmware (.tgz or.zip) into a folder without Cyrillic characters (for example, C:\MiFlash\ROM). There's gotta be a file inside. flash_all.bat (for Windows or flash_all.sh (for macOS/Linux).

Step 2: Open the Mi Flash Tool and:

  1. Click Select and point the way to the folder with unpacked firmware.
  2. At the bottom, select firmware mode: Clean all – complete clean (deletes all data, including internal memory); Clean all and lock – clean + lock the bootloader (not recommended if you plan to further manipulate); Save user data – save user data (not always working correctly).

Refresh

Flash

Step 3: Once finished, the phone will automatically restart. The first launch can take up to 10 minutes - don't interrupt the process!

⚠️ If the Mi Flash Tool is an error 0x80070002 or 0x80004005, Check: Correctness of the firmware selected (for your model!). Archive integrity (jump if files are corrupted). USB 2.0 (not 3.0).

πŸ’‘

Always use Clean All mode when running through Fastboot if you want to avoid conflicts between old and new system files. Save user data mode can cause crashes due to incompatibility of settings.

Typical errors and their solutions

Even with the exact following of the instructions, there can be problems.

Mistake.Reason.Decision
This package is for "XXX" devices; this is a "YYY".The firmware is not suitable for your model.Download the firmware for the correct device code (e.g., suryain instead of surya).
Flash is not done. Reboot the device manually.The firmware process or driver error is interrupted.Reboot your phone to Fastboot and try again. USB-connection.
The phone does not turn on after the firmware (black screen).Incompatible firmware or error when writing partitions.Repeat the firmware with Clean all mode. If it doesn't work, run through EDL (requires an authorized account).
MiFlash can't see the device.There are no drivers or USB issues.Install drivers manually (see section 4) or try another cable/port.

If the phone boots up after firmware, but there are errors (e.g., the camera or mobile network is not working), it is likely that the firmware was assembled without considering the hardware features of your model.

  • πŸ” Check the firmware version for compliance with the region (Global, China, EEA).
  • πŸ”„ Try flashing another build (e.g. Stable instead of Developer).
  • πŸ“± Reset the settings to factory (Settings) β†’ Additionally. β†’ Backup and reset).

For complex cases (such as hard bricks when the phone doesn’t respond to buttons), you may need to run through EDL (Emergency Download Mode), a technique that requires special hardware (Qualcomm HS-USB QDLoader 9008) and an authorized Xiaomi account.

7. Verification of the result and further actions

After a successful firmware, you need to make sure that everything works correctly.

  • πŸ“± Check the basic functions: calls, SMS, mobile Internet, Wi-Fi, Bluetooth.
  • πŸ“· Test the camera: take a photo on the main and front cameras, check the video recording.
  • πŸ”‹ Make sure the battery is running smoothly: If the phone is quickly discharged or overheated, it may not be the firmware that is optimized.
  • πŸ”’ Check the status of the bootloader: if it is locked (fastboot oem device-info), unlock it again if you plan to further manipulate it.

If everything is working properly, you can start setting up the phone:

  1. Sign in to your Mi Account (if required).
  2. Restore the data from the backup (if you did a backup).
  3. Update your apps through Google Play.
  4. Set up your fingerprint/face (if supported).

If you have flashed the Developer version of MIUI, note that it may contain bugs. Keep an eye out for updates in Settings β†’ About Phone β†’ System Update. To return to the Stable version, repeat the firmware via Fastboot with the corresponding package.

πŸ’‘

After the firmware is installed, it is recommended to calibrate the battery: completely discharge the phone before turning off, then charge to 100% without interruption, which will help the system correctly determine the level of charge.

FAQ: Frequent questions about Xiaomi’s firmware through Fastboot

❓ Can I flash Xiaomi through Fastboot without unlocking the bootloader?
No. Without the unlocked bootloader, the Mi Flash Tool won't be able to write firmware to the device's memory, except for the firmware via EDL, but it requires authorization from Xiaomi and special hardware.
❓ How to find out which firmware is suitable for my Xiaomi model?
Check the device codename through the fastboot getvar product command or in settings (Settings β†’ About Phone β†’ MIUI β†’ Model). Then download the firmware with the same codename (e.g., raphael for the Redmi K20 Pro).
❓ What to do if the phone does not turn on after the firmware?
First, try to pinpoint Volume Up + Power for 10-15 seconds for a forced reboot. If it doesn't work: Repeat firmware with Clean all mode. Check firmware compatibility with your model. If the phone doesn't respond at all (black screen, no vibration), you'll need firmware through EDL.
❓ Can I flash Xiaomi via Fastboot on Mac or Linux?
Yes, but you'll need to use the terminal and fastboot utilities. Instructions: Unpack the firmware and go to the file folder. +x flash_all.sh (for Linux/Mac). Run the script:./flash_all.sh. Make sure that drivers for Fastboot are installed (Linux may require adding udev rules).
❓ How to return a standard firmware if the custom is unstable?
Download the official Stable firmware for your model and run it through Fastboot in Clean All mode, which will delete all data, but return the phone to factory status, and if the bootloader was locked, it will have to be unlocked again.