How to flash Xiaomi through your computer: a complete guide to unlock the bootloader

Firmware Xiaomi smartphone through the computer is a task that scares many users. In fact, the process is not as difficult as it seems, if you follow the proven instructions and understand the key points. In this article, we will discuss all the steps from preparing the device to installing the official or custom firmware, including the mandatory unlocking of the bootloader.

The main problem that newcomers face is the lack of understanding of terms and the fear of breaking the phone, but if you want to get the latest version of MIUI, get rid of advertising in system applications or install Global ROM instead of Chinese, you can not do without firmware through your PC, we will explain in detail what tools you need, how to avoid errors and what to do if something goes wrong.

1. Firmware Preparation: What You Need to Know Before Starting

Before you start firmware, make sure you understand the risks. Mistakes can lead to device locking, data loss, or even a smartphone โ€œbrickingโ€ (when it stops turning on).

  • ๐Ÿ”‹ The battery should be at least 60 percent charged, and the firmware can take up to 30 minutes, and the discharge in the process will cause a failure.
  • ๐Ÿ“ฑ Backup of all important data (photos, contacts, messages) and firmware erases internal memory.
  • ๐Ÿ” Unlocking the bootloader is a must for most Xiaomi models. Without this, you will not be able to flash the phone through the PC.
  • ๐Ÿ’ป Computer on Windows 7/10/11 (for Mac/Linux Additional drivers may be required).

Also check what kind of firmware you need:

  • ๐ŸŒ Global ROM โ€” official firmware for the international market (without Chinese services).
  • ๐Ÿ‡จ๐Ÿ‡ณ China ROM โ€” Chinese version with local services (may contain advertising).
  • โš™๏ธ Custom firmware (e.g. LineageOS, Pixel Experience) โ€“ alternative builds with advanced features.

โš ๏ธ Attention: China firmware ROM On global models (e.g. Redmi Note 10 Pro Global) you may experience network or camera problems. Always choose firmware that matches your model and region.

If you are not sure which firmware is right for your device, use the official MIUI Downloads website or the Xiaomi Firmware Updater service.

๐Ÿ“Š What kind of firmware do you plan to install?
Official Global ROM
Official China ROM
Custom (LineageOS, Pixel Experience, etc.)
I haven't decided yet.

2. Unlocking the Xiaomi bootloader: step-by-step instructions

Without unlocking the bootloader, you can't flash Xiaomi through your PC, which requires you to link your Mi Account to your device and wait for permission from Xiaomi.

  1. Activate Developer Mode: Go to Settings โ†’ About Phone โ†’ MIUI Version and tap it 7 times until the notification โ€œYouโ€™ve become a developerโ€ appears.
  2. Put the debugging on. USB unlock OEM: Back to Settings โ†’ Additionally. โ†’ For developers and activate: ๐Ÿ”Œ Debugging by USB ๐Ÿ”“ Unlocking OEM (It may be called "Factory Unlocking")

Attach the device to the Mi Account:

In the same developer menu, find Mi Unlock Status and link your Xiaomi account. Without this step, unlocking is impossible.

Download the official Mi Unlock Tool and follow the instructions:

  1. Connect your phone to your PC in Fastboot mode (turn off the device, then press Volume Down + Power).
  2. Launch the Mi Unlock Tool, log in to your Mi Account and follow the program's prompts.
  3. If the utility requires a wait (usually 7-14 days), wait for SMS or push notifications to allow unlocking.

After installing the drivers, check the device connection:

  1. Connect your phone in Fastboot mode.
  2. Open the command line in the ADB folder and type:
fastboot devices

If the device serial number appears in the response, the drivers are installed correctly.

Tool.AppointmentDownload link
Mi Flash ToolInstallation of official MIUI firmware through FastbootOfficial website
TWRPCastomic recovery for installation of unofficial firmwaretwrp.me
XiaomiTool V2Automation of unlocking and firmware (for experienced users)GitHub

๐Ÿ’ก

