How to reflash Xiaomi smartphone from a computer: a complete guide with nuances

Flashing a Xiaomi smartphone through a computer is a task that scares many users, but it is one of the most reliable ways to upgrade or restore a device, especially if standard methods are used through Settings. β†’ Software updates don't work. OTA-Updates (over the air), firmware via PC gives full control over the process: you can choose any version MIUI (including global or Chinese), roll back on previous builds or even install custom firmware like Pixel Experience.

However, the process requires care: error at any stage, from unlocking the bootloader to choosing the wrong firmware version, can turn the phone into a brick. In this article, we will examine all the steps of flashing through the computer, from preparing tools to finalizing the smartphone, focusing on unlocking the bootloader without waiting 168 hours (relevant to new models 2023-2026) and bypassing typical errors like anti-rollback or invalid image.

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 taken. skipping them can lead to the inability to restore data or even break the device.

First, back up. The firmware erases all data from internal memory, including photos, contacts and messages. Use Mi Cloud (if available) or third-party utilities like Titanium Backup (requires root).

  • πŸ“± IMEI (You can find it in *#06# or on the box - useful if the network disappears after firmware.
  • πŸ”‘ Authorization keys for banking applications (Sberbank, Tinkoff, etc.) – they are tied to the current firmware.
  • πŸ“‚ folder MIUI on the internal drive - there are stored the settings of the themes and system applications.

Second, check the smartphone model and the current version of MIUI, which is critical for choosing the right firmware.

  • πŸ“„ B Settings β†’ The phone. β†’ Model (e.g. Redmi Note 12 Pro)+ 5G).
  • πŸ” Quickboot Getvar Product (if your phone is already in fastboot mode).

πŸ’‘

If your Xiaomi doesn't turn on, you can tell by the sticker under the lid or box. For the Chinese version (with the C suffix), the firmware must be appropriate - the global one won't work!

Finally, prepare the computer:

  • πŸ–₯️ Install Mi drivers USB Driver (download from the official Xiaomi website).
  • πŸ”Œ Use the original. USB-cables – cheap cables can not transfer data in fastboot mode.
  • πŸ”‹ The battery charge should be at least 50% - at low charge, the process can be interrupted.
πŸ“Š What Xiaomi model do you plan to use?
Redmi Note 12/13
POCO X5/F5
Xiaomi 13/14
Redmi 10/9
Another model

Unlocking the bootloader: how to bypass the 168-hour timer

The bootloader on all Xiaomi smartphones is locked by default, and unlocking it is a must before fastboot is installed. The official method involves linking your Mi Account account and waiting 168 hours (7 days), but there are legal workarounds for new devices.

Standard procedure:

  1. Link Mi Account to your phone in Settings β†’ Xiaomi Account.
  2. Activate Developer Options (7 times click on the MIUI version in About Phone).
  3. Enable OEM Unlock and USB Debugging in the developer menu.
  4. Download Mi Unlock Tool from the official website and log in.
  5. Connect your phone in fastboot mode (clip Power + Volume down) and follow the program instructions.

To get around the 168-hour wait:

  • πŸ”“ Use alternative versions of the Mi Unlock Tool (e.g., the Mi Unlock Tool Bypass from the community). XDA).
  • πŸ“… On some models (for example, Redmi Note 11) the timer is reset after resetting to factory settings and re-binding the account.
  • πŸ› οΈ For older devices (until 2021) the method with EDL-The system requires an authorized Xiaomi account with developer rights.
What happens if you flash a phone with a locked bootloader?
Firmware running through fastboot with the bootloader locked will cause a flash not allowed error (in MiFlash) or simply fail. In rare cases, the device may freeze on the Mi logo (soft brick), but this is rectified by re-routing the firmware after unlocking.

⚠️ Warning: Unlocking the bootloader resets all data on the phone, including tied Google accounts and banking apps. If you used Mi Account to unlock the screen, you will need to enter a password from it after the procedure.

