How to completely remove firmware from Xiaomi phone: from unlock to clean installation

Removing firmware from Xiaomi phone is a procedure that may be needed in a variety of situations: from the desire to return the factory MIUI After experimenting with custom builds before selling the device in a "pure" state, many users confuse this concept with the usual resetting or flashing. In fact, the complete removal of firmware involves cleaning all partitions of the device memory, including system, vendor and boot, followed by the installation of a new version of the software.

In this article, we will analyze all possible scenarios: how to remove custom firmware (for example, LineageOS or Pixel Experience), return the official version of the software. MIUI After a failed upgrade, or just clean the phone before selling, we will pay special attention to unlocking the bootloader - without this step, most firmware operations on Xiaomi are simply impossible, ADB), How to avoid mistakes that will turn your smartphone into a brick".

1.Preparation: What to Know Before Removing Firmware

Before you start manipulating firmware, it is important to understand a few key points:

  • πŸ”“ Unlocking the bootloader is a must-do for most operations. On new Xiaomi models (like the Redmi Note 12 or Xiaomi 13), this process can take up to 720 hours of waiting due to the company’s security policy.
  • πŸ“± Backup – without it, you will lose all data, even if you plan to return the official firmware, some user files (for example, from a folder) DCIM) may not recover.
  • πŸ”Œ The battery charge must be at least 60%. interruption of the process due to discharge can lead to a hard brick (complete failure of the device).
  • πŸ’» Windows PCs – most tools (Mi Flash Tool, XiaomiTool) officially support only this OS. On macOS or Linux, you will have to use alternative methods.

Also note that removing firmware resets all security settings, including:

  • πŸ”‘ Related Mi Accounts (re-authorization required).
  • πŸ“± Google Services Framework (you may need to reconfigure Google Services).
  • πŸ”’ Passwords and fingerprints (they will have to be reconfigured).

⚠️ Note: On devices with a Qualcomm Snapdragon chip (e.g. Poco) F5 or Redmi K60) Incorrect removal of the firmware can lead to loss IMEI. It will be very difficult to restore it later - specialized equipment will be required.

If you delete the firmware for selling your phone, keep in mind: the new owner will be able to unlock the bootloader only through his Mi Account. The binding to your profile will remain in the system, but after reset it can be deleted through Settings. β†’ Mi Account β†’ Remove the device.

πŸ“Š What firmware do you want to remove?
Official MIUI
Custom (LineageOS, Pixel Experience, etc.)
I don't know what it costs.
Another.

2 Unlock the bootloader: without it anywhere

The bootloader on all Xiaomi smartphones is locked by default, a security measure that prevents unauthorized firmware changes, and to remove the current firmware and install a new one, you first need to unlock it.

The process consists of several stages:

  1. Linking your Mi Account to your device is impossible without it, so make sure your phone has an account you have access to.
  2. Request to unlock through the official Mi Unlock Tool app. On new devices, you will have to wait from 7 to 30 days after sending a request (depending on the model).
  3. Directly unlock through Fastboot mode.

Detailed instructions:

  1. Download the official Mi Unlock Tool from Xiaomi website.
  2. Install the drivers. ADB Fastboot (can be accessed via Minimal) ADB and Fastboot).
  3. On your phone, turn on Settings β†’ About Phone β†’ MIUI version (click 7 times to activate Developer Mode).
  4. Back to Settings β†’ Additionally. β†’ For developers and include: πŸ”§ Debugging by USB πŸ”“ Unlocking OEM (It may be called a factory unlock)

Mi Unlock Tool

⚠️ Note: On some models (e.g. Xiaomi) 12T Or the Redmi Note 11 Pro.+) When you unlock the bootloader, you automatically trigger an anti-rollback, which means you can't install the firmware older than the one you originally had. MIUI In Settings β†’ The phone.

If the Mi Unlock Tool is running a "Couldn't unlock" or "Device not supported" error, try:

  • πŸ”„ Restart your phone and PC.
  • πŸ”Œ Use the original cable USB Type-C (cheap cables may not provide stable connection).
  • πŸ–₯️ Launch the tool on behalf of the administrator.
  • πŸ•’ Wait for the specified time (if the system requires waiting).

Install the Mi Unlock Tool|Enable the developer mode|Activate debugging by USB|Allow unlocking OEM|Linking your Mi Account to your device-->

3. Ways to remove firmware: which one to choose?

There are several methods to remove firmware from Xiaomi, and the choice depends on your goal:

MethodWhen to usePlusesCons
Reset via RecoveryDelete user data without changing firmwareβœ… Quick, no PC required.βœ… Keeps the official MIUI❌ Does not remove custom firmware❌ Does not clean the system partition
Fastboot + Mi Flash ToolComplete removal and installation of official MIUIβœ… Clears all sections.βœ… Suitable for "brick" devices❌ Requires an unlocked bootloader❌ Risk of loss IMEI
Castom Recovery (TWRP)Remove before installing another custom firmwareβœ… Flexibility (you can selectively clean the sections)βœ… Supports backups.❌ Hard for beginners.❌ Not all models support all models. TWRP
EDL-mode (emergency mode)Recovery after major disruptionsβœ… It even works on bricks"βœ… Does not require unlocking the loader❌ Requires an Authorized Account EDL❌ Risk of damaging the device

