How to reflash Xiaomi phone yourself: from unlocking the bootloader to installing custom firmware

Reflashing Xiaomi’s smartphone is a process that scares many users from the risk of turning the device into a β€œbrick.” However, with the right approach, it is a safe procedure that allows you to update the system to the current version, remove preinstalled software or install custom firmware with advanced features. Unlike service centers, where a similar service will charge from 1,500 to 5,000 rubles, home flashing is free and takes no more than an hour.

The main difference between official firmware and custom ones (like LineageOS or Pixel Experience) is the support level. The former ensures stability and compatibility with Mi Account and HyperOS, the latter opens access to root rights and fine-tuning Android. But regardless of the choice, the process begins with unlocking the bootloader, a mandatory step without which installing alternative software is impossible.

Preparation for Flashing: What to Do Before Starting

Before you start to manipulate the firmware, make sure that all the prerequisites are met. Ignoring this stage is the main reason for 80% of β€œbrick” devices that later require recovery through the use of a new device. EDL-The mode (and this is a task for the service center) here is the minimum checklist:

  • πŸ”‹ Battery charge at least 70%. When discharged during firmware, the phone may shut down at a critical moment.
  • πŸ“± Backup: The firmware erases internal memory, including photos, contacts and messages.
  • πŸ’» Installed drivers Mi Flash Tool and ADB/Fastboot Without them, the computer will not recognize the device in firmware mode.
  • πŸ”“ Mi Account tied to phone at least 72 hours ago is a requirement to unlock the bootloader.

For official versions, use en.miui.com, where stable and development builds are available. Look for firmware on the XDA Developers or 4PDA forums, but check user reviews - some builds may contain bugs or spyware.

πŸ“Š What kind of firmware do you plan to install?
Official (MIUI/HyperOS)
LineageOS (Pixel Experience)
Stock Android (AOSP)
I don't know.

Also prepare. USB-High quality cable (preferably original from Xiaomi) cheap cables often cause data transmission failures, leading to errors like fastboot: error: Failed to boot into userspace. POCO X3 Download the QFil utility – you will need it for disaster recovery.

Unlocking the bootloader: a step without which you can not do

The bootloader in Xiaomi phones is locked by default, a security measure that prevents uncertified software from being installed. To unlock it, you need to get permission from the company through the official Mi Unlock Tool utility. The process takes 3 to 15 days, depending on the model and region.

Here's the step-by-step instruction:

  1. Download Mi Unlock Tool from the official website and install it on PC.
  2. On your phone, turn on Settings β†’ About Phone β†’ MIUI version (tap 7 times to activate the developer mode).
  3. Return to Settings β†’ Additional β†’ For developers and enable USB Debugging and OEM Unlocking.
  4. Connect your phone to your PC, launch the Mi Unlock Tool, and log in to the same Mi Account that is linked to the device.
  5. If you see a message called Couldn't unlock. Try again after XX hours, you'll have to wait for the specified time.

Is your Mi Account tied to your phone for at least 3 days?

Is USB debugging enabled?

Are ADB drivers installed on the PC?

Is the phone 70%+ charged?

-->

Important: Once the bootloader is unlocked, the phone will reset to factory settings. All data will be deleted! Also note that some models (such as the Xiaomi 12T or Redmi K50) require additional confirmation via SMS or email.

⚠️ Warning: Unlocking the bootloader will void the warranty on the device. If the phone is warranty, it is better to contact the service center for an official update.

Recovery: Fastboot vs Recovery

There are two main methods of installing firmware on Xiaomi: via Fastboot and Recovery. The first is suitable for official builds and requires a connection to a PC, the second is for custom firmware and can be executed directly from the phone.

This is more reliable because it installs the firmware directly into the device's memory, avoiding any possible Recovery errors, and is suitable for Qualcomm and Mediatek processor models.

  • πŸ–₯️ Mi Flash Tool (download from the official website).
  • πŸ“ Firmware in.tgz or.zip format (unpack it into a folder without Cyrillic characters!).
  • πŸ”Œ Cable USB Data transfer support (not just charging!).

Instructions:

  1. Turn off the phone and press Volume Down + Power to enter Fastboot mode.
  2. Connect the device to your PC and start the Mi Flash Tool.
  3. In the program, click Select, specify the path to the unpacked firmware.
  4. Select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
  5. Press Flash and wait until it is completed (usually 5-10 minutes).

If the process is stuck in the waiting for device stage, check the drivers or try another one. USB-For models with Mediatek (e.g. Redmi) 9A) may require a utility SP Flash Tool.

Method 2: Firmware through Recovery (for custom firmware)

This is a more convenient way, because it doesn't require a PC, but it's only suitable for unlocked devices.

  • πŸ“± Castomic Recovery (e.g, TWRP Or OrangeFox).
  • πŸ“ Firmware in.zip format (downloaded to a memory card or internal drive).
  • πŸ”‹ Battery charge of at least 80% (process can take up to 30 minutes).

Instructions:

  1. Download and install TWRP via Fastboot (TWRP command: fastboot flash recovery twrp.img).
  2. Boot into Recovery, holding Volume Up + Nutrition.
  3. In TWRP, select Wipe β†’ Advanced Wipe and select Dalvik, Cache, System, Data.
  4. Return to the main menu, click Install and select the firmware file.
  5. After installation, run Wipe Cache/Dalvik and restart.