Selection of firmware: official MIUI vs custom

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

  • 🌍 Globally stable (miui_GLOBAL JAVERSION.ZIP – recommended for most users, supports Google services, Russian language and monthly security updates.
  • πŸ‡¨πŸ‡³ China's stable (miui_China.zip – without Google, but with more recent features, suitable for enthusiasts who are ready to install GApps separately.
  • πŸ§ͺ Weekly bat version – updated weekly but may contain bugs.

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

  • πŸ”“ Unlocked loader.
  • πŸ›‘οΈ Established custom recaveri (TWRP Or OrangeFox).
  • πŸ“₯ Compatibility with a specific model (check on the forums) XDA or 4PDA).
Type of firmwarePlusesConsRecommendation
Global MIUIStability, Google Support, OTA-updateFewer features than in the Chinese versionFor everyday use
Chinese MIUIMore recent features, less bloatwareNo Google, there may be problems with the certification of banking applicationsFor experienced users
Castomic (AOSP)Pure Android, no MIUI adsThe camera, NFC or sensors may not workFor enthusiasts and testing

Where to download the firmware:

  • πŸ”— Official versions: miui.com (select by model and region).
  • πŸ”— Custom firmware: XDA Developers or 4PDA.

πŸ’‘

Never flash firmware from another model, even if the names are similar (for example, the Redmi Note 12 Pro and Redmi Note 12 Pro+), which will lead to a β€œhard brick” – irreparable breakdown.

Firmware through MiFlash: step-by-step instructions

MiFlash is Xiaomi’s official firmware utility for fastboot, and is suitable for installing full firmware packages (with the.tgz or.zip extension) and recovering the device after crashes.

Instructions:

β˜‘οΈ Preparing for firmware through MiFlash

Done: 0 / 4
  1. Unpack the downloaded firmware into a short-path folder (e.g., C:\MIUI\).
  2. Run MiFlash on behalf of the administrator.
  3. Connect your phone in fastboot mode (clip Power + Volume down when the phone is off).
  4. In MiFlash, click Select and specify the firmware folder.
  5. Select the firmware method: clean all – complete cleaning (recommended when changing the version of MIUI). clean all and lock – cleaning + lock bootloader (dangerous!). save user data – saving user data (not always stable).

Flash

If the process is suspended on waiting for the device:

  • πŸ”Œ Check the cable connection and port USB (better USB 2.0).
  • πŸ”„ Reinstall drivers manually through Device Manager.
  • πŸ› οΈ Try a different version of MiFlash (e.g. MiFlash 2020 instead of 2023).

⚠️ Note: If the phone doesn’t turn on after firmware, and an anti-rollback error appears in MiFlash, then you tried to install an older version. MIUI, It's not the same as before, but it's only fixed by firmware to the new version or by EDL (requires authorization).

Fastboot Firmware: An Alternative to MiFlash

If MiFlash doesn’t work or needs more flexible setup, you can flash the device through the command line in fastboot mode, which is suitable for advanced users and allows you to control each step.

Tools required:

  • πŸ–₯️ ADB Fastboot (downloaded as part of Android) SDK separately).
  • πŸ“ Firmware in.tgz format or unpacked.img files.

Step-by-step:

  1. Unpack the firmware in a folder (for example, C:\fastboot_rom\).
  2. Open the command prompt in this folder (Shift + PCM β†’ Open the PowerShell window here).
  3. Connect your phone in fastboot mode and check the connection with the command: fastboot devices should appear serial number of the device.
  4. Run the firmware in turn for each section: fastboot flash boot.img fastboot flash recovery.img fastboot flash recovery system.img fastboot flash vendor.img fastboot flash vendor.img fastboot flash dtbo dtbo.img
  5. Clear the cache: fastboot erase cache fastboot erase userdata
  6. Reboot the device: fastboot reboot

You can use a batch script to simplify (create a file). flash_all.bat contents):

@echo off


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 erase cache




fastboot erase userdata




fastboot reboot

If you see a FAILED error (remote: 'Partition not found'), you don't have a firmware image for that partition. Check the archive contents and skip the missing files.

Frequent mistakes and their solutions

Even if you follow the instructions accurately, you can get errors, and let's look at the most common ones and how to fix them.

