How to Install Firmware on Xiaomi via Fastboot: A Complete Guide to Unlocking the bootloader

Why you should use Xiaomi on Fastboot and when you need it

Fastboot is not just an alternative to standard air-to-air updates (OTAs), but it is a powerful tool that allows you to bring back the brick after a failed upgrade, change the region of the device, remove preinstalled software, or install custom firmware like LineageOS or Pixel recovery Experience. Unlike the method, the Fastboot works at the bootloader level, which gives you complete control over the memory partitions of the device.

When should you use this method? First, if your Redmi Note 12 or POCO F5 It stopped loading after experimenting with Magisk or unofficial cores. MIUI due to bugs in the latest update (e.g., with the MIUI 15. MIUI Third, Fastboot is the only way to install global firmware on the Chinese version of the smartphone if the manufacturer has blocked the device. OTA-transition.

But there is a downside: the process requires unlocking the bootloader, which resets the device to factory settings and can void the warranty. In addition, a bug in the firmware stage can turn the smartphone into a โ€œbrickโ€ without recovery. So before you start, check whether your Xiaomi model supports unlocking the bootloader through the official Mi Unlock tool.

๐Ÿ“Š Why you are using Xiaomi for?
Correcting errors after OTA
I'm installing custom firmware.
Change the region of the device.
Recovering from the brick.
Just experimenting.

Preparation for firmware: what to do before the start

Before you connect your smartphone to your PC, make sure that all the preliminary steps are followed. Their skip is the main cause of errors such as critical partition flashing is not allowed or anti-rollback check fail.

1. Check the model and version of the bootloader. Each Xiaomi model has a unique identifier (for example, toco for Redmi Note 10 Pro). You can find it in the settings (Settings โ†’ About Phone โ†’ MIUI version, tap on the "Kernel Version" line several times), also write down the current version of MIUI and build number - this will be useful for choosing the right firmware.

2. Data backup. Unlocking the bootloader erases all data, including DCIM photos, messages and accounts. Use Mi Mover or Google Photos for media backup, and for apps and settings, Swift Backup (requires root).

Installation of drivers and tools. The PC must have:

  • ๐Ÿ”ง Mi Unlock Tool (official utility for unlocking the bootloader, downloaded from the Xiaomi website)
  • ๐Ÿ–ฅ๏ธ ADB and Fastboot (part of Android) SDK Platform Tools by Google)
  • ๐Ÿ“ฑ Drivers for your model (if Windows doesnโ€™t recognize your device in Fastboot mode, use the Mi Flash Tool to install them)

I got the code name of the model.|Created a backup of all the data.|I downloaded the official firmware for my model|I got it. ADB/Fastboot Mi Unlock|Prepared the cable. USB (preferably original)-->

Unlocking the bootloader: a step without which you can not do

The bootloader on Xiaomi smartphones is blocked by default. Unlocking it is a prerequisite for firmware through Fastboot.The process takes from 72 hours to 1 week due to the verification of the Mi Account account.

Step-by-step:

  1. Attach Mi Account to your device: Settings โ†’ Xiaomi Account โ†’ Sync.
  2. Activate USB debugging: Settings โ†’ About Phone โ†’ MIUI version (7 taps per line), then Settings โ†’ Additional โ†’ For developers โ†’ Debugging over USB.
  3. Connect the smartphone to the PC, confirm the debugging permission.
  4. Launch the Mi Unlock Tool and log in with the same account as your phone.
  5. Follow the instructions of the program. Once you send the unlock request, you'll have to wait. SMS-notifications (usually) 3-7 days).

Important: Once unlocked, the device will automatically execute a full wipe. If Mi Unlock gives you a Couldn't unlock error, check:

  • ๐Ÿ”„ Is the smartphone connected in Fastboot mode (turn off the device, then pinch the Power) + Loudness down)
  • ๐Ÿ•’ Is it 72 hours since the account was linked?
  • ๐Ÿ“ฑ Is Chinese firmware used without a global account?
What if Mi Unlock canโ€™t see the device?
1. Check that Windows Device Manager displays Android Bootloader Interface". 2. Try another one. USB-port (preferably) USB 2.0 back-panel). 3. Disable driver signatures in Windows: Execute โ†’ gpedit.msc โ†’ User configuration โ†’ Administrative templates โ†’ System system โ†’ Installation of the driver โ†’ Disable signature verification. 4. Use a different PC with Windows 10/11 (on Linux/Mac Mi Unlock is not working).

