How to Switch Xiaomi Phone Through MiFlash: A Complete Error Detection Guide

Firmware Xiaomi smartphone through MiFlash is the official way to restore or update software when standard methods do not work, such an approach is required for critical system failures, after failed custom firmware or for installing global versions of MIUI on Chinese devices. Unlike upgrades through Settings β†’ About the phone, firmware through MiFlash completely rewrites the system partition, which guarantees a clean installation without residual files.

But the process has nuances, from having to unlock the bootloader to choosing the right firmware version (Fastboot or Recovery). Errors at any stage can turn the phone into a brick, so it’s important to understand each step. In this article, we’ll look at the current 2026 requirements for MiFlash (including support for new models on HyperOS), discuss driver preparation in detail and analyze typical errors with codes, such as 0x80070002 or 0x80070490.

What is MiFlash and when is it needed?

MiFlash is Xiaomi's official Fastboot firmware utility, which works with the device's bootloader to allow you to install firmware directly without Recovery, and is used in three key cases:

  • πŸ”„ Recovery after a crash: If the phone doesn’t turn on, it hovers on the logo or goes to bootloop (cyclical reboot).
  • 🌍 Change of regional firmware: transition from Chinese (China) ROM) Global (Global) ROM) European (EEA).
  • βš™οΈ Downgraid version MIUI/HyperOS: Return to the previous stable assembly if the new one is not working properly.

Unlike firmware via Recovery: MiFlash erases all data on the device (including internal memory), while Recovery firmware can save user files. MiFlash is also mandatory for devices with a locked bootloader if you want to unlock it before installing custom software.

⚠️ Note: On Xiaomi models from 2023 to 2026 (e.g. Redmi Note 13 Pro)+ Xiaomi 14) firmware via MiFlash may require authorization of the Mi Account even after unlocking the bootloader.

Preparation for firmware: what to do before the start

Incorrect preparation is the main cause of firmware errors. Before connecting your phone to your PC, follow the following steps:

  1. Check the device model: Go to Settings β†’ About Phone β†’ Model or look at the box. The firmware should match the model exactly (e.g. Redmi Note 12 Pro 5G and Redmi Note 12 Pro+ 5G are different devices!).
  2. Download the correct firmware: Use only official Fastboot firmware from websites: πŸ”— Official portal MIUI (Choose Fastboot in the filters). πŸ”— Xiaomi Firmware Updater (alternative source with archive of old versions).

Unlock the loader

MiFlash

Mi

Also prepare:

  • πŸ–₯️ Windows PC 10/11 (on macOS/Linux MiFlash is not working).
  • πŸ”Œ Cable USB Type-C (preferably original, as cheap cables can cause connection errors).
  • πŸ”‹ Battery charge of the phone at least 50% (firmware can take up to 10-15 minutes).
πŸ“Š What Xiaomi model are you using?
Redmi Note 12/13
Poco X5/X6
Xiaomi 13/14
Another model

Unlocking the loader: step-by-step instructions

The bootloader on all Xiaomi smartphones is locked by default, and to flash the phone through MiFlash, it must be unlocked.

  1. Linking your Mi Account to your device: Go to Settings β†’ Xiaomi Account and log in. Go to Settings β†’ Additional β†’ Unlock OEM and activate the option. Enable USB Debugging in Settings β†’ About Phone β†’ MIUI Version (click 7 times on the version, then return to Additional β†’ For Developers).
  2. Unlock Tool request: Download Mi Unlock Tool and install it on PC. Connect your phone in Fastboot mode (turn off phone, then press Volume Down + Power). Launch Mi Unlock Tool, log in to the same Mi Account and follow the instructions. Note: Xiaomi servers may require waiting up to 72 hours for new anchoring!

Once successfully unlocked, the phone will restart with a warning: This device is unlocked when turned on.

⚠️ Note: On HyperOS models (e.g. Xiaomi 14 or Redmi) K70) Unlocking may require additional authorization through SMS or email, even if your Mi Account is already linked.

Linked to Mi Account on phone|Debugging is on. USB|The option "Unlocking" has been activated OEM"|Fastboot drivers installed|Phone's 50-charged%+-->

Installation of drivers and configuration of MiFlash

Without the right drivers, the PC won't recognize the phone in Fastboot mode.

  • πŸ”§ Android SDK Platform-Tools (for fastboot and adb commands).
  • πŸ–±οΈ Xiaomi Drivers (Select the Version for Your OS).

After installing the drivers:

  1. Connect the phone in Fastboot mode (turn off, then press Volume Down + Power).
  2. Open Device Manager on PC and check that the Android Bootloader Interface is available in the Ports (COM and LPT) section.
  3. Download and unpack MiFlash (last version at 2026).

In MiFlash, select the folder with the unpacked firmware (.tgz or.zip archive must be pre-extracted!). The Device field should display your device.

MiFlash versionWindows SupportFeatures
MiFlash 2023-12-1510/11 (x64)HyperOS support, Qualcomm 900E drivers bugs fixed
MiFlash 2022-03-077/10 (x86/x64)The latest version supports older models (Redmi 4X, Mi A1)
MiFlash 2020-05-297/10Old but stable for the firmware on MTK-chip

πŸ’‘

If MiFlash can’t see the device, try connecting the phone to another device. USB-port (preferably) USB 2.0 on the back of your PC or disable the antivirus – it can block drivers.

The firmware process: a step-by-step guide

Now, to the most critical stage, follow the instructions carefully.

  1. Select firmware mode: Clean All - complete cleaning (recommended for changing regional firmware); Clean All and Lock - cleaning + lock bootloader (use if you plan to sell a phone); Save User Data - data storage (does not work on new models with HyperOS).