For most users, the best option is the Mi Flash Tool - it allows you to completely erase the current firmware and install the official one. MIUI If you want to just return the phone to factory settings without changing the firmware, you just need to reset it through Recovery.

Let’s look at each method in more detail.

4. Method 1: Completely remove firmware through the Mi Flash Tool

This method is suitable if you want to completely erase the current firmware (both official and custom) and install clean. MIUI. It will:

  • πŸ’» Windows PC.
  • πŸ”Œ Cable USB Type-C (preferably original).
  • πŸ“± Unlocked loader.
  • πŸ“¦ Official firmware in.tgz or.zip format for your model.

Step-by-step:

  1. Download the official firmware for your model. Pay attention to the region (Global, China, EEA) β€” It must match the current firmware, otherwise there may be problems with the modem.
  2. Unpack the archive into a folder without Cyrillic characters (e.g., C:\MIUI\).
  3. Install the Mi Flash Tool.
  4. Turn off the phone and press the volume down. + Power to enter Fastboot mode.
  5. Connect your phone to your PC and launch the Mi Flash Tool. Press Refresh, the device needs to be determined.
  6. In the Select field, specify the path to the unpacked firmware.
  7. At the bottom, select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
  8. Press Flash and wait until it is completed (usually takes a lot of time). 5-10 minute).

⚠️ Warning: If you choose Clean all and lock, the bootloader will lock and you will have to wait again to unlock again (up to 720 hours on new models.

Once the firmware is successful, the phone will automatically restart, and it can take up to 15 minutes to turn on the first one, which is normal. MI For more than 20 minutes, try it:

  • πŸ”„ Remove and re-insert the battery (if it is removable).
  • πŸ”Œ Repeat the firmware with the choice of Clean All mode.
  • πŸ“± Check if the firmware is right for your model (sometimes Redmi Note 11 is confused with Redmi Note 11 Pro).

πŸ’‘

If the Mi Flash Tool gives you a β€œflash not done” error, try running the program in Windows 7 compatibility mode or disabling the antivirus. Also check that there are no spaces or Cyrillic characters on the way to the firmware.

5. Method 2: Removal through Custom Recovery (TWRP)

If you have custom recovery installed on your device (TWRP), You can selectively clean partitions before you install a new firmware:

  • πŸ”„ Transition from one custom firmware to another.
  • 🧹 Removing residues of old firmware before clean installation.
  • πŸ”§ Fixing Errors After Failed Update.

Instructions:

  1. Download the required firmware (for example, LineageOS or MIUI in.zip format and place it on internal memory or SD-map.
  2. Turn off your phone and press Volume Up + Power to enter TWRP.
  3. In the main menu, select Wipe β†’ Advanced Wipe.
  4. Check the following sections with ticks: πŸ“ Dalvik / ART Cache πŸ“ System πŸ“ Data πŸ“ Cache πŸ“ Vendor (if any)

Swipe to Wipe

Install

Confirm the installation and wait for completion.

If you remove the firmware for installation MIUI, After cleaning the partitions, you may need to reboot to Fastboot and use the Mi Flash Tool (as in the previous method). TWRP It is not always correct to flash official images due to the features of Xiaomi protection.

What if TWRP doesn’t see internal memory?
If TWRP Does not display files on the internal drive, try: 1. Connect the phone to the PC via MTP (Mount menu select Enable MTP). 2. Copy firmware on SD-The card (if supported). 3. Use the card OTG-cable and flash drive. 4. TWRP to a newer version (sometimes older builds do not support new file systems, for example, F2FS).

Method 3: Recovery Reset (without PC)

If you don’t have to remove the firmware completely, but just return the phone to factory settings (for example, before selling), you can use standard Recovery. This method does not remove the firmware itself, but only resets user data and settings.

Instructions:

  1. Turn off the phone.
  2. Hold the Loud up. + Food and hold until the logo appears MI.
  3. From the Recovery menu, select the language (usually English and Chinese)
  4. Go to Wipe Data β†’ Wipe All Data.
  5. Confirm the action (it may be necessary to enter a password if it was set).
  6. After reset, select Reboot β†’ Reboot to System.

This method is suitable for:

  • 🧹 Cleaning the phone before selling.
  • πŸ”„ Eliminating software glitches (for example, constant reboots).
  • πŸ”’ Deletion of personal data without changing the firmware.

⚠️ Note: On some models (e.g. Xiaomi) 11T POCO X4 Pro) Resetting via Recovery may result in the bootloader being locked if it has been previously unlocked, in which case the phone will not turn on after the reset and will require re-unlocking via the Mi Unlock Tool.

If, after resetting, the phone asks you to enter the old password from your Mi Account, even though you deleted it, it means that the device is linked to the account via Mi Cloud, to unlink:

  1. Sign in to the Mi Account website.
  2. Go to the Devices. β†’ Find your phone. β†’ Delete.
  3. Wait 24 hours - the binding will be removed.

7.Recovery after failed firmware removal

If something goes wrong during the process of removing the firmware and the phone stops turning on (called a brick), don't panic. In most cases, the device can be restored.

Symptoms.Possible causeDecision
The phone vibrates, but the screen is black.Incorrect firmware or interrupted processRepeat the firmware via Fastboot or EDL
Hanging on the MI logoPartition conflict or damaged bootJust pass it. boot.img via Fastboot
The Invalid Sparse File Error in Mi FlashDamaged firmware archiveDownload the firmware again, check the checksum MD5
Phone is not defined in FastbootProblems with drivers or cableInstall Qualcomm HS-USB QDLoader 9008 (for EDL) drivers
Loss of IMEI after firmwareThe modem or nvram partition is damagedRestore IMEI via Engineer Mode or Maui META

If the phone does not respond to buttons and is not detected by the PC, there is a last chance β€” EDL-The Emergency Download Mode (ED) is the mode for this:

  1. Download the firmware for EDL (usually in.mbn format).
  2. Install the Qualcomm driver HS-USB QDLoader 9008 (can be found on the website) 4PDA or XDA).
  3. Connect the phone off to the PC by clamping Volume up + Volume down (on some models you need to close the testpoints on the board).
  4. The device manager should have a device. QHUSB_BULK qualcomm HS-USB QDLoader 9008.
  5. Use the Mi Flash Tool or QFil to Firmware in EDL-mode.