Selection of firmware: official vs custom

The type of firmware depends not only on the functionality, but also on the stability of the device. Official firmware from Xiaomi is divided into:

  • ๐ŸŒ Global (GM) โ€” Internationally, with Google services and support for all languages.
  • ๐Ÿ‡จ๐Ÿ‡ณ China (CN) โ€” without Google, but with maximum optimization for the hardware.
  • ๐Ÿ‡ช๐Ÿ‡บ EEA (Europe โ€“ as Global, but subject to European standards (e.g. restrictions on data collection).
  • ๐Ÿ‡ฎ๐Ÿ‡ณ India (IN) โ€” adapted to local networks and conditions.

Custom firmware (e.g. LineageOS, ArrowOS) gives more freedom, but requires experience with TWRP and manual patching of vendor partitions. For beginners, we recommend starting with official builds.

Where do I download the firmware?

Type of firmwareSourceFeatures
Official (Fastboot)miui.comFile name: File name: {model}_global_images_*.tgz
Official (Recovery)Xiaomi Firmware UpdaterFor updating without unlocking the bootloader. Format:.zip
Castomic (AOSP)XDA DevelopersRequires unlocked bootloader and TWRP. Risk of bugs and unstable operation
Port from other devicesDeveloper Telegram channelsExperimental builds. Camera, NFC, or sensors may not work.

Critical detail: firmware for Xiaomi has anti-rollback protection. MIUI On the device with the new bootloader will lead to a "brick." Check the antirollback number in the name of the firmware file (for example, V13.0.4.0.SKFMIXM_20221114.0000.00_12.0_global, where 12.0 โ€” rollback).

๐Ÿ’ก

Before downloading the firmware, check its hash amount (MD5) using the HashMyFiles utility. This will protect you from corrupted files that can interrupt the firmware process.

Step-by-step: Firmware via Fastboot

When the bootloader is unlocked, the firmware is downloaded and the drivers are installed, you can start the main process. Use the Mi Flash Tool (for official firmware) or manual fastboot commands (for custom ones).

Method 1: Mi Flash Tool (recommended for beginners)

  1. Unpack the archive with the firmware (.tgz โ†’.tar โ†’ file folder).
  2. Start the Mi Flash Tool, select the folder with the firmware.
  3. Connect your smartphone in Fastboot mode (clip Power + Volume down).
  4. In the program, press Refresh - the device should appear.
  5. Select firmware mode: Clean all - complete cleaning (recommended when changing the region) Clean all and lock - cleaning + lock bootloader (only for official firmware!) Save user data - data storage (not always stable)

Flash

Method 2: Fastboot manual commands (for experienced)

If the Mi Flash Tool is making errors, use the following console:

fastboot devices # Check the connection


fastboot getvar product # Checking the device model




fastboot flash boot.img # boot section firmware




fastboot flash system.img # System partition firmware




fastboot flash vendor.img #Firmware vendor-section




fastboot reboot #Reboot

To firmware all sections from the firmware folder, use the script:

fastboot flash all -w

The flag -w performs a data reset (analogue of Clean all in Mi Flash).

๐Ÿ’ก

If the firmware process has been stuck at the sending 'system' stage for more than 10 minutes, check USB-cable and port. Use the back USB 2.0 - it's more stable than the front USB 3.0.

Common mistakes and their solutions

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

1. This device is locked error

โš ๏ธ Warning: This error means that the bootloader is not unlocked. Repeat the unlock process through the Mi Unlock Tool. If the utility says Bound to account, but it does not unlock, try it:

  • ๐Ÿ”„ Reconnect your Mi Account in your phone settings.
  • ๐Ÿ“… Wait 7 full days from the first binding.
  • ๐Ÿ“ฑ Use it. SIM-Card that was inserted at the first authorization.

2 Anti-rollback check fail error

โš ๏ธ Note: This error occurs when you try to install firmware with an older anti-rollback number. MIUI Check the number in the firmware file name and on the Xiaomi Firmware Updater website.

3.The device is not defined in Fastboot

  • ๐Ÿ”Œ Try another one. USB-Cable (original from Xiaomi is preferred).
  • ๐Ÿ–ฅ๏ธ Turn off all others. USB-PC-based.
  • ๐Ÿ”„ Reinstall drivers manually through Device Manager (select "Android Bootloader Interface").
  • ๐Ÿง On Linux, add a rule for udev: sudo nano /etc/udev/rules.d/51-android.rules # Add a line: SUBSYSTEM=="usb", ATTR{idVendor}=="2717", MODE="0666"

4.Hanging on the MI logo after firmware

If the device does not load beyond the logo, try:

  • ๐Ÿ”„ Repeat the firmware with full cleaning (Clean all).
  • ๐Ÿ“ฑ Install firmware through Fastboot again, but without a flag -w (unless the data is critical).
  • ๐Ÿ”ง Just pass it. boot.img and dtbo.img separately: fastboot flash boot boot.img fastboot flash dtbo dtbo.img fastboot reboot

What to do after a successful firmware

Once you first download new software, the device can run slower than usual -- that's OK. It indexes files and optimizes applications. Give the smartphone 10-15 minutes to "stop" before you use it.

1. Set up region and languages. If you've stitched the global firmware on the Chinese model, check:

  • ๐ŸŒ Region: Settings โ†’ Additionally. โ†’ Region (Select your country).
  • ๐Ÿ—ฃ๏ธ Language: Settings โ†’ Language and input.
  • ๐Ÿ“ก Network: Settings โ†’ SIM-maps and mobile networks โ†’ Access point (APN) (Manually set up if there is no internet).

2. Data recovery. Don't rush to restore the backup right away!

  • ๐Ÿ”’ Make sure the device is loading stably (2-3 reboot).
  • ๐Ÿ“ฑ Update all apps through Google Play.
  • ๐Ÿ”„ Recover only critical data (contacts, SMS) via Mi Cloud or local backup.

3. Performance check. Test:

  • ๐Ÿ“ถ Mobile communications (calls, SMS, 4G/5G).
  • ๐Ÿ“ท Camera (main and frontal).
  • ๐Ÿ”‹ Charging (fast charging should work without overheating).
  • ๐ŸŽต Speakers and microphone.
  • ๐Ÿ“ GPS and sensors (compass, gyroscope).
fastboot flash modem NON-HLOS.bin

This team recovers the radio module without losing data.-->

FAQ: Answers to Frequent Questions

Can I flash Xiaomi through Fastboot without unlocking the bootloader?
No. Fastboot firmware requires an unlocked bootloader. The only exception is the official updates via the Mi Flash Tool with Save user data option, but this only works for some models (like the Redmi Note 11) and does not allow you to change the firmware region.
Why does the Mi Flash Tool show "Flash Done" but the phone doesn't turn on?
This is typical of incomplete firmware. Possible reasons: Not all partitions were stitched (check the logs in the Mi Flash Tool); incompatible firmware version (e.g., stitched Global onto a Chinese model with a locked bootloader); corrupted firmware files (jump archive and check). MD5). Solution: Repeat the firmware with full cleaning (Clean all) and use the original USB-cable.
How to return the guarantee after unlocking the loader?
Officially, no. Unlocking the bootloader voids the software warranty. However, some service centers are willing to do this if: You are running the official firmware through the Mi Flash Tool with the Clean all and lock option. Hardware problem (like a broken screen or a broken speaker) You have the box and check saved, and the device has no autopsy marks. In any case, before visiting the SC, return the device to a factory state and lock the bootloader.
Can I flash Xiaomi via Fastboot on Mac or Linux?
Yes, but with reservations: ๐ŸŽ Mac will need to install Homebrew and through it adb/fastboot: brew install android-platform-tools ๐Ÿง On Linux, add rules for udev (see Error section) and install fastboot via package manager: sudo apt install fastboot Mi Unlock Tool works only on Windows, so unlock the bootloader will have to do on a Windows PC. 10/11.
What if the root (Magisk) is missing after the firmware?
Fastboot removes all modifications, including Magisk.To return root: Download the latest version of Magisk (GitHub). boot.img You can use the firmware and patch it with Magisk Manager. boot.img: fastboot flash boot magisk_patched.img Reboot the device. If you use a custom core, first run it through, then patch boot.