How to install a new firmware on Xiaomi through your computer: full instructions

Firmware Xiaomi smartphone through a computer is a process that scares many users because of the risk of turning the device into a β€œbrick”. But with the right approach, it's a safe procedure to get the latest updates, fix system bugs, or even bring back a fermented machine. OTA-updates, manual firmware through the PC gives full control over the software version, the ability to roll back to a stable build or install custom firmware such as LineageOS or Pixel Experience.

The main difference between this method and an air upgrade is that it requires official permission from Xiaomi to unlock the bootloader, without which installing firmware via the Mi Flash Tool or fastboot is impossible. In this article, we will discuss all the steps from driver preparation to the final restart, and also explain how to avoid typical errors, such as ERROR: failed to write partition or hanging on the Mi logo.

If you've never flashed a smartphone before, start with the official stable versions of MIUI. You can leave the custom firmware experiments to the later stages, which require more knowledge about TWRP, Magisk, and partition modifications. Remember, doing the wrong thing can take away the warranty (if it still works) or lead to data loss.

Before you start, answer three key questions:

  1. Why do you need a new firmware? (Bug fix, new features, overclocking performance?)
  2. Are you ready for a possible data loss? (We recommend a full backup)
  3. Do you have a backup phone in case of failure?
πŸ“Š How often do you update your firmware on Xiaomi?
Only through OTA.
Once a year manually
When critical bugs appear
Never update.

1. Firmware Preparation: What to Do Before Starting

The first step is to check the current firmware and device model. This is critical, as the firmware for the Redmi Note 10 Pro (sweet) will not work for the Poco X3 Pro (vayu), even if they look similar. You can find out the code name of the model in the settings: Settings β†’ About Phone β†’ MIUI version (several times tap on the line with the version to appear on the developer menu).

Also prepare:

  • πŸ”Œ Cable USB Type-C (original or certified – cheap cables can cause data transmission errors).
  • πŸ’» Computer on Windows 10/11 (The Mi Flash Tool requires Windows; macOS/Linux Use alternative tools).
  • πŸ”‹ Battery charge of at least 60% (when discharged during firmware, the device may turn off).
  • πŸ“ Backup data (photos, contacts, messages) – firmware erases user data in the section /data.

Pay special attention to drivers. Without properly installed ADB and Fastboot drivers, your computer will not recognize your phone in firmware mode. Download them from the official Xiaomi website or use the universal Mi PC Suite. If the drivers do not install, try disabling digital signature verification in Windows: Perform β†’ shutdown /r /o β†’ Diagnostics β†’ Additional settings β†’ Boot options β†’ Reboot β†’ F7 (Disable Driver Signature Verification).

πŸ’‘

If you have Xiaomi with a MediaTek processor (e.g. Redmi) 9A), firmware will require a tool SP Flash Tool instead of Mi Flash Tool. Clarify the chipset model in the app CPU-Z.

2 Unlock the bootloader: the official way from Xiaomi

Without unlocking the bootloader, installing firmware via a PC is impossible – this is Xiaomi’s defense mechanism against unauthorized changes, a process that takes up to 72 hours (from the date of application) and requires linking the Mi Account to the device.

1. Link your Mi Account to your phone: Settings β†’ Xiaomi Account β†’ Sign in (use the same account as you did to unlock).

2. Activate USB debugging and OEM unlocking:

Settings β†’ The phone. β†’ Version. MIUI

Settings β†’ Additional β†’ For developers β†’ Unlock OEM (enable) and Debug over USB (enable)

3. Download Mi Unlock Tool from the official website (Windows only). Launch the program, log in to Mi Account and connect your phone in fastboot mode (turn off the phone, then press Volume Down + Power).

4. In Mi Unlock Tool, click Unlock. If you see a message Couldn't unlock. Try again after XX hours, wait until the timer ends (usually 168 hours for new accounts). Once successfully unlocked, the phone will reboot with the cleared data.