Mistake.Reason.Decision
anti-rollbackTrying to revert to the old version of MIUISwitch a newer version or through EDL (requires authorization)
invalid sparse file format at headerA damaged firmware fileDownload the firmware again, check the checksum (MD5)
device not foundThe device is not recognized in fastbootCheck drivers, cable, USB port. Try another PC.
The phone is stuck on the Mi logoIncompatible firmware or interrupted processRepeat the firmware with full cleaning (clean all)

Additional advice:

  • πŸ”„ If there is no network after the firmware, check it out. IMEI (Type *#06#. If it is missing, restore it through SN Writer Tool (requires) EDL).
  • πŸ”Š If there's no sound, the vendor section may not have been clicked.
  • πŸ“΅ If the sensor is not working, please swipe separately touch.fw (relevant for some Redmi models).
How to restore IMEI after firmware?
1. Download. SN Writer Tool and Qualcomm Drivers. 2. Put the phone in mode. EDL (You need a testpoint or an authorized account). 3. Download the file. prog_emmc_firehose.mbn for your model. 4. Enter. IMEI (It's on the box, and you can go. ⚠️ Without the right one. IMEI No calls and mobile internet will work!

First setup after firmware

Once the firmware is successful, the phone will turn on as new.

  1. Select language and region. For global firmware, it is recommended to specify Russia or Europe (for Chinese, it is China, but then you will need to install the Google Services Framework separately).
  2. Connect to Wi-Fi. If there is no network, check the operator's APN settings.
  3. Log in to the Mi Account that was used to unlock the bootloader.
  4. Restore data from a backup (if you did it through Mi Cloud or Titanium Backup).

Recommendations for optimization:

  • πŸš€ Turn off auto-update MIUI In Settings β†’ The phone. β†’ Update the software if you do not want to make unexpected changes.
  • πŸ”’ Set Protection Against Accidental Unlocking in Settings β†’ Lock screen β†’ Additionally.
  • πŸ“΅ Check the fingerprint scanner and NFC β€” Sometimes they require additional adjustment after firmware.

If you have a custom firmware stitched (e.g., Pixel Experience), additionally:

  • Install GApps (Google Apps) via TWRP if they are not in the build.
  • Check the camera performance – some models require separate modes (like the ANX Camera).
  • Set up root access through Magisk if required (for example, for ViPER4Android).

FAQ: Answers to Frequent Questions

Can I use Xiaomi without unlocking the bootloader?
No, for firmware via fastboot or EDL The exception is the update via recovery (if the firmware is signed by Xiaomi), but this only works for official ones. OTA-packet.
How do I know if my Xiaomi bootloader is unlocked?
Turn off your phone and turn it on by holding Power + Volume up. If you see Unlocked under the Mi logo, the bootloader is unlocked. You can also check the fastboot oem device-info command - Device unlocked: true will confirm unlocking.
What to do if the phone does not turn on after the firmware?
First, try pinching Power + Volume up for 20 to 30 seconds (hard reset). If it doesn't work: Repeat the firmware with full cleaning (clean all in MiFlash). Check if the firmware is suitable for your model (especially for the Chinese versions with the C suffix). If the phone doesn't respond at all (no vibration, no indicator lights), the bootloader may be damaged - you will need firmware through EDL (for power users only).
Can I use Xiaomi Recovery without PC?
Yes, but with limitations: Only official firmware in.zip (not.tgz). Custom Recovery (TWRP) is required, as stock Mi Recovery does not support firmware installation. You can't flash the older version of MIUI because of anti-rollback. Instructions: download firmware, reboot to TWRP, select Install and specify the.zip file. After installation, run Wipe β†’ Format Data (if you need to clean).
How to return stock firmware if you installed custom?
There are two ways to get back to the official MIUI: MiFlash: Download the.tgz stock firmware for your model. Clean it all. Fastboot: Unpack the firmware and manually run each partition (as described above). Once you return to the stock firmware, the bootloader will remain unlocked. To lock it back, use the fastboot oem lock command, but this is not recommended β€” you will have to wait 168 hours for the next firmware.