How to flash Xiaomi smartphone correctly: from unlock to install MIUI

Xiaomi’s smartphone firmware is a process that can both restore speed to the device and turn it into a β€œbrick” if you approach it without preparation. In 2026, with the release of new versions of MIUI 15 and HyperOS, the rules of the game have changed: some models (for example, Xiaomi 14 or Redmi Note 13 Pro+) require binding an account to the device before unlocking the bootloader, and old methods like EDL now work only for a limited list of devices.

In this guide, we will look at all the current methods of firmware β€” from official updates via OTA to manual installation of custom assemblies via Fastboot or TWRP. Particular attention will be paid to the critical errors that 90% of users make during the unlocking stage of the bootloader, and explain how to avoid them. If you have never flashed Xiaomi, start with the section β€œPreparation” β€” there we have compiled a checklist of mandatory actions before any manipulation with the software.

1. Firmware Preparation: What to Do Before You Start

The first and most important step is to save data and verify compatibility, even if you plan to upgrade through the official service. OTA-There's always a risk of failure. Let's start with the basic rules:

  • πŸ“± Make a backup copy through Settings β†’ The phone. β†’ Backup or by using Mi PC Suite. Especially important to save: Contacts (export to.vcf) Photos and videos (copy to PC or cloud) List of installed applications (use App Backup & Restore)
  • πŸ”‹ Charge the battery to at least 60%. When you run through Fastboot, the phone should not turn off, which will lead to permanent damage to the boot partition.
  • πŸ” Check the model and version MIUI. Go to Settings. β†’ About the phone and write down: Model of the device (for example, 23113PN53G Redmi Note 12 Pro: Current version MIUI (for example, MIUI Global 14.0.5) Assembly number (e.g, TP1A.220624.014)

If you plan to flash custom firmware (such as PixelExperience or LineageOS), additionally check:

  • βš™οΈ Presence TWRP For your model at twrp.me.
  • πŸ”“ bootloader status: If it is blocked (checked by the fastboot oem device-info command), it will have to be unlocked.
  • πŸ›‘οΈ Compatibility of the firmware with your partition type (AB or A/B). The new Xiaomi (C) 2022 year) the scheme is used A/B, requires special instructions.

Make a backup copy of the data|Charge the phone. β‰₯60%|Write down the model and version MIUI|Check the status of the loader|Download the necessary firmware (official or custom)|Install drivers ADB/Fastboot PC-only|Prepare. USB-cable (preferably original)

-->

⚠️ Note: If your device was purchased in China (China version) ROM), for the firmware global version MIUI You'll need to unlock the bootloader, and without that, the phone won't install the firmware with another region.

2. Unlocking the bootloader: step-by-step instruction 2026

