How to flash Xiaomi through Fastboot: a complete guide from unlock to install firmware

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 interact with the phone’s hardware directly without the operating system, which is especially useful when you crash, β€œbrick” or want to install custom firmware. However, the process requires care: a mistake at any stage can turn the phone into a β€œbrick”, and incorrect firmware can deprive you of warranty.

In this guide, we will take a look at the entire process from unlocking the bootloader to installing official or unofficial firmware via fastboot. You will learn what tools you need, how to avoid common errors (such as anti-rollback or version incompatibility), and what to do if something goes wrong. POCO 2018-2026, but taking into account the specific features of specific devices.

1. Firmware Preparation: What to Do Before Starting

Before you take action, make sure that all the preliminary steps are taken, which will save time and reduce risks.

Basic requirements:

  • πŸ“± Battery charge of at least 60% (optimum 80%) When discharged during firmware, the device may turn off, leading to hardware failures.
  • πŸ’» Computer on Windows 10/11 Linux (macOS may need additional drivers) Virtual machines are not recommended due to problems with the software. USB-connection.
  • πŸ”Œ Original. USB-Cheap cables often don't transmit data in fastboot mode.
  • πŸ“ Backup data: Firmware through fastboot usually erases internal memory (except with fastboot update for some firmware).

Also check your device model in settings (Settings) β†’ The phone. β†’ It's critical: the firmware from the Redmi Note 10 Pro is not suitable for POCO X3 Pro, even if they're on the same chipset. ADB:

adb shell getprop ro.product.model

⚠️ Note: If your device was purchased in China (suffix version) CN), Global version of the firmware (Global or EEA) It can block the network or the camera. Check compatibility on the forums. XDA Developers or 4PDA.

πŸ“Š What Xiaomi model are you using?
Redmi Note 10/11/12
POCO F/X/M
Mi 11/12/13
Another model

2 Unlocking the bootloader (Bootloader)

Without an unlocked bootloader, it is impossible to flash Xiaomi through fastboot. The manufacturer blocks it by default to protect against unauthorized changes. The unlocking process is official, but requires waiting and linking the Mi Account account to the device.

Steps to unlock:

  1. Link your Mi Account to your phone: Go to Settings β†’ Xiaomi Account and log in. Make sure that the developer settings (Settings β†’ About Phone β†’ MIUI Version β†’ 7 times tap) include OEM Unlock and USB Debugging.
  2. Request permission to unlock: Download the official Mi Unlock Tool utility, log in to it with the same account and connect your phone in fastboot mode (clamp Volume down + Power when the device is off).
  3. Wait for confirmation: Xiaomi can block the unlock for 7-30 days (depending on model and region), during which time you can not reset your phone or change your account.

Once successfully unlocked, the phone will display Unlocked in fastboot mode, and you can start running the firmware.

⚠️ Warning: Unlocking the bootloader resets the device to factory settings. If you don't backup, the data will be lost).

What if the Mi Unlock Tool can’t see the device?
1. Check if Qualcomm drivers are installed HS-USB QDLoader 9008 (for Snapdragon) or MediaTek Preloader (for chips) MTK). 2. Try another one. USB-port (preferably) USB 2.0). 3. Disable the antivirus - it can block the utility. 4. Use the original cable and try another computer.

3. Selection of firmware: official MIUI or custom

Not only does the type of firmware affect the functionality, but also the stability of the device. Xiaomi offers several types of official firmware, and there are many custom ones (for example, LineageOS, Pixel Experience).

Types of official MIUI firmware:

  • πŸ“± Recovery ROM β€” Lightweight version for installation via Recovery (not suitable for fastboot).

For firmware through fastboot, you need Fastboot ROM. You can download it on the official MIUI Downloads website or through Xiaomi Firmware Updater (there is an archive of old versions).

Custom firmware (such as LineageOS) requires:

  • Unlocked bootloader.
  • Installed custom Recovery (TWRP or OrangeFox).
  • Compatible with the device model (check for XDA or 4PDA).