⚠️ Attention: Firmware through EDL on new Xiaomi models (for example, Xiaomi 13 or Redmi Note 12 Pro)+) requires authorization through an official account EDL. Without it, tools like Mi Flash will make a mistake "SLA Auth Error, in which case you will have to contact the service center.

If you are not sure of your abilities, it is better to consult specialists. The cost of restoring a brick in service centers is usually 1,500-3,000 rubles, which is cheaper than buying a new phone.

πŸ’‘

If the phone doesn't turn on after a bad firmware, the first thing you do is check if it's detected in Fastboot. If it does, repeat the firmware. If it doesn't, try it. EDL-regime.

8. Frequent mistakes and how to avoid them

Even experienced users sometimes make firmware mistakes, and here are the most common ones and ways to prevent them:

  • πŸ”„ Model firmware mismatch – for example, trying to flash Redmi Note 10 Pro with firmware from Redmi Note 10. Always check the exact model name in Settings β†’ The phone. β†’ Model.
  • πŸ“‘ Ignoring the firmware region - China installation ROM Global Device Could Lead to Problems with Google Services and Modem.
  • πŸ”‹ Low battery firmware – if the phone turns off during the process, there is a high risk of hard brick.
  • πŸ”Œ Use of unoriginal cable – cheap cables can interrupt data transmission, leading to errors.
  • πŸ”“ Forget to unlock the bootloader - without this, most operations with firmware are impossible.

Another common mistake is skipping the step of cleaning partitions before installing a new firmware, such as if you install LineageOS on top of it. MIUI Without system and data formatting, the system may not work stable or at all. Always run Wipe before installation!

If the phone is running slowly or overheating after firmware, it may be due to:

  • πŸ”„ Wrong firmware version (for example, firmware for Snapdragon on a device with MediaTek).
  • 🧹 Remains of old firmware (incomplete cleaning of partitions).
  • πŸ”‹ Failure of the core (try to stitch another one) boot.img).

In such cases, a re-firmware with full cleaning or a return to the official will help. MIUI via Mi Flash Tool.

Can I remove the firmware without unlocking the bootloader?
No, for complete firmware removal (especially custom) unlocking the bootloader is mandatory, except for resetting via Recovery, but it doesn't delete the firmware itself, only user data. EDL, But you need an authorized account for that. EDL, Which ordinary users cannot get.
How do I know which firmware is on my Xiaomi?
Go to Settings. β†’ The phone will be listed: πŸ“± Version. MIUI (for example, MIUI Global 14.0.5). πŸ”§ Android version (such as Android 13). 🌍 Region (e.g. Global, China, EEA). If you have custom firmware (like LineageOS), this information will be in the Settings menu. β†’ The phone. β†’ Firmware version.
What to do if after removing the firmware, the phone does not see SIM-map?
This is a typical problem when running an inappropriate version. MIUI (China, for example. ROM Solutions: Sweep through the right firmware for your region. IMEI (Type in the dialer #06#. If it is missing, restore it via Engineer Mode (#4636##*). Reset the modem settings to Settings. β†’ SIM-maps and mobile networks β†’ Resetting network settings.
Can I get my MIUI back after a custom firmware?
Yes, for this: Unlock the bootloader (if it is locked). Download the official firmware for your model from Xiaomi. Sweat it through the Mi Flash Tool in Clean all mode. If the phone doesn't turn on after that, try flashing it in Clean all and lock mode (but note that the bootloader will lock).
How long does it take to remove?