⚠️ Note: If the phone is stuck on the Mi logo after being firmwareed through Recovery, it means that the firmware is incompatible with the model or damaged.

What to do if the firmware does not stand up?
If the phone does not turn on or boot to bootloop after installing the firmware, try: 1. Repeat the process with another firmware version. 2. Complete a full reset via fastboot erase userdata. 3. Use the XiaomiTool V2 utility for automatic recovery. If nothing helps, contact the firmware service via EDL (Emergency Download Mode).

Common Mistakes and How to Avoid Them

Even when following instructions, users often encounter errors, most of which are due to firmware incompatibility, driver problems, or improper unlocking of the bootloader, and consider the most common cases and ways to solve them.

Mistake.Reason.Decision
fastboot: error: Failed to boot into fastbootdThe wrong version of the Mi Flash Tool or drivers.Update the utility and reinstall the drivers via Mi Flash Assistant.
This package is for "xxx" devices; this is a "yyy".The firmware is not suitable for your model.Download the correct version from the official website or 4PDA.
The phone is not defined in the Mi Flash Tool.Problems with USB-port-wire.Try another cable/port or disable the antivirus.
Bootloop (Cyclical Reboot)Firmware incompatibility or installation error.Reset via fastboot erase userdata.

Another common problem is loss. IMEI This is true for models with Mediatek (e.g. Redmi 9 or POCO M3). To restore IMEI, needle:

  1. Download Maui META or SN Writer Tool.
  2. Enter the IMEI (located on the box or under the battery).
  3. Connect the phone in Meta Mode mode (to do this, you need to close the test points on the board).

If you are unsure of your skills, it is best to entrust the recovery of IMEI to professionals – a mistake can lead to a complete loss of the network.

πŸ’‘

Before firmware check the phone model with the command fastboot getvar product. This will help avoid installing firmware from another modification (for example, Redmi Note 10 Pro for the global version will not fit firmware from the Chinese Redmi Note 10 Pro China).

Castom firmware: pros and cons

Installing custom firmware (such as LineageOS, Pixel Experience or Havoc OS) opens up new possibilities, but also has drawbacks.

  • βœ… Pluses: πŸš€ Higher performance (no pre-installed Xiaomi software). πŸ”„ Regular security updates (relevant to older models that Xiaomi no longer supports). 🎨 Flexible interface setting (themes, animations, gestures).
  • ❌ Cons: πŸ”‹ Possible issues with autonomy (some firmware is poorly optimized for battery life). πŸ“± Branded features do not work: Always-on Display, Game Turbo, some gestures. πŸ”’ Risk of blocking Mi Account when using unofficial builds.

Before installing custom firmware, check its compatibility with your model on the XDA Developers forum. For example, Pixel Experience based on Android 13 is suitable for POCO F3, and only special builds for the Mediatek Helio G90T processor are suitable for Redmi Note 8 Pro.

Also note that some firmware requires additional manipulation:

  • πŸ” Install Magisk for root rights.
  • πŸ›‘οΈ Patching the bootloader (for example, through OrangeFox Recovery).
  • πŸ”„ Update firmware (if the firmware is older than the current version on the phone).

πŸ’‘

Custom firmware is warranty-free and can cause problems with banking applications (due to lack of Google certification), and if the phone is used to work with SBP or government services, it is better to stay on official software.

Recovery after a failed firmware

If something goes wrong and the phone stops turning on or only loads on the Fastboot, don't panic. In 90% of cases, the device can be restored.

  1. Check the charging response. Connect the phone to the network, and if the light is on, it's a software problem.
  2. Try to boot into Recovery. Keep Volume Up + Power 10-15 seconds.
  3. Use the Mi Flash Tool to re-run the firmware. Select Clean all and lock mode.
  4. If nothing helps β€” EDL-You'll need a special cable or a circuit board to close the test points.

Recovery through EDL (Emergency Download Mode) requires an authorized Xiaomi account or boxing (e.g. UFi Box), a method used in service centers and requires soldering skills, and if you are not sure, you should consult a specialist.

If the phone is defined as Qualcomm HS-USB QDLoader 9008, So he's on the move. EDL. For firmware in this case, use the QFil utility and file prog_emmc_firehose.mbn firmware.

⚠️ Attention: Firmware through EDL Without authorization, Xiaomi may lead to a lock IMEI This method is recommended only in extreme cases.

FAQ: Answers to Frequent Questions

Can I use Xiaomi without unlocking the bootloader?
No, official and custom firmware requires an unlocked bootloader. Except for Settings Update β†’ System Update, but they do not allow you to change the software version radically (for example, from MIUI to LineageOS).
How do I know if my Xiaomi bootloader is unlocked?
Turn off your phone and press Volume Down + Power. If this device is unlocked, the bootloader is unlocked. If this device is locked, it's locked.
Will data be lost when you run through Fastboot?
Yes, the Clean all mode in the Mi Flash Tool completely erases internal memory, including photos, apps and settings. Always back up before firmware.
Can I return the official firmware after the custom?
Yes, download the official firmware from Xiaomi and install it via the Mi Flash Tool in Clean All and Lock mode. This will also block the bootloader back.
Why is the mobile network not working after the firmware?
This is a typical problem when installing firmware from another modification (e.g. global instead of Chinese). Solution: Check IMEI with *#06#. If IMEI is missing, restore it through Maui META. Make sure the firmware is compatible with your model.