How to reflash any Xiaomi phone: official and custom firmware

Reflashing Xiaomi’s smartphone is a process that can bring a device back to life or turn it into a brick if you approach it without preparation. Unlike standard β€œover the air” updates, hand firmware gives you access to new features, improved performance, or even the ability to install an alternative OS like LineageOS or Pixel Experience. But before you dive into the world of fastboot, TWRP and ADB, it’s worthwhile to clearly understand why you need it.

Xiaomi’s official firmware (MIUI) comes out regularly, but doesn’t always contain the latest security or optimization fixes for a particular model. Custom firmware, in turn, offers β€œclean” Android without excess software, but requires an unlocked bootloader and is often deprived of warranties. In this article, we’ll break down all the current ways to flash it β€” from securely updating through the Mi Flash Tool to installing informal builds through recovery β€” and also explain how to avoid the typical mistakes that turn a smartphone into a useless piece of plastic.

1. Preparation for flashing: what you need to know before you start

Before you download firmware or unlock the bootloader, answer three key questions:

  • πŸ” You want to take the ads off the table. MIUI, Get the latest version of Android or restore a β€œbrick” phone?
  • πŸ“± What model? firmware for the Redmi Note 10 Pro will not be suitable for POCO X3 Pro, even if they're on the same chipset.
  • πŸ”“ Are you ready for the risks? Unofficial firmware can deprive you of banking apps (due to the lack of Google SafetyNet) or camera features.

If the goal is simply to update the system, check first for availability. OTA-Updates to Settings β†’ The phone. β†’ Update MIUI. Official updates do not require unlocking the bootloader and retain the warranty, but for custom firmware or downgrade (rollback to the old version) you will need to:

  • πŸ’» Windows computer (for Mi Flash Tool or ADB).
  • πŸ”Œ Cable USB (preferably original to avoid breakages of the connection).
  • πŸ“ Backup data (firmware erases everything, including photos and messages).
  • πŸ”‹ Battery charge of at least 60% (so that the phone does not turn off during the process).

⚠️ Note: Firmware via fastboot on some Xiaomi models (e.g. Mi 11 Ultra or Redmi) K40) block IMEI, If you use informal tools, check before you start to see if your model supports unlocking the bootloader on the Mi Unlock site.

πŸ“Š Why do you want to re-examine your Xiaomi?
I want to take down ads in MIUI.
Need the latest version of Android
Broken after the update
I want to try custom firmware.
Other

2. Official firmware via Mi Flash Tool: a secure method

This is the most reliable way to update or restore a smartphone if it does not turn on or is stuck on the logo. Mi Flash Tool only works with official firmware in.tgz or.zip format, which are downloaded from the MIUI Downloads website. The main advantage is the preservation of warranty (if the bootloader is not unlocked).

Instructions:

  1. Download Mi Flash Tool from the official website and install drivers (the Driver folder is in the archive with the program).
  2. Turn off your phone and press Volume Down + Power to enter fastboot mode (a rabbit labeled Fastboot will appear on the screen).
  3. Connect your phone to your PC and run the Mi Flash Tool. The program must identify the device.
  4. Press Select and select the folder with the unpacked firmware (for example, redmi_note_10_pro_global_images_...).
  5. At the bottom, select firmware mode: Clean all – complete cleaning (recommended in case of failures); Clean all and lock – cleaning + lock bootloader (only for official firmware!); Save user data – data storage (not always stable).

Flash

Firmware modeAre the data stored?Locking the bootloader?When to use
Clean all❌ No.❌ No.In case of critical failures or change of the firmware region
Clean all and lock❌ No.βœ… Yes.Only to return to the official MIUI after custom firmware
Save user dataβœ… Yes*❌ No.Update without losing data (not always working)

* Data may not be fully stored, especially when switching to a different version of Android.

⚠️ Warning: If your phone is stuck on boot after you have firmware, try repeating the Clean all process. If it doesn't work, check if the firmware was selected (for example, for Redmi Note). 9 Pro has versions for India (joyeuse) and global (joyeuse_global)).

β˜‘οΈ Checklist before firmware via Mi Flash Tool

Done: 0 / 5

3. Unlocking the bootloader: a mandatory step for custom firmware

The bootloader on all Xiaomi smartphones is locked by default, a security measure that prevents uncertified software from being installed. To flash custom recovery (e.g. TWRP) or alternative firmware, the bootloader needs to be unlocked, a process that takes at least 7 days to wait (if the Mi Account is new) and requires the device to be linked to the account.

Step-by-step:

  1. Link your phone to your Mi Account in Settings β†’ Xiaomi account.
  2. Enable USB debugging and OEM unlocking: Go to Settings β†’ About Phone and tap 7 times on the MIUI version to activate Developer Mode. Return to Settings β†’ Additional β†’ For Developers and enable: Debugging by USB OEM Unlock (may be called Factory Unlock).

Mi Unlock Tool

official website

fastboot

Loudness down + Nutrition

Mi Unlock Tool

Unlock

After unlocking the loader:

  • βœ… It can be installed. TWRP or other custom recovery.
  • βœ… Unofficial firmware installation (e.g. Pixel Experience or ArrowOS) will be available).
  • ❌ Reset warranty (officially, but some service centers close their eyes).
  • ❌ Mi Pay, Google Pay and other apps that require SafetyNet will stop working (unless you flash Magisk to mask root rights).
What if the Mi Unlock Tool can’t see the device?
1. Check if Xiaomi drivers are installed (especially for fastboot mode). 2. Try another one. USB-port USB 2.0 back-panel). 3. Disable driver signatures in Windows (via command line: bcdedit) /set nointegritychecks on). 4. If the phone is new, wait. 7 Mi Account is Xiaomi’s requirement for new devices.