Firmware launch

  1. Press Refresh in MiFlash to make sure the device is identified.
  2. Select Clean All mode (if you are not sure, this is the most reliable option).
  3. Press Flash and wait until it is completed (progress will be displayed in the log).

It takes 5 to 15 minutes. When it's done, it automatically reboots. It can take up to 10 minutes for the first time to turn on -- that's okay.

The successful log in MiFlash looks like this:


[100%] Flashing boot.img...




[100%] Flashing system.img...




[100%] Flashing vendor.img...




[100%] Done. Rebooting device...

⚠️ Note: If there is an error in the log 0x80070002, This means that the firmware is not suitable for your model. Check the name of the archive - it must be the same as the code name of the device (for example, toco for Redmi Note 10 Pro).

What if MiFlash is 99% frozen?
This is usually due to driver conflict or antivirus. Try: 1. Disable antivirus and firewall. 2. Reconnect the phone to another. USB-Use a different version of MiFlash (e.g. 2022 instead of 2023). If it doesn't work, run your phone through fastboot manually (the commands are given in the next section).

Common mistakes and their solutions

Even with the exact following of the instructions, errors can occur.

Error codeReason.Decision
0x80070002Incompatible firmwareDownload the firmware for the exact model (check the code name!).
0x80070490Problems with driversReinstall drivers manually through Device Manager.
0x80004005bootloader lockedRepeat unlocking through the Mi Unlock Tool.
0x8007001FDamaged firmware archiveDownload the firmware again and check the checksum (MD5).

If MiFlash is not codeless, check:

  • πŸ”Œ Connecting a cable (try another cable or port).
  • πŸ–₯️ Windows Version (Windows 11 may require additional drivers for Qualcomm chips).
  • πŸ“₯ Firmware integrity (unpack the archive again, avoid Cyrillic characters on the way to the folder).

πŸ’‘

If the firmware is interrupted in the middle, DO NOT TRY to restart the phone! plug it back into MiFlash and repeat the process with the same mode (Clean All).

Firmware through fastboot manually (alternative method)

If MiFlash doesn't work, you can flash the phone through the fastboot command line, which requires knowledge of the basic commands, but gives you more control over the process.

Instructions:

  1. Unpack the firmware in the folder with fastboot (from Android SDK Platform-Tools).
  2. Open the Command Prompt in this folder (Shift + PCM β†’ Open the PowerShell window here).
  3. Type commands in turn: fastboot flash boot.img fastboot flash system.img fastboot flash vendor.img fastboot flash dtbo dtbo.img fastboot reboot

For split-slot models (A/B, for example, Xiaomi 12T) use:

fastboot flash boot_a boot.img


fastboot flash boot_b boot.img




fastboot flash system_a system.img




fastboot flash system_b system.img

⚠️ Attention: On devices with HyperOS (2026 year) may require additional command to firmware super: fastboot flash super super.img Without it, the phone won't turn on!

What to do after the firmware

After a successful firmware:

  • πŸ”„ Set up your phone again: Since the data is erased, you will need an initial setup (language selection, Wi-Fi connection, login to your Mi Account).
  • πŸ”’ Check bootloader status: If you used Clean All and Lock, the bootloader will be locked. Re-unlock will have to wait 72 hours to re-unlock.
  • πŸ“± Update: Go to Settings β†’ The phone. β†’ Update the system and check the relevance of the version.

If the phone does not turn on after the firmware:

  1. Wait 10-15 minutes – the first turn on can be long.
  2. If the screen is black, try to pinch Volume Up + Power for 10 seconds for a forced reboot.
  3. If the phone vibrates but doesn’t turn on, then swipe it again by selecting a different mode in MiFlash.

πŸ’‘

After you run the firmware, check the sensors (fingerprint, gyroscope) and modules (Wi-Fi, Bluetooth). If something doesn't work, run the phone again with another version of the software.

FAQ: Frequent questions about Xiaomi’s firmware through MiFlash

Can I flash Xiaomi through MiFlash without unlocking the bootloader?
No, unlocking is mandatory. Without it, MiFlash won't be able to write data to system partitions, except for the firmware through Recovery, but it doesn't offer the kind of features that Fastboot does.
How to find out the code name of your Xiaomi model?
A code name (e.g., surya for Poco X3 NFC) can be found in Settings β†’ Settings β†’ About Phone β†’ MIUI β†’ Device Information (Model or Device field) on the box or under the battery (older models) on sites like Xiaomi Device (search model).
Why does MiFlash not see the phone in Fastboot mode?
Causes and solutions: πŸ”Œ Cable/port problems: Try another cable or USB-port USB 2.0). πŸ–₯️ No drivers: Install Mi Phone Driver or Android SDK freshly. πŸ›‘οΈ Antivirus Block: Disable protection for the time of firmware. πŸ“± Wrong Mode: Make sure the phone is actually in Fastboot (a screen with a rabbit and a Fastboot inscription).
Can I roll back the firmware to an older version?
Technically, but with reservations: Newer models (2022 and later) have Anti-Rollback protection. Recoil on older versions will lead to a hard brick. Before rolling back, check the list of allowed versions on Xiaomi Firmware Updater. If rollback is possible, use the firmware marked Anti-Rollback: No.
How to flash Xiaomi if MiFlash gives an error "Flash is not done"?summary> This error means that the firmware was not written completely. Try: Reboot your PC and phone. Use another version of MiFlash (for example, 2022 instead of 2023). Swipe your phone manually through fastboot (commands given above). Check if the Secure Boot option is included in your PC BIOS (turn it off if yes).