If fastboot devices donโ€™t show your device, try reinstalling drivers manually through Windows Device Manager. Download Mi USB Driver and update the driver for the exclamation marker device.

4. Xiaomi firmware via Fastboot (official MIUI)

This method is suitable for installing official firmware from Xiaomi (for example, switching from China ROM to Global ROM).

Step-by-step:

  1. Download firmware: Choose the correct version for your model on the official website. The firmware should be in.tgz or.zip format (for example, tissot_global_images_V12.5.1.0.RDIMIXM_20210310.0000.00_10.0_global_1234567890.tgz).
  2. Unpack firmware: Use an archiver (such as 7-Zip or WinRAR) to extract files into a folder without Cyrillic characters en route.
  3. Start Mi Flash Tool: Install the utility, launch it on behalf of the administrator, and connect the phone in Fastboot mode.
  4. Select firmware: In the Mi Flash Tool, click Select and specify the path to the unpacked firmware folder.

Wait until it's finished:

It takes 5-15 minutes, and when it's done, it automatically reboots.

โš ๏ธ If the Mi Flash Tool gives you a bug can't receive hello packet, try: USB-cable (original or high-quality) Connect the phone to the port USB 2.0 (usually black) Disable Windows Antivirus and Firewall.

What to do if the firmware is 99% frozen?
If the process has stopped at 99% and is not moving for more than 10 minutes: 1. Disconnect the phone from the PC. 2. Press Volume up + Power for 10 seconds for a forced reboot. 3. Repeat the firmware by selecting a different mode in the Mi Flash Tool (for example, Clean all instead of Save user data). 4. If the error repeats, download the firmware again - it is possible to crash the file download.

5. Install custom firmware through TWRP

If you want to install informal firmware (like LineageOS, Pixel Experience, or HavocOS), youโ€™ll need custom recovery โ€“ TWRP or OrangeFox.

Important: This method requires an unlocked bootloader and may take away your warranty, and some features (like Widevine L1 for Netflix in HD) may stop working.

Instructions:

  1. Install. TWRP: Download the image TWRP For your model from the official website and run it through Fastboot: fastboot flash recovery twrp-3.7.0_9-0-tissot.img fastboot boot twrp-3.7.0_9-0-tissot.img After that, the phone will be loaded into TWRP.
  2. Make a backup: In TWRP Go to Backup and save the Boot, System, Data and Vendor sections to the SD-card.
  3. Format the sections: Go to Wipe โ†’ Format Data and type yes. This will delete all data, including internal memory.
  4. Install firmware: Copy the.zip firmware file to your phone, then select Install in TWRP and specify the path to the file. After installing the firmware, repeat the step for GApps (if you need Google services).
  5. Squeeze Magisk (optional): If you want root access, install Magisk via Install in TWRP.

On models with dynamic partitions (for example, Xiaomi 11T, Redmi Note 11) before firmware custom ROM you need to roll back to the old version of MIUI or use special scripts to convert partitions.

๐Ÿ’ก

Custom firmware requires regular manual updates. OTA-The update may not work, so keep an eye out for new versions on the forums. XDA Developers or 4PDA.

Possible errors and their solutions

Even with the correct following of the instructions, there can be problems, and let's look at the most common mistakes and how to fix them:

Mistake.Reason.Decision
This device is locked (in Fastboot)The bootloader is not unlockedRepeat the unlocking procedure with the Mi Unlock Tool
Invalid sparse file format at headerFirmware file damagedDownload the firmware again, check the checksum MD5
The phone is stuck on the MI logoIncompatible firmware or failure during installationDownload to Fastboot and repeat the firmware with a full clean (Clean all)
E: Unknown command [log] (on TWRP)An outdated version of TWRPUpdate TWRP to the latest version for your model

If the phone doesnโ€™t turn on after firmware (black screen, vibration without image), try:

  1. Press Volume up + Power for 20 seconds for forced reboot.
  2. Connect to your PC and check if the device is detected in Fastboot or EDL-The mode (a special cable is required).
  3. If the phone doesnโ€™t respond, you may need firmware through EDL (power users only!).