The Xiaomi bootloader is locked by default to protect against unauthorized changes.

  1. Link your Mi Account to your device (required for 2023-2026 models) for this: Go to Settings β†’ Xiaomi Account. Enable data synchronization. Wait for SMS or push notifications of successful binding (may take up to 72 hours).
  2. Apply for unlocking through the official website. You will need: Login and password from the Mi Account. SMS-Reason for unlocking (select "For personal useΒ»).

Mi Unlock Tool

formality

Connect your phone to Fastboot mode

1. Turn off the phone.


2. Press the <power button> + <volume down button> before the Fastboot logo appears.




3. Connect to the PC via USB.

Launch unlocking.

Mi Unlock Tool

⚠️ Note: Since 2026, Xiaomi has introduced a restriction: you can unlock the bootloader no more than once every 30 days for one account!

What to do if the Mi Unlock Tool shows a "Couldn't unlock" error
1. Make sure you are logged in to the same Mi Account as on your phone. 2. Check that the phone is connected in Fastboot mode (there should be a hare in a hat on the screen). 3. Try using another one. USB-4 If the error "This Mi Account is associated with too many devices", wait 30 days or use another account (but not more than 3 devices per account per month).

Mistake.Reason.Decision
Couldn't verify devicePhone not tied to account or link not confirmedWait 72 hours after you have linked your account or repeat it
Current account is different from the account info on the deviceThere are different accounts on the phone and in Mi Unlock ToolLog out of your phone account, log in again and reboot.
Device is locked. Wait XX hoursExceeded the limit of unlocks (1 time in 30 days)Use another Mi Account or wait for the specified time
Network errorProblems with the Internet or servers XiaomiTry it later or use a VPN (for example, for the region of India)

Official Mi Unlock Tool| Through EDL (emergency mode)|Castomic scripts (e.g. XiaomiTool)|Never unlocked |Another way

-->

3. firmware selection: official MIUI vs custom builds

Before you download the firmware, determine the purpose:

  • πŸ”„ Official. MIUI (stable/developer/global: Suitable for recovery after a crash, contains all original Xiaomi features (e.g. Second Space or Game Turbo) and is updated via OTA. Download only from the official website or through the Mi Flash Tool.
  • πŸ› οΈ Custom firmware (e.g. PixelExperience, LineageOS, ArrowOS): Remove branded bloatware (preinstalled apps). Offer pure Android without shell MIUI. They can add features (e.g. Always-on Display on unofficially supported models) and download only from trusted sources: XDA Developers or Telegram-channels of developers.

For beginners, we recommend starting with the official firmware. Castom builds require experience and often have bugs (for example, a broken NFC or camera).

πŸ’‘

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

⚠️ Attention: Global firmware ROM Chinese model (China) ROM) without unlocking the loader will lead to locking IMEI And the loss of the network, which would require a remediation through EDL (emergency mode), which is risky for beginners.

4. Firmware through Fastboot: A Step-by-Step Guide

The method is suitable for installation of official MIUI (including for recovery after failure) or custom firmware in the format.tgz/.zip.

  • A computer with Windows/Linux.
  • Installed drivers ADB and Fastboot.
  • The Mi Flash Tool (for official firmware) or Fastboot Scripts (for custom ones).

Instructions for official firmware:

  1. Download the firmware in.tgz format from the official website and unpack it.
  2. Install the Mi Flash Tool and run on behalf of the administrator.
  3. Connect your phone in Fastboot mode (power button + volume down).
  4. In the Mi Flash Tool, click Select and specify the path to the unpacked firmware.
  5. Select firmware mode: Clean all - clean (deletes all data); Clean all and lock - clean + lock bootloader (for sale of the phone); Save user data - save user data (does not always work stably).

Flash

Instructions for custom firmware:

  1. Download firmware in.zip and Fastboot Scripts format (for example, for PixelExperience).
  2. Unpack the archive with scripts and place a firmware file there.
  3. Run the script. flash_all.bat (Windows or flash_all.sh (Linux/Mac).
  4. Connect your phone to Fastboot and follow the instructions on the screen.

πŸ’‘

When you are running through Fastboot, NEVER disconnect your phone from your PC until you see the "Success" or automatic reboot.

5. Firmware through Recovery (TWRP)

The method is suitable for installing custom firmware, kernels or mods (for example, Magisk for root rights).

Steps:

  1. Install TWRP via Fastboot: fastboot flash recovery twrp.img fastboot boot twrp.img
  2. Download the firmware (.zip) and place it on your phone or flash drive.
  3. In TWRP, run: Wipe β†’ Advanced Wipe (tag Dalvik, Cache, System, Data). Install β†’ select a firmware file. Wait until it is completed and press Reboot System.

⚠️ Attention: New Xiaomi (from 2022) TWRP It may not work properly because of the encryption of the data partition, in which case you need to manually format the data into the firmware. F2FS or ext4 (The instruction depends on the model).

6. Frequent errors and their solutions

Even experienced users face firmware problems, and we have collected the TOP-5 bugs and ways to fix them:

Mistake.Reason.Decision
Anti-rollback check failTrying to install the old version of MIUI after the new versionOnly use the new or same version of the firmware
The phone is stuck on the Mi logoA boot partition or incompatible kernel is damagedSweep the original boot.img through Fastboot
E: Unknown command [log] in TWRPIncompatible version of TWRP with your modelDownload the current version of TWRP for your device
No network after firmwareThere is no IMEI or incorrect modemRestore the IMEI via the SN Writer Tool or flash the original modem.img
This package is for "XXX" devices; this is a "YYY".The firmware is not suitable for your model.Check the name of the model in Fastboot by the team fastboot getvar product

If the phone doesn’t turn on or gets stuck in a bootloop (cyclic reboot) after firmware, try:

  1. Download to Fastboot and flash the original boot.img.
  2. Use the Mi Flash Tool with the Clean All option.
  3. If nothing helps, contact the service center (for warranty devices) or use it. EDL-Regime (requires an authorized Xiaomi account).

7. After the firmware: what to do next

Successful firmware is only half the battle, so that the phone is stable.

  • πŸ”„ Update all apps through Google Play or App Store.
  • πŸ”’ Set up security: Enable encryption in Settings β†’ Security β†’ Encrypt your phone. Set a strong password or fingerprint.
  • πŸ“‘ Check Network and Communication: Go to Settings β†’ SIM-maps and mobile networks and select the operator manually. IMEI team *#06#.
  • 🎯 Optimize Performance: Turn Off Animation in Settings β†’ The phone. β†’ Version. MIUI (Press 7 times, then Developer Settings β†’ Cache clear in Settings. β†’ Warehouse β†’ Clear the cache.

If you have a custom firmware, additionally:

  • Install Magisk for root rights (if necessary).
  • Check the operation of sensors (gyroscope, NFC, camera) using the Sensor Test application.
  • Set up SELinux in Enforcing mode (for security).

πŸ’‘

After running custom ROM, the phone can warm up and discharge quickly for the first 2-3 days, which is normal. Give the system time to optimize (file indexing and kernel adaptation).

FAQ: Answers to Frequent Questions

Can I use Xiaomi without unlocking the bootloader?
Yes, but only official. OTA-Update through Settings β†’ System Update: Any other firmware installation (even the official global version on the Chinese model) requires unlocking.
How to return the official MIUI after custom firmware?
Download the official firmware in.tgz format and run it through the Mi Flash Tool with the Clean all option. If the bootloader has been unlocked, it can be blocked again with the same utility.
Why is the camera or NFC not working after the firmware?
This is a typical custom firmware problem, where proprietary Xiaomi drivers are missing. Solutions: Find and run a separate vendor.img package for your model. Use firmware marked "Official" or "Stable" on XDA. Return to official MIUI if functionality is critical.
How to Switch Xiaomi through EDL (Emergency Mode)?
EDL (Emergency Download Mode: Last chance to recover the phone if it doesn't turn on. This is required by: Authorized Xiaomi account (for new models). Cable EDL (or closing contacts on the board. Mi Flash Pro or QFil. ⚠️ Attention: Misuse of the right EDL This method is recommended only for advanced users or service centers.
How long does the firmware take?
Depending on the method: O TA-Update: 10-20 minutes Fastboot: 5-15 minutes. TWRP: 10–30 minutes (including backups). EDL: up to 1 hour (due to low data transfer speed).