Type of firmwareAdvantagesDeficienciesIs it good for fastboot?
Official MIUI (Fastboot ROM)Stability, OTG support, warranty is maintained (unless the bootloader is unlocked)May contain Bloatware, regional version restrictionsβœ… Yes.
LineageOS (Pixel Experience)Clean Android, regular updates, no adsCamera, NFC or sensors may not work; there is no official support❌ No, you do. TWRP)
Port from another deviceUnique features (e.g. MIUI from Redmi K40 on POCO F3)High risk of "bricking", bugs with sensors⚠️ Possibly, but not recommended.

πŸ’‘

If you are flashing Xiaomi with a MediaTek chipset (such as Redmi 9 or POCO M3), use the SP Flash Tool utility instead of fastboot.

4. Installation of necessary tools

To run through fastboot, you will need:

  • πŸ–₯️ ADB And Fastboot, which is a tool for interacting with the device, can be downloaded as part of Android. SDK Platform-Tools.
  • πŸ“‚ Firmware in.tgz format (unpack it into a folder with fastboot).
  • πŸ”§ Drivers for your device (usually installed automatically when you first connect in fastboot mode).

How to install ADB/Fastboot:

  1. Download Platform-Tools and unpack to the root of the disk C:\platform-tools\.
  2. Add a path to the folder to the PATH environment variable: This computer β†’ Properties β†’ Additional System settings β†’ Environment variables β†’ PATH β†’ Add β†’ C:\platform-tools
  3. Check the work, open it. CMD and entering: fastboot --version The utility version should be displayed.

For Linux, installation is even easier – just perform:

sudo apt install adb fastboot

⚠️ Note: If you are using Windows, disable driver signatures before connecting your device in fastboot mode. CMD (on behalf of the administrator) do: bcdedit /set nointegritychecks on After firmware return settings back with bcdedit command /set nointegritychecks off.

β˜‘οΈ Pre-firmware check

Done: 0 / 5

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

Now, to the process itself, make sure the phone is off and the battery is high enough.

Step 1: Transfer the device to fastboot mode

Press the buttons Volume down + Power on the phone turned off and hold for 5-10 seconds until the Mi Bunny logo with the words Fastboot appears.

Step 2: Connect to the PC and check the connection

Connect the phone to your computer and enter into the CMD:

fastboot devices

If the device is determined (the serial number will appear), you can continue. If not, check the drivers and cable.

Step 3. Starting the firmware

Go to the folder with unpacked firmware and do:

  • For Windows: fastboot flash all or (if there is a script) flash_all.bat
  • For Linux/MacOS: chmod +x flash_all.sh./flash_all.sh

It'll take 5 to 15 minutes, and when it's done, it'll automatically restart. USB-cable and do not interrupt the process, even if it seems that the device is getting stuck - this can damage the boot partition.

Step 4. First setup

Once rebooted, the device will be as new as it is, you will need to go through the initial setup, and if the firmware was informal, you may have to manually stitch the vendor or modem (this is a separate topic).

πŸ’‘

If the firmware is interrupted with an anti-rollback error, you are trying to install an older version of MIUI than the one that was before, in which case you need to flash only those partitions that do not affect anti, or find firmware that is newer than the current one.

Typical errors and their solutions

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

Mistake.Reason.Decision
fastboot: error: cannot load 'persistence.img'The firmware file is damaged or not unpackedRe-download the firmware and check the checksum (MD5)
Device not found or empty list in fastboot devicesDrivers are not installed, the cable is faultyTry another port/cable, install drivers manually through Device Manager
This package is for "tissot" devices; this is a "surya"The firmware is not suitable for your model.Download the firmware specifically for your device code (e.g., surya for POCO X3)
phone is stuck on startup MI logo after firmwareIncompatibility of bootloader or modem versionsSweep separately boot.img and dtbo.img from old firmware