What if the Mi Unlock Tool can’t see the device?
1. Check that the phone is in fastboot mode (screen with a hare and a sign). FASTBOOT). 2. Update drivers manually through Device Manager (select "Android Bootloader Interface"). 3. Try another one USB-port (better 2.0, not 3.0). 4. Disable the antivirus - it can block the utility.

3. Selection of firmware: official vs custom

The type of firmware depends on the stability of the device and the functionality available. Xiaomi offers three types of official firmware:

  • πŸ“± Stable - Stable version MIUI with a minimum number of bugs, updated every 1-2 months.
  • πŸ§ͺ Developer – weekly builds with new features, but errors are possible (e.g. fast battery drain).
  • 🌍 Global/China/EU β€” Global is optimized for Europe, China has more features, but without Google services.

For most users, the best choice is Stable Global. Custom firmware (like LineageOS or ArrowOS) is suitable for advanced users who are willing to sacrifice some features (like Xiaomi’s camera) for pure Android.

Download the firmware only from verified sources:

  • πŸ”— Official website MIUI Downloads (select the version by model code).
  • πŸ”— Xiaomi Firmware Updater – Firmware archive with version history.
  • πŸ”— Forum 4PDA (sections by models) - here are laid out modified and custom firmware.

Critical: Never download firmware from torrents or little-known sites. Fake files may contain malware or be collected with errors, which will lead to the device's throw.

Type of firmwareAdvantagesDeficienciesRecommendation
Stable MIUIMaximum stability, rare bugsUpdates are less frequent, there are no new featuresFor everyday use
Developer MIUINew features, frequent updatesPossible bugs, quick battery dischargeFor enthusiasts and testers
Castomic (AOSP)Pure Android, no BloatwareCamera, NFC, encryption may not workOnly for experienced users

4. Install firmware through Mi Flash Tool

This is Xiaomi's official tool for fastboot firmware, suitable for stock firmware installation (original MIUI).

1 Download and unpack the Mi Flash Tool (the latest version can be found at xiaomiflashtool.com).

2 Download the firmware in.tgz or.zip format and unpack it into a folder without Cyrillic characters (for example, C:\MIUI\proshivka).

3. Run MiFlash.exe on behalf of the administrator.

4. Connect the phone in fastboot mode (turn off the device, then press Volume down + Power until the screen with the hare appears).

5.In Mi Flash Tool, press Refresh – the program must detect the device (it will appear). COM-port).

6. Press Select and point the path to the unpacked firmware. At the bottom, select firmware mode:

  • Clean all – complete cleaning (recommended when changing the MIUI version).
  • Clean all and lock – clean + lock the bootloader (use if you want to return the warranty).
  • Save user data – saving user data (not always working correctly)

7.Tap Flash and wait until it is completed (usually 5-10 minutes).

Driver's fastboot mode installed correctly |Firmware unpacked into a folder without spaces |Battery charged to 60%+|Clean all for clean installation

-->

If the process is stuck on waiting for a device, check:

  • πŸ”Œ Cable and port USB (Try the port USB 2.0).
  • πŸ–₯️ Drivers (reinstall via Mi Flash Tool) β†’ Driver).
  • πŸ“± Phone mode (should be fastboot, not recovery).

πŸ’‘

If the phone doesn't turn on or hangs on the logo after firmware, try the clean all process, which solves the problem 90% of the time.

5. Solving typical firmware errors

Even with the correct instructions, errors can occur, and here are the most common ways to correct them:

⚠️ Attention: Mistake ERROR: Failed to write partition often means you're trying to install firmware not for your model. double-check the code name of the device (e.g., raphael for Redmi). K20 Pro) and firmware version (Global/China).

⚠️ Note: If the phone loads into fastboot or recovery after firmware, but doesn't turn on, the system partition is likely damaged. TWRP repair.

Mistake.Reason.Decision
Couldn't unlock the Mi Unlock ToolIt has not been 168 hours since the account was linked.Wait until the specified time or use alternative unlock methods (risky)
device not found in ADBThe driver is not installed or USB-debugging offCheck the developer settings and reinstall the driver
The phone does not turn on after the firmwareIncompatible firmware or interrupted processRepeat the firmware with clean all or restore through EDL-regime
anti-rollback errorReversed to an older version of MIUIInstall firmware no older than the current one or use anti-rollback fix