๐Ÿ’ก

If the IMEI is missing after the firmware or the mobile network is not working, restore it using the SN Write Tool (requires a backup NV-data made before the firmware).

7. Firmware through EDL: a last resort for "brick" devices

Emergency Download Mode (EDL) is a "emergency" firmware mode that is used when the phone is not turned on or detected in the Fastboot. It requires a special cable (EDL cable) or the closure of test contacts on the board.

Warning: Firmware via EDL can lead to loss of IMEI or other problems if executed incorrectly.This method is recommended only in extreme cases!

How to log into EDL:

  1. Turn off the phone.
  2. Close the test contacts on the motherboard (location depends on the model) or use EDL cable.
  3. Connect your phone to your PC. The Device Manager should have a Qualcomm HS-USB QDLoader 9008.

To run through EDL, you will need:

  • ๐Ÿ”ง Mi Flash Tool (2018 version or later).
  • ๐Ÿ“‚ Firmware in.mbn format or special EDL-firmware.
  • ๐Ÿ”‘ Auth file (new Xiaomi models require authorization).

โš ๏ธ Note: Starting in 2021, Xiaomi will block the firmware through the EDL To circumvent the protection may require paid services or special "swimmers" (for example, UFi Box, EasyJTAG).

8. What to do after the firmware?

After successful firmware, follow a few important steps:

  1. First setup: Go through the initial setup. If you have a Global ROM, select Russia or Europe for Google services to work properly.
  2. Check IMEI: Enter *#06# and make sure the IMEI is displayed. If you're not using "Null" or "Unknown" numbers, restore it via the SN Write Tool.
  3. Update your firmware: Go to Settings โ†’ About Phone โ†’ System Update and check for updates.
  4. Install Magisk (if you need root): Download the latest version of Magisk from GitHub and stream through TWRP or Fastboot.

If you have installed custom firmware, pay attention to:

  • ๐Ÿ”‹ Battery-based operating time: Some custom ROM consume more energy.
  • ๐Ÿ“ถ Mobile network operation: Some firmware may not run VoLTE or 5G.
  • ๐ŸŽฎ Performance: Test the device in benchmarks (e.g. AnTuTu or Geekbench).

๐Ÿ’ก

After the firmware China ROM on the global model (and vice versa) may lose support for some bands 4G/5G. Check the mobile Internet in different networks.

FAQ: Frequent questions about Xiaomi firmware

โ“ Can I flash Xiaomi without unlocking the bootloader?
No, for firmware via Fastboot or custom firmware installation, unlocking is mandatory.The exception is an update via Recovery (if the firmware is signed by Xiaomi), but this only works for official updates.
โ“ How long does it take to unlock the loader?
For new Mi accounts, the wait is 7-30 days. If the account is older than 30 days and there is no suspicious activity, unlocking can go away immediately. On some models (for example, POCO F3), the wait can take up to 60 days.
โ“ What to do if the phone does not see after the firmware SIM-map?
This is a typical problem when switching from China ROM to Global ROM and vice versa. Solutions: Check if your model supports both firmware (e.g. Redmi Note 10 Pro has separate versions for China and the global market). Set the correct modem via TWRP (look for 4PDA or XDA). Go back to the original firmware via Mi Flash Tool.
โ“ How to return the official firmware after custom?
To get back to MIUI: Download the official Fastboot firmware. Run it through the Clear all Mi Flash Tool. If the phone doesn't turn on, use it. EDL-After the return to the MIUI The bootloader will remain unlocked. To lock it back, in the Mi Flash Tool, select Clean all and lock mode.
โ“ Can I use Xiaomi on Mac or Linux?
Yes, but you will need additional customization: On Mac, install Homebrew and adb/fastboot packages: brew install android-platform-tools On Linux, use the package manager: sudo apt install adb fastboot For the Mi Flash Tool, you will need a Wine or a Windows virtual machine.