4. Install custom recovery (TWRP) and firmware through it

TWRP (Team Win Recovery Project) is an alternative recovery menu that allows you to flash informal firmware, backup and obtain root rights. TWRP installation is possible only after unlocking the bootloader.

How to install TWRP:

  1. Download the current version of TWRP for your model from twrp.me (.img file).
  2. Rename the file to twrp.img and place it in a folder with ADB (e.g., C:\platform-tools).
  3. Connect your phone in fastboot mode and execute the command: fastboot flash recovery twrp.img
  4. Immediately after the firmware, go to TWRP, holding Volume Up + Power. If you miss this step, the system will rewrite TWRP standard recovery.

Now you can make customized firmware:

  1. Download firmware (like LineageOS or Pixel Experience) and place it on your phone or SD-map.
  2. In TWRP, click on Wipe β†’ Advanced Wipe and mark Dalvik / ART Cache System Data Cache

Install

Gapps

Magisk

Reboot to the system.

⚠️ Note: Some Xiaomi models (e.g. Redmi Note) 8 Pro with a Mediatek chipset) firmware through TWRP may result in loss IMEI. Before installing custom firmware, make a backup section NVRAM Adb shell su dd if:=/dev/block/bml13 of=/sdcard/nvram_backup.img

πŸ’‘

If after the customization ROM phone doesn't see SIM-check if the firmware supports your region. Some builds (e.g. India) may not work with European operators. modem.img for your region.

5. firmware via ADB Sideload: an alternative for problem cases

If the phone doesn't load, but the TWRP is installed, you can flash the firmware through ADB Sideload.

  • πŸ“± The phone is stuck in the bootloop, but TWRP work.
  • πŸ”„ You need to update the firmware without losing data (if supported).
  • 🚫 Standard firmware methods do not work.

Instructions:

  1. Download firmware in.zip format (for example, from the XDA Developers website).
  2. Download to TWRP and select Advanced β†’ ADB Sideload.
  3. On PC, open the command line in the folder with ADB and type: adb sideload name file.zip
  4. Wait until the end (the progress will be displayed on the phone screen).
  5. After installation, run Wipe cache/dalvik and restart.

This method is often used to firmware Google Camera (GCam) or fix bugs after a failed update. however, ADB Sideload is not suitable for firmware official.tgz files - they need Mi Flash Tool.

6. Common mistakes and how to avoid them

Even experienced users sometimes have trouble reflashing, and here are the most common bugs and solutions:

Mistake.Reason.Decision
Fastboot: FAILED (remote: 'Flashing is not allowed in Lock State')The bootloader is not unlockedUnlock the bootloader through the Mi Unlock Tool (see Section 3)
The phone does not turn on after firmware (black screen)Incorrect firmware or interrupted processRepeat the firmware through fastboot with Clean All mode
Error: 7 in TWRPThe firmware is not compatible with the deviceCheck the phone model and download the correct firmware version
No network after custom ROM firmwareNo modem.img or incorrect APN settingsSwipe stock modem or manually add operator APN
Mi Flash Tool doesn't see the phoneNo drivers or cable problem installedInstall drivers manually through Device Manager or try another cable

If your phone has turned into a brick (no button response, no PC detection), try:

  • πŸ”Œ Hardware reset: Press the Volume up + Power for 20-30 seconds.
  • πŸ’» Firmware through EDL: Emergency Download Mode (requires an authorized Xiaomi account and Qualcomm boxing).
  • πŸ”§ Contact the service: If nothing helps, it is possible that the motherboard is damaged.

πŸ’‘

The most common reason for bricking is incompatible firmware. Always check the model code name (such as raphael for the Redmi K20 Pro) before downloading files.

7.How to get back the official MIUI after custom firmware

If the custom firmware experiments didn't live up to expectations, you can go back to stock MIUI.

  1. Download the official firmware in.tgz format for your model from the MIUI Downloads website.
  2. Unpack the archive and launch the Mi Flash Tool.
  3. Connect your phone in fastboot mode.
  4. Select Clean all and lock mode (this will block the bootloader and return the warranty).
  5. Press Flash and wait until it is completed.

After returning to MIUI:

  • βœ… The bootloader is locked again.
  • βœ… Support for Google Pay and banking applications will return.
  • ❌ Root rights and custom recovery will disappear (if they were).

⚠️ Note: On some models (e.g, POCO F3 or Mi 11) after locking the bootloader may require the device to be re-associated with the Mi Account. If you forget the account information, the phone will remain locked!

FAQ: Frequent questions about Xiaomi flashing

Can I use Xiaomi without unlocking the bootloader?
Yes, but only official firmware via the Mi Flash Tool in Save user data mode (if available). For custom firmware or TWRP, unlocking is mandatory.
Will I lose my warranty after I re-flash it?
The official firmware through the Mi Flash Tool is not unwarranted. Unlocking the bootloader and installing custom firmware is, but in some service centers, you can return the stock firmware and lock the bootloader to hide the signs of interference.
How to check if the bootloader is unlocked?
Turn off your phone and press Volume Down + Power. If Unlocked appears under the rabbit logo, the bootloader is unlocked. If Locked is locked.
Can I use Xiaomi to help you? OTG-cable?
Theoretically, yes, if you already have a TWRP installed and the firmware is on the flash drive, but for the first firmware or unlocking the bootloader, a PC is a must.
What if the camera doesn’t work after the firmware?
This is a typical custom firmware problem. Solutions: Sweat a modified vendor.img for your model. Set GCam with the settings for your smartphone. Go back to stock MIUI if the camera is critical.