To restore the β€œbrick” (a device that does not turn on) use EDL-Emergency Download Mode is a low-level firmware mode that requires an authorized Xiaomi account or paid services like Mi Account Unlock. EDL Search for thematic forums (for example, 4PDA), But keep in mind that this is an extreme measure.

6. Firmware custom ROM through TWRP

If you want to install unofficial firmware (like LineageOS or Pixel Experience), you will need to use it. TWRP Recovery – custom recovery that allows you to install ZIP-The process is more complex than with the Mi Flash Tool, and involves additional risks.

1. Install TWRP for your model (download the image from the official website).

2. Sweat it through fastboot:

fastboot flash recovery twrp.img


fastboot boot twrp.img

3. In TWRP, make a backup of the current firmware (Backup β†’ Select the system, data, boot partitions).

4. Squeeze the custom firmware:

Install β†’ Choose. ZIP-file β†’ Swipe to Confirm Flash

After installing custom firmware, you may need to flash Magisk to get root rights or GApps (Google services if they are not in the build). Remember that custom firmware often lacks Xiaomi's branded features, for example:

  • πŸ“Έ Optimize the camera (you will need to install GCam manually).
  • πŸ”‹ Fast charging functions (may not work properly).
  • πŸ“‘ Proprietary modules for NFC or IR-port.
How to return the official MIUI after custom firmware?
1 Download the official firmware in.tgz format for your model. 2. Sweep it through the Mi Flash Tool in clean all and lock. 3. If the bootloader locks, unlock it again through the Mi Unlock Tool (timer will reset).

7.Optimization after firmware: what to do next

After successful firmware installation, follow a few steps to work stably:

  1. Reset the settings to factory settings (Settings β†’ Additional β†’ Recovery and Reset), even if the firmware was β€œno cleaning”.
  2. Update all apps via Google Play or Mi App Store.
  3. Check the main functions: camera, calls, mobile Internet, Wi-Fi.
  4. If the battery is discharged quickly, perform a calibration: discharge the phone to 0%, then charge to 100% without interruption.

To improve productivity:

  • πŸš€ Turn off animations: Settings β†’ Additionally. β†’ For developers β†’ The scale of the animation (select) 0.5x).
  • πŸ—‘οΈ Clear the cache: Settings β†’ Memory. β†’ Clear the cache.
  • πŸ”’ Turn off unnecessary background processes: Settings β†’ Battery β†’ Managing application energy consumption.

If you notice bugs (such as spontaneous reboots or overheating), check:

  • πŸ” Error logs via Logcat Extreme.
  • πŸ“‘ Battery status in AccuBattery (if capacity is below 80%, it is time to change the battery).
  • πŸ› οΈ Availability of firmware updates (possibly bug fixed in new version).

FAQ: Frequent questions about Xiaomi firmware

Can I use Xiaomi without unlocking the bootloader?
No, official firmware via the Mi Flash Tool requires an unlocked bootloader. However, some custom firmware (for example, for devices on MediaTek) can be installed via the SP Flash Tool without unlocking, but this is risky and can lead to a brood.
How do I know if my Xiaomi bootloader is unlocked?
Turn off your phone and press Volume Down + Power. If you see UNLOCKED under the Mi logo, the bootloader is unlocked. If LOCKED is locked.
Will I lose data when I run through the Mi Flash Tool?
Yes, in clean all or clean all and lock mode, all data in /data will be erased. Use save user data at your own risk, because it doesn't always work correctly.
Can I roll back the firmware to an older version?
Technically, yes, but Xiaomi uses an anti-rollback mechanism that blocks rollbacks on versions older than a certain date. If you try to do that, you get an error or a device brood. Always check version compatibility before rollback.
What if the touchscreen doesn’t work after the firmware?
This is a typical problem when installing incompatible firmware. Try: Clean all, install another firmware version (e.g., try China instead of Global), and if it doesn't work, go through EDL (requires authorization).