Xiaomi’s USB firmware from your computer: a complete guide for beginners and experienced users

Install custom or official firmware on Xiaomi smartphones through USB-The cable from a computer is a process that scares many users, but it is the only way to bring back a brick-and-mortar machine, update outdated software on unsupported models, or gain root rights to deep-tube the system. OTA-Updates, firmware via Fastboot or Recovery gives you full control over the process, but requires care: one wrong action can turn your Redmi or your own. POCO brick-and-brick".

In this article, we will discuss three main methods of firmware via USB: using the official MiFlash tool, using custom recovery TWRP, and using the fastboot utility in manual mode. We will focus on training, from unlocking the bootloader to choosing the right firmware version for your model. And to avoid typical errors, we have compiled a table of compatibility of Xiaomi tools and devices, relevant for 2026.

1. Preparation of the smartphone: unlocking the bootloader

The first and most critical step is unlocking the bootloader. Without this, no firmware will install via USB. Xiaomi officially allows you to unlock the bootloader, but the process involves waiting (3 to 360 hours) and binding to the Mi Account.

Here's what you're gonna need:

  • πŸ“± Xiaomi smartphone with a battery charge of at least 60% (when discharged during the process, the device can lock permanently).
  • πŸ”— Cable USB Type-C (preferably original – cheap cables often don’t transmit data in fastboot mode).
  • πŸ’» Windows computer 10/11 (for MiFlash or Linux/macOS (manually).
  • πŸ”“ Mi Account linked to the device (required to confirm email and phone!).

The unlocking process:

  1. Activate Developer Mode: Go to Settings β†’ About Phone and click on MIUI Version 7 times.
  2. Back to Settings β†’ Additionally. β†’ For developers and include OEM-unlocking and debugging USB.
  3. Connect the phone to the PC, confirm the debugging permission.
  4. Download the official Mi Unlock utility, log in and follow the instructions.

⚠️ Warning: Once the bootloader is unlocked, the smartphone will perform a full reset (wipe). TWRP (Also note that some banking applications (e.g. SberBank Online) may no longer work on unlocked devices.

πŸ“Š What kind of firmware method do you plan to use?
Official firmware through MiFlash
Custom firmware through TWRP
Fastboot manual commands
I haven't decided yet.

2. Selection of firmware: official vs custom

Before you download the firmware, decide on its type. Official firmware from Xiaomi is divided into:

  • πŸ“¦ Stable – stable versions with minimal bugs but no new features.
  • πŸ§ͺ Developer – weekly builds with the latest updates, but errors are possible.
  • 🌍 Global/EEA β€” Firmware for the European market (without Chinese services).
  • πŸ‡¨πŸ‡³ China – Chinese versions (may not support Google Services).

Custom firmware (e.g. LineageOS, Pixel Experience) gives more freedom, but requires an experienced approach.

  • ⚑ Higher productivity through optimization.
  • πŸ”„ Regular security updates (as opposed to abandoned official versions).
  • 🎨 Ability to fine-tune the interface.
Type of firmwareSuitable forRisks.Where to download
Official StableBeginners, daily useMinimumOfficial website
Official DeveloperTesters, enthusiasts.Bugs, unstable jobsOfficial website
Castomium (TWRP)Experienced usersLoss of warranty, possible brickXDA Developers
Ported ROM (e.g. Pixel Experience)Fans of β€œpure” AndroidNot all functions can work.Pixel Experience

Critically, the firmware should be designed specifically for your model and device code (e.g. Redmi Note 10 Pro has sweet and sweetin options for the Indian market). Installing incompatible firmware will result in hard brick (irreparable damage).

πŸ’‘

Before downloading the firmware, check its hash amount (MD5) using the MD5 Checker utility. This will protect you from downloading corrupted or fake files.

3. Firmware through MiFlash: the official method

MiFlash is Xiaomi's official fastboot firmware utility, which supports most models but only runs on Windows.

Download MiFlash from the official website |Install Qualcomm/QDLoader Drivers |Unpack firmware into a folder without Cyrillic | Disable antivirus (it can block drivers) |Translate phone to fastboot (Power + Vol Down) mode

-->

Algorithm of action:

  1. Download and install MiFlash (version 2023.4.2 or later).
  2. Unpack the downloaded firmware (a file with the.tgz or.zip extension) into a short path folder (e.g., C:\Xiaomi\proshivka).
  3. Run MiFlash.exe on behalf of the administrator.
  4. Connect the phone in fastboot mode (press Power + Volume Reduction when the device is turned off).
  5. In MiFlash, click Select and specify the firmware folder. Then select firmware mode: Clean all β€” complete clean (recommended for changing the version of MIUI), Clean all and lock β€” clean + lock bootloader (only for official firmware!), Save user data β€” save data (not always stable).

Flash

⚠️ Note: If MiFlash gives you a β€œcouldn’t find android device” error, check: Are Qualcomm drivers installed? HS-USB QDLoader 9008 (download here) Is Windows Defender disabled (it can block unsigned drivers) Is you using the original cable (cheap cables often don't send fastboot commands).

πŸ’‘

Clean all and lock mode will lock the bootloader back. Use it only if you have official firmware and you do not plan to make further modifications.

4. Firmware through TWRP: for custom ROMs

TWRP (TeamWin Recovery Project) is a custom recovery that allows you to install informal firmware, make backups and obtain root rights, but to use it, the bootloader must already be unlocked.

Instructions for installing TWRP and firmware:

  1. Download the image TWRP for your model from the official website (for example, for Redmi Note) 11 it's a file twrp-3.7.0_12-spes.img).
  2. Rename it to recovery.img and place it in the folder with fastboot (where adb.exe lies).
  3. Connect your phone in fastboot mode and execute the command: fastboot flash recovery.img
  4. Then reboot to TWRP: fastboot boot recovery.img
  5. V TWRP Make a backup of the current firmware (Backup section), then flash a new one. ZIP-file via Install.

Advantages of TWRP:

  • πŸ”„ Possibility of rollback to the previous version of the firmware.
  • πŸ”§ Installation of modifications (e.g. Magisk for root rights).
  • πŸ“¦ Backup of individual partitions (e.g. data or boot only).

⚠️ Note: Some new Xiaomi models (e.g. Xiaomi) 13 Series) uses dynamic partitions (super.img). They require a special version. TWRP Support for dynamic partitions. TWRP This will cause the error "Unable to mount". /data".

What if TWRP asks for a password when mounting /data?
If you have previously used data encryption in MIUI, TWRP will require you to enter a lock screen password to access the partition /data. If you don't remember it, you'll have to do Format Data, but that will delete all user files. TWRP Turn off encryption in the settings MIUI: Settings β†’ Additionally. β†’ Confidentiality β†’ Encryption and accounts.

5. Hand-held firmware via fastboot: for experienced

If MiFlash doesn't work or you want more control, you can manually flash the device through fastboot commands. This method is universal and works even on unofficially supported devices.

Procedure:

  1. Download the firmware in.tgz and unpack it. Inside it should be a folder with images and script. flash_all.bat.
  2. Open the command line (Win + R β†’ cmd) in the firmware folder.
  3. Connect your phone in fastboot mode and check for its detection: fastboot devices (should display the serial number of the device).
  4. For all the sections, run: fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash system system.img fastboot flash vendor vendor.img fastboot flash dtbo dtbo.img fastboot flash vbmeta vbmeta.img fastboot reboot

For dynamic partition devices (e.g. Xiaomi 12T), use the command:

fastboot update --skip-secondary file name.zip

Important nuances:

  • πŸ”Ή Not all firmware contains a file. vbmeta.img. If it is not, skip this step.
  • πŸ”Ή For devices with A/B-sections (e.g, POCO F4) You need to run both slots: fastboot --set-active=a fastboot flash system system.img fastboot --set-active=b fastboot flash system system.img
  • πŸ”Ή If after firmware the phone is stuck on the logo, try resetting the settings via fastboot -w.

Typical errors and their solutions

Even with the correct instructions, errors can occur, and we've collected the most common problems and ways to fix them:

Mistake.Reason.Decision
fastboot: error: Failed to boot into fastbootdIncompatible version of fastboot or driversUpdate Platform Tools to the latest version
MiFlash: "Flash is not done"A damaged firmware file or lack of rightsCheck it out. MD5-hash firmware and run MiFlash from the administrator
TWRP: "Unable to mount /data"FBE (File-Based Encryption)Format /data in TWRP or disable encryption in MIUI before installation
The phone does not turn on after firmware ("brick")Incompatible firmware or interrupted processTry to stitch through EDL-Mode (requires an authorized Xiaomi account)
Anti-rollback protectionReversed to an older version of MIUIOnly run the version that is newer than the current one (check out Xiaomi Firmware Updater).

If your device has turned into a hard brick, don't panic. In most cases, it can be restored through a computer. EDL-The Emergency Download Mode (ED) is the mode for this:

  1. Download an authorized firehouse for your model.
  2. Connect your phone to your PC with the Vol Up + Vol Down button pressed (on the device turned off).
  3. Use QFil or MiFlash in EDL mode for firmware.

⚠️ Attention: For EDL You need an authorized Xiaomi account (not to be confused with a regular Mi Account). $5-10) and takes up 72 The alternative is to go to a service center.

7. Check the result and the first actions after firmware

After successful firmware, follow the following steps:

  1. First start: It can take up to 10 minutes - don't interrupt the process.
  2. System setup: Skip the binding to Mi Account if you plan to install custom firmware.
  3. Functionality check: πŸ“Ά Communication test (calls, mobile Internet). πŸ“· Camera operation (some custom firmware requires separate fixes for the camera). πŸ”‹ Battery Charging (Indicator must correctly display percentage). πŸ”Š Sound and speakers.

Security update:

Settings β†’ System β†’ Updates

If you have a custom firmware, it is recommended:

  • πŸ”’ Install Magisk for root rights management (download on GitHub).
  • πŸ›‘οΈ Disable Signature Verification in TWRP, If you are planning to make modifications.
  • πŸ“± Install Google Apps (if not in firmware) through Open GAPPS.

To check the current firmware version and the status of the bootloader, use the commands:

adb shell getprop ro.miui.ui.version.name # MIUI version


fastboot oem device-info # bootloader status

FAQ: Frequent questions about Xiaomi firmware

❓ Can I flash Xiaomi without unlocking the bootloader?
No, it is not possible to officially flash the device through USB without unlocking the bootloader, the only exception being an update via Recovery (if the firmware is signed by Xiaomi and is intended for your model), but this does not allow you to install custom firmware or roll back to the previous version.
❓ How to find out the code name of my Xiaomi device?
Codename (e.g., surya for POCO X3) can be found through the Device Info app (Hardware Info section). In fastboot command: fastboot getvar product On the device box (sometimes listed next to the model), and a full list of codenames can be found on XiaomiUI.
❓ Why MiFlash can't see my device?
The reasons may be as follows: ❌ Qualcomm drivers are not installed (download QDLoader). ❌ It's not original. USB-cable (try the charging cable from Xiaomi). ❌ Antivirus blocks MiFlash (add it to exceptions). ❌ The device is not in fastboot mode (check with the fastboot device team). If the problem persists, try running MiFlash in Windows 8 compatibility mode.
❓ Can I return the official firmware after the custom?
Yes, but there are nuances: If the bootloader is unlocked, you can flash the official firmware through MiFlash in Clean all mode. If you block the bootloader (Clean all and lock), some custom firmware may stop working. On some devices (for example, Xiaomi Mi A3) after returning to the official firmware, you may need to flash vbmeta to correct signature verification errors.
❓ How to flash Xiaomi if it does not turn on (hard brick)?
If the device doesn’t respond to buttons and isn’t defined in fastboot, try: Connect your phone to a PC with Vol Up clamped. + Vol Down (mode) EDL). Use MiFlash with the option flash_all_lock.bat (If MiFlash doesn't help, try QFil with the file. prog_emmc_firehose.mbn (You need an authorized account, and if you want to, you can contact the service center, restore it through EDL requires special equipment.