If the device does not turn on after the firmware ("brick"), try:

  1. Switch only boot.img and dtbo.img from the working firmware.
  2. Use the Mi Flash Tool with the Clean All option (Erase everything, including userdata).
  3. For MediaTek, use the SP Flash Tool with the scatter file.

⚠️ Note: If you have lost your firmware after IMEI If the network is not working, it means that the modem partition has been damaged. NVRAM (Look for backups on 4PDA forecast).

7. Custom Recovery firmware (TWRP) via Fastboot

If you plan to install custom firmware (like LineageOS), you first need to flash TWRP or OrangeFox. This is an alternative recovery that allows you to install informal builds.

Instructions:

  1. Download the TWRP image for your model from the official website (file with the extension.img).
  2. Transfer the phone to fastboot and connect to the PC.
  3. The command is fastboot flash recovery. twrp-3.7.0_12-0-surya.img (Replace the file name with yours).
  4. Immediately after the firmware, go to TWRP, holding Volume Up + Power. If you skip this step, the standard recap will rewrite TWRP.

In TWRP, you can make a backup of current firmware (Backup), flash custom firmware (Install), or modify system files.

πŸ’‘

So TWRP not reset when restarting, after installing it, patch disable_dm-verity_forceencrypt.zip (available XDA).

8.After firmware: optimization and verification

Successful firmware is only half the battle, so that the device works steadily.

  • πŸ”„ Reset the settings (Settings) β†’ Additionally. β†’ Recovery and resetting) if stitched over the old system.
  • πŸ“Ά Check the network and IMEI In *#06# If IMEI No, no, restore it through QCN-file (instructions are available on the 4PDA).
  • πŸ”‹ Calibrate the battery: fully discharge and charge the phone 2-3 times.
  • πŸ›‘οΈ Update security: check for patches in Settings β†’ The phone. β†’ Updating the system.

If you have a custom firmware, install:

  • Magisk for root rights (via TWRP).
  • GApps (if not in the assembly) – a package of services Google.
  • Core (optional) to improve performance or save charge.

To check the stability, use the following tests:

  • #4636## - information about the battery and network.
  • CPU Throttling Test (from Play Market) – check overheating.
  • Geekbench – Performance assessment.

πŸ’‘

If the phone is quickly discharged or warmed after firmware, check the background processes in Settings β†’ Battery. Often unoptimized services or an improperly stitched vendor are to blame.

FAQ: Frequent questions about Xiaomi’s firmware through Fastboot

Can I flash Xiaomi through Fastboot without unlocking the bootloader?
No. Fastboot only allows you to flash unlocked devices, except for official updates via fastboot update (for example, for Mi A1/A2), but they do not require full firmware.
What if Mi Unlock Tool says "Couldn't unlock"?
The reasons can be different: Mi Account is not tied to the phone (you need to log in to the settings); the device does not support unlock (for example, some models for the Chinese market); Xiaomi servers are overloaded (try later); Find Device is enabled on the phone (disable it in Mi Cloud); Also check that the fastboot displays Unlocked status (if not, wait for the lock timer to end).
How to flash only individual partitions (for example, boot or system)?
If you only need to update a part of the firmware (for example, the kernel or modem), use the commands: fastboot flash boot.img fastboot flash dtbo.img fastboot flash modem modem.img The full list of sections can be seen by the command: fastboot getvar all Careful: incompatibility of partition versions can lead to bootloop.
Why is the camera or fingerprint sensor not working after the firmware?
This is a typical problem when you run custom or ported firmware. Causes: There's no driver for your camera module in the firmware. Incompatible vendor version. Persist partition damaged. Solutions: Sweep through the original vendor.img and persist.img. Use patches for the camera (for example, ANX Camera for GCam. Return to the official firmware.
Can I roll back the firmware to an older version?
Technically, but with reservations: If the new firmware contains anti-rollback, the device will lock (hard brick). To roll back, you need to flash all partitions from the old firmware, except the userdata. On some models (for example, Xiaomi 12), rollback is impossible due to hardware limitations. Before rolling back, check the anti information for your model on XDA.