Introduction: Why you need a full reflash Xiaomi
Reflashing Xiaomiβs smartphone isnβt just a system update, itβs a radical software change that can solve performance problems, remove preinstalled software, or even give access to new features. OTA-Updates, full firmware involves replacing the entire operating system, including the kernel, drivers and system applications.
The main reasons why users resort to this method are: freezes after updating MIUI, the need to install custom firmware (for example, LineageOS or Pixel Experience), removal of the bloat, restoration of the "brick" after a failed upgrade or unlocking additional features (for example, Camera2 API for manual photo settings).
This is the same as most Xiaomi, Redmi and POCO models (Redmi Note 4X to Xiaomi 14 Ultra), but it is important to consider the specifics of a particular device. For example, for devices on the MediaTek platform (for example, Redmi 9A), the process of unlocking the bootloader is different from the models on the Qualcomm Snapdragon (for example, POCO F5).
Preparation for Flashing: What to Do Before Starting
Before you start firmware, you need to follow a few critical steps: first, back up all your data: contacts, photos, messages and applications. Full firmware erases the internal memory of the device, and then you can't recover the information. Use Mi Cloud, Google Drive or local copy on your PC.
Second, check the device model and current version of MIUI. This can be done in the Settings β About phone menu. Write down the exact data: for example, Redmi Note 11 Pro 5G (codename veux) with MIUI version 14.0.5.
- π± Find out the code name of the device (e.g., raphael for Redmi) K20 Use services like Xiaomi Flash or XiaomiUI base.
- π Charge the battery to at least 60%. interruption of the process due to battery discharge can cause damage to the loader.
- π₯οΈ Prepare a PC with Windows 10/11. Fastboot will require Qualcomm or MediaTek drivers, as well as Mi Flash Tool or utilities. SP Flash Tool.
- π Download the official firmware from the site MIUI Downloads or custom forum XDA Developers.
β οΈ Note: If your device was purchased in China (suffix version) CN), Global firmware can block the network due to differences in modem software. Check compatibility on forums before starting.
Unlocking the bootloader: a step without which you can not do
The bootloader on all Xiaomi devices is locked by default, a security measure that prevents unofficial software from being installed.
- Link your Mi Account to your device. Go to Settings β Xiaomi Account β Mi Cloud and log in. Without this step, Xiaomi's server won't allow unlocking.
- Enable USB debugging. To do this, activate Developer Mode (7 times click on the MIUI version in About Phone), then in Additional Settings β Developer Settings turn on USB debugging and OEM unlock.
- Download Mi Unlock Tool from the official website en.miui.com/unlock and install on PC.
Next, connect your phone to your computer in Fastboot mode (turn off the device, then press Volume Down + Power). Launch the Mi Unlock Tool, log in to the same Mi Account as the phone, and follow the instructions. The process can take anywhere from a few minutes to 72 hours - that's fine, as Xiaomi checks the request on the server.
β οΈ Note: Some models (e.g. Redmi Note 10 Pro) reset data, including internal memory, after unlocking the bootloader. Don't rely on local backups - use the cloud.
What to do if Mi Unlock Tool gives you a "Couldn't unlock" error
The error "Couldn't unlock" (or code 86006) means that the Xiaomi server rejected the request.
- Mi Account is not tied to the device (check Settings β Xiaomi account).
- The device was purchased less than 7 days ago (Xiaomi's restriction for new devices).
- You use the unofficial version of the Mi Unlock Tool (download only from the official website).
- The phone has custom firmware installed (go back to stock MIUI).
Solution: wait 72 hours, re-link your account and try again. If the error persists, use alternative unlock methods via EDL (requires an authorized Xiaomi account for service centers).
Firmware selection: official MIUI vs custom builds
Once you unlock the bootloader, you need to decide on the type of firmware. Each option has pros and cons:
| Type of firmware | Advantages | Deficiencies | Who's right for? |
|---|---|---|---|
| Official MIUI (Stable) | Maximum stability, support OTA-Updates, all camera and sensor functions are working | Lots of bloat, advertising in system applications, limited settings | Users who need reliability and compatibility |
| Official MIUI (Developer) | Early access to new features, fewer restrictions on modifications | Possible bugs, frequent updates, unstable operation of some modules | Enthusiasts willing to put up with bugs for the sake of new features |
| LineageOS (Pixel Experience) | Clean Android without bloat, advanced settings, long-term support | The camera may not work, NFC or sensors, no. OTA-Updates from Xiaomi | Advanced users who are interested in controlling the system |
| Port from another device (e.g. MIUI from POCO to Redmi) | Unique features from other models | High risk of bricks, unstable work, lack of support | Experienced modifiers ready for experimentation |
For beginners, it is recommended to start with an official stable MIUI. Custom firmware requires additional knowledge (for example, installing TWRP or dm-verity patching). If you choose a cast, make sure it supports your model - check themes on XDA or in developer telegram chats.
π‘
Before installing custom firmware, check if it supports GApps (Google services).Some builds (like Havoc-OS) require a separate setup of Open GApps or NikGApps.
Firmware through Fastboot: step-by-step instructions
The Fastboot method is the most reliable way to flash Xiaomi, as it works at a low level and is suitable even for bricks.
- π» PCs with Qualcomm or MediaTek drivers installed (depending on the device processor).
- π Firmware in.tgz or.zip format (unpack it into a folder without Cyrillic characters).
- π οΈ Mi Flash Tool (for official firmware) or Fastboot Enhance (for customized software).
Algorithm of action:
- Run the Mi Flash Tool, select the folder with the unpacked firmware and press Refresh.
Flash
and wait until it's finished (usually 5-15 minutes). USB-cable!
β οΈ Note: If the process is stuck in the waiting for device phase, check the cable (use the original one). USB Type-C and port USB (preferably USB 2.0 on the back of a PC. Some motherboards have ports. USB 3.0 (blue) can cause failures.
βοΈ Preparation for firmware through Fastboot
0
Make sure the battery is charged on 60%+|Download the firmware for your model (check the code name)|Install the drivers. Qualcomm/MediaTek PC-only|Unpack the firmware in a folder without spaces and Cyrillic|Disable the antivirus (it can block the Mi Flash Tool)
Firmware through Recovery (TWRP): for custom assemblies
If you install custom firmware (like LineageOS or ArrowOS), custom recovery is required β usually TWRP. This method is more flexible, but also more risky, as errors in TWRP can damage the data partition.
Steps to install via TWRP:
- Install. TWRP. Download the image for your model from twrp.me and run it through Fastboot: fastboot flash recovery. twrp-3.7.0_12-veux.img fastboot boot twrp-3.7.0_12-veux.img (Replace veux with your deviceβs code name).
- Make a backup in TWRP. In the main menu, select Backup and save the Boot, System, Data and Vendor sections to the SD-card.
- Clear the partitions. Go to Wipe β Advanced Wipe and mark: Dalvik / ART Cache System Data Cache
Don't touch it.
Vendor
Persist
Modem
Install the firmware
Install
.zip
GApps
Squeeze Magisk (optional)
Magisk.zip
On dynamic partitions devices such as the Xiaomi 12T or POCO F4, the standard TWRP may not work, in which case use modified versions (such as the OrangeFox TWRP) or stitch through the Fastboot.
π‘
If the phone doesnβt boot after installing custom firmware (hangs on the logo), try flashing the kernel (boot.img) separately through Fastboot or repeat cleaning the cache in TWRP.
Solutions for Firmware Mistakes
Even with strict adherence to the instructions, errors can occur, and here are the most common ways to correct them:
| Mistake. | Reason. | Decision |
|---|---|---|
| Invalid sparse file format at header magic | A firmware file or incompatible version of the Mi Flash Tool is damaged | Download the firmware again, use the Mi Flash Tool version 2020.3.14.0 |
| This package is for"veux" devices; this is a"vili". | The firmware is not suitable for your model (name encoding error) | Check the code name of the device and download the correct firmware |
| Anti-rollback check fail | Trying to roll back on an older version of MIUI (Xiaomi protection) | Sweep through a newer version or use EDL to get around (risky!) |
| The phone does not turn on after firmware (black screen) | The boot or dtbo section is damaged | Flow the stock core through Fastboot or restore the backup to TWRP |
| E: Unknown command [log] in TWRP | Incompatible version of TWRP with your device | Install the current version of TWRP or OrangeFox |
If the device doesn't respond to buttons and is not detected in Fastboot, the bootloader may be damaged, and only the firmware through EDL (Emergency Mode) will help.
- Authorized Xiaomi account (for service centers).
- USB Type-C cable with EDL support (e.g., original from Xiaomi)
- Mi Flash Pro or QFil (for Qualcomm)
β οΈ Attention: Firmware through EDL drop off IMEI and the serial number on some models (for example, Redmi Note 8 Pro), they can be restored only with the help of service utilities (SN Write Tool, which requires authorization from Xiaomi.
What to do after firmware: setup and optimization
Once the firmware is successful, the device will be clean, just like it was after purchase.
- Go through the initial setup, but donβt restore data from the backup right away β check the stability of the system first.
- Update all apps via Google Play or Mi App Store.
- Check the operation of key functions: πΆ Mobile network and calls (especially if you have been using an informal phone) MIUI). π· Camera (on custom firmware may not work) HDR or Night Mode). π Charging and displaying battery level. π Sound in speakers and headphones.
Set up root rights (if you installed Magisk)
adb shell
su
magisk --install-moduleInstall modules to hide root from banking applications (e.g. MagiskHide Props Config).
If you have a custom firmware, it is recommended:
- π Disable automatic updates MIUI (If there is one, to avoid conflict.
- π‘οΈ Install an alternative core (e.g., FrancoKernel) to improve performance.
- π― Set up build.prop to unlock additional features (e.g, Camera2 API for GCam).
π‘
To return stock sounds and MIUI animations to custom firmware, copy files from the /system/media section of stock firmware (use Root Explorer).