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:
- Why do you need a new firmware? (Bug fix, new features, overclocking performance?)
- Are you ready for a possible data loss? (We recommend a full backup)
- Do you have a backup phone in case of failure?
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?
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 firmware | Advantages | Deficiencies | Recommendation |
|---|---|---|---|
| Stable MIUI | Maximum stability, rare bugs | Updates are less frequent, there are no new features | For everyday use |
| Developer MIUI | New features, frequent updates | Possible bugs, quick battery discharge | For enthusiasts and testers |
| Castomic (AOSP) | Pure Android, no Bloatware | Camera, NFC, encryption may not work | Only 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 Tool | It 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 ADB | The driver is not installed or USB-debugging off | Check the developer settings and reinstall the driver |
| The phone does not turn on after the firmware | Incompatible firmware or interrupted process | Repeat the firmware with clean all or restore through EDL-regime |
| anti-rollback error | Reversed to an older version of MIUI | Install 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.img3. 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?
7.Optimization after firmware: what to do next
After successful firmware installation, follow a few steps to work stably:
- Reset the settings to factory settings (Settings β Additional β Recovery and Reset), even if the firmware was βno cleaningβ.
- Update all apps via Google Play or Mi App Store.
- Check the main functions: camera, calls, mobile Internet, Wi-Fi.
- 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).