How to properly flash Xiaomi phone: a complete guide to unlock the bootloader

Xiaomiโ€™s smartphone firmware is a process that can bring a device back to life and turn it into a brick if you approach it without preparation. Unlike standard โ€œover the airโ€ updates, manual firmware requires unlocking the bootloader, choosing the right version of software and following the instructions accurately. This article will help you understand all the nuances from tool preparation to system recovery after unsuccessful manipulations.

We will look at three main methods of firmware โ€“ through Fastboot (for deep system changes), Recovery (for updates without losing data) and Mi Flash Tool (the official tool from Xiaomi), focusing on unlocking the bootloader, a mandatory step for most operations, and also analyze typical errors (for example, anti-rollback or invalid image) and how to fix them.

Important: The firmware procedure voids the warranty if the device was not unlocked through the official Mi Unlock channel.For models with Qualcomm processors (e.g., Redmi Note 10 Pro or the Redmi Note 10 Pro). POCO X3 Pro) and Mediatek (e.g. Redmi) 9A) The instructions will be different โ€“ this is taken into account in the manual.

1. Firmware Preparation: What to Do Before Starting

Before you start firmware, make sure that all the preliminary steps are followed. Neglect of preparation is the main reason for the "bricking" of devices.

First, back up all your important data. Fastboot firmware wipes away all internal memory, and even upgrades through Recovery can cause crashes. Use Mi Cloud, Google Drive, or physical copying on your PC.

  • ๐Ÿ“ฑ Contacts and Messages (Export through Settings) โ†’ Google โ†’ Backup)
  • ๐Ÿ“ธ Photos and videos (check folders) DCIM and Pictures)
  • ๐Ÿ”‘ Application passwords (use Google Smart Lock or password manager)
  • ๐ŸŽฎ Save games (many games, such as Genshin Impact, link progress to your Mi Account)

Second, check the device model and the firmware version, which is critical to choosing the right software.

  • ๐Ÿ“„ In settings: Settings โ†’ The phone. โ†’ Model (e.g, M2007J3SC For the Redmi Note 9 Pro)
  • ๐Ÿ” On or under the battery (for devices with removable lid)
  • ๐Ÿ’ป Through ADB-Adb shell getprop ro.product.model
๐Ÿ“Š What Xiaomi model are you using?
Redmi (Note, K series)
POCO (F, X series)
Mi (11, 12 episodes)
Black Shark
other

Third, charge the phone at least 60%. Interrupting the process due to battery discharge can damage the boot partition and not be able to turn on. For models with a battery less than 4000 mAh (for example, the Mi 11 Lite), 80% charge is recommended.

โš ๏ธ Note: If your device was purchased in China (the C-suffix version in the model, for example, the Mi 10 Ultra C), the firmware of the global version may block modules. NFC or 5G. Check compatibility on the forum XDA Developers or 4PDA.

2 Unlocking the bootloader: a mandatory step before the firmware

The bootloader on all Xiaomi devices is blocked by default. This is a security measure to prevent the installation of unofficial software. For firmware through Fastboot or custom Recovery (for example, for example, TWRP) It needs to be unlocked.

The official way is through the Mi Unlock Tool, which takes up to 720 hours (30 days) of waiting for new Mi accounts, but for older users (registered before 2022) it can go faster.

  1. Link the device to your Mi Account: ๐Ÿ“ฑ Go to Settings. โ†’ Mi Account โ†’ Synchronization ๐Ÿ”— Enable Find the device and Synchronize data ๐Ÿ”„ Reboot the phone.
  2. Download the Mi Unlock Tool: ๐Ÿ–ฅ๏ธ Official page: en.miui.com/unlock (required VPN for certain regions) ๐Ÿ“ฅ Windows version (support) Linux/Mac absent)

Run the unlock:

1. Turn off your phone and press Power + Volume Down to log in to Fastboot.


2 Connect the device to the PC via the original USB cable.




3.In Mi Unlock Tool, press Unlock and confirm the action.

If the utility gives you a Couldn't unlock or Device not connected error, check:

  • ๐Ÿ”Œ Cable and port USB (Use the back port on your PC for a stable connection)
  • ๐Ÿ”„ Qualcomm or Mediatek driver version (update via Device Manager)
  • ๐Ÿ•’ Waiting time (168 new accounts required)+ The device pairing hours with Mi Account)
What if the Mi Unlock Tool canโ€™t see the device?
Try the following steps: 1. Install drivers manually through Device Manager โ†’ Update the driver โ†’ Select from the list โ†’ Android Bootloader Interface. 2. Turn off driver signatures in Windows (click Win) + X โ†’ Command Prompt (Administrator) and execute bcdedit /set testsigning on). 3. Use alternative versions of the Mi Unlock Tool (e.g., modified from Xiaomi.eu).

โš ๏ธ Attention: Unlocking the bootloader resets the device to factory settings. After the procedure, Find Device and Mi Cloud Backup functions are also disabled before re-associating the account.

3. Selection of firmware: official vs custom

The type of firmware depends on the stability of work, the presence of bugs and the availability of features. Xiaomi offers several types of software:

Type of firmwareDescriptionPlusesCons
Official stable.Xiaomi version with minimal bugs (e.g., the same as the one you see here, MIUI 14.0.5)โœ… Maximum compatibilityโœ… Support OTA-updateโŒ Lots of Bloatware (pre-installed applications)โŒ Delays in updates
Official developerWeekly builds with new features (e.g, MIUI 14.1.23.12.12)โœ… Early access to featuresโœ… Frequent updatesโŒ Critical bugs are possibleโŒ Instable operation of modules (NFC, camera)
Xiaomi.euModified official firmware without Chinese servicesโœ… No advertising and no bloatwareโœ… Support for themes and patchesโŒ No. OTA (hand-mounted)โŒ Possible problems with SafetyNet
LineageOS (Pixel Experience)Third-party builds on base AOSPโœ… Pure Androidโœ… Additional settingsโŒ No support for proprietary features (for example, IR-blaster)โŒ Risk of incompatibility with iron

For most users, the best choice is the official stable firmware or Xiaomi.eu. Castom builds are suitable for experienced users who are willing to put up with the lack of certain features (for example, Widevine). L1 for Netflix HD).

Download firmware is recommended from official sources:

  • ๐ŸŒ Official: new.c.mi.com (select Global Region, EEA Russia)
  • ๐Ÿ‡ช๐Ÿ‡บ Xiaomi.eu: xiaomi.eu (requires forum registration)
  • ๐Ÿ”ง Castomy: XDA Developers (check reviews before installation)

๐Ÿ’ก

Before downloading the firmware, check its hash sum (MD5 or SHA1) using HashMyFiles, which will prevent the installation of a corrupted file.

4. Firmware through Fastboot: Complete System Reinstallation

The Fastboot method is used to completely reflash the device, including boot, system, and vendor partitions, and is the only way to restore the brick or install firmware on a device with damaged Recovery.

Tools required:

  • ๐Ÿ–ฅ๏ธ Windows PC 10/11 (For the Mi Flash Tool)
  • ๐Ÿ”Œ Original. USB-cable (do not use cheap analogues)
  • ๐Ÿ“ฆ Firmware in.tgz or.zip format (unpack into a folder without Cyrillic)
  • ๐Ÿ› ๏ธ Mi Flash Tool (download from xiaomiflashtool.com)

Step-by-step:

โ˜‘๏ธ Firmware through Fastboot

Done: 0 / 5
  1. Run Mi Flash Tool: Select a folder with firmware (must have files) flash_all.bat, At the bottom of the window, specify the firmware method: Clean All - complete cleaning (recommended for changing the version). MIUI) Clean All and Lock - Cleaning Up + Locking the bootloader (only for official firmware) Save User Data - saving data (not always stable)

Start the firmware:

Press Flash and wait until it's finished (usually 5-15 minutes). Don't turn off the device even if it's 99 percent frozen, which is normal for some models.

If the Mi Flash Tool is a bad image or flash not done error, check:

  • ๐Ÿ“ The path to firmware (should not be Cyrillic or gaps)
  • ๐Ÿ”„ Mi Flash Tool (new devices require version 2023)+)
  • ๐Ÿ”Œ Cable and port (try another one) USB-hub)

๐Ÿ’ก

Fastboot erases all data, including internal memory (userdata partition). It is impossible to recover it after the procedure - make a backup!

5. Firmware through Recovery: Update without data loss

Recovery Method is suitable for updating the current version MIUI This is a less risky method, but it has limitations: you can not change the firmware region (for example, with a different location). CN Global) or downgrade version MIUI.

Requirements:

  • ๐Ÿ“ฑ Phone must be on official firmware (Castom Recovery is not supported)
  • ๐Ÿ“ฆ Firmware in.zip format (do not unpack!)
  • ๐Ÿ”‹ Battery charge of at least 50%

Instructions:

  1. Download the firmware: The file should be called something like this: miui_BLOCKOTA_MI11Global_V14.0.5.0.TKBMIXM_.... Check compatibility with your model!
  2. Rename the file: For convenience, rename it to update.zip Put it in the root of internal memory (not in folders!).
  3. Enter Recovery: 1. Turn off the phone. 2. Press Power. + Volume Up before Mi Recovery logo arrives.
  4. Select language: Use English or Chinese (Russian may not be displayed correctly).
  5. Install firmware: Go to Install update.zip to System โ†’ select the file โ†’ Confirm the installation. Once complete, select Reboot to System.

If after the reboot the phone is getting stuck on the MI logo, reset via Recovery:

  1. Enter Recovery (see Step 3 above).
  2. Choose Wipe Data โ†’ Wipe All Data.
  3. Confirm the action and restart.

โš ๏ธ Note: On certain devices (e.g, POCO F3 or Redmi K40) Firmware through Recovery may cause an anti-rollback error if the version MIUI In this case, you need to run the firmware through the Fastboot with a full cleaning.

6. Solving typical firmware errors

Even if you follow the instructions accurately, you can get errors, and let's look at the most common ones and how to fix them.

Mistake.Reason.Decision
Anti-rollbackAttempt to lower the MIUI version below the permissible limitSweeve a newer version through Fastboot with a full clean (Clean All)
Invalid image in Mi Flash ToolA damaged firmware file or incompatible versionDownload the firmware again, check it out. MD5-hash
This package is for... only in RecoveryThe firmware is not suitable for your model.Download the correct version (check the model code in Settings โ†’ About the phone)
The phone does not turn on after the firmwareThe boot or dtbo section is damagedRepeat the firmware through Fastboot with Flash boot tick
Mi Flash Tool doesn't see the deviceNo drivers or cable problemInstall drivers manually (see spoiler above), try another cable

If after firmware the device is stuck on boot (bootloop), follow the following steps:

  1. Enter Fastboot (Power) + Volume Down).
  2. Swipe only the boot section through the command: fastboot flash boot boot.img (file boot.img It is located in the image folder of the unpacked firmware).
  3. Reboot the device: fastboot reboot

For anti-rollback errors, check the current version of your deviceโ€™s Anti-Rollback Protection. ADB:

adb shell getprop ro.build.version.incremental

If the firmware version is lower than the current one, you can find a compatible build on the forum 4PDA model-themed.

7.Custom Recovery firmware (TWRP) Magisk

Custom Recovery is required to install unofficial firmware (such as LineageOS) or obtain root rights, such as TWRP. This process is more risky than standard firmware, but opens up additional opportunities.

Warning: Installation TWRP may lead to:

  • โŒ Loss of support OTA-update
  • โŒ SafetyNet problems (bank applications will not work)
  • โŒ Unstable operation of the camera or sensors

Instructions for installing TWRP:

  1. Download the image TWRP: Official builds: twrp.me. Xiaomi often requires unofficial versions (look for the XDA or 4PDA).
  2. Enter Fastboot: Turn off your phone โ†’ clamp down the Power + Volume Down
  3. Please. TWRP: fastboot flash recovery twrp-3.7.0_12-1-miatoll.img Fastboot Reboot Recovery (Replacement) twrp-3.7.0_12-1-miatoll.img in the name of your file)
  4. Block Recovery Replacement: After First Download TWRP Go to Advanced. โ†’ Flash Current TWRP, To prevent overwriting with standard recovery.

Install Magisk to get root:

  1. Download the latest version of Magisk from GitHub.
  2. Rename the file to Magisk.zip And copy it to your phone.
  3. V TWRP Choose Install โ†’ specify the file Magisk.zip โ†’ swipe for confirmation.
  4. Reboot to the system.

โš ๏ธ Note: On devices with Dynamic Partition (e.g. Mi) 11 or POCO F3) Magisk installation requires additional steps: patching boot.img via Magisk and its firmware via Fastboot.

8.Recovery after failed firmware

If the device stopped turning on or only boots to Fastboot, donโ€™t panic โ€“ 90% of the time it can be restored. The main thing is not to try to flash random files, this can make things worse.

Symptoms and solutions:

  • ๐Ÿ”ด Phone doesn't respond to buttons: Try clamping Power + Volume Up + Volume Down for 10-15 seconds for forced reboot. If it doesn't work, plug it into a 30 minute charge (the battery may have gone dead).
  • ๐Ÿ”„ Bootloop: Log in to Fastboot and run the full firmware through the Mi Flash Tool with the Clean All option.
  • ๐Ÿ“ต The device is defined as Qualcomm HS-USB QDLoader 9008: This is a mode EDL (Emergency Download Mode. Recovery will require an authorized Xiaomi account and a special cable (or circuit test points on the board.
  • ๐Ÿ”‹ Phone turns on but discharges quickly: Reset settings via Recovery (Wipe Data) or run another firmware version.

For devices that are not defined by the PC (for example, after a failed modem firmware), try emergency firmware through testpoints:

  1. Disassemble the phone and find test points (usually signed) EDL or TEST).
  2. Lock them with tweezers or wires.
  3. Connect. USB-cable โ€“ the device must be identified as Qualcomm HS-USB QDLoader 9008.
  4. Fluidify the firmware via Mi Flash Tool or QFil.

On devices with a Mediatek processor (e.g., Redmi) 9A or POCO C31) restore EDL You need an authorized Xiaomi account and special software (for example, a Xiaomi account, SP Self-intervention without experience can lead to irreversible damage.

FAQ: Frequent questions about Xiaomi firmware

โ“ Can I flash Xiaomi without unlocking the bootloader?
No, for firmware via Fastboot or custom Recovery installation, unlocking is mandatory, except for the update via Recovery on the official firmware (but there are restrictions on the version). MIUI).
โ“ How to know if the bootloader is unlocked?
Turn off your phone and log in to Fastboot (Power) + If you have Unlocked or an open lock icon at the bottom of the screen, the bootloader is unlocked. You can also check through the command: fastboot oem device-info Search for the lines Device unlocked: true.
โ“ Why does the mobile network not work after the firmware?
This is a typical problem when changing the firmware region (for example, with the CN Solutions: Check the settings APN In Settings โ†’ SIM-maps and mobile networks โ†’ Access points (APN). Fastboot: Fastboot Flash Modem Module from Old Firmware NON-HLOS.bin Reset your network settings in Recovery (Wipe) โ†’ Format Data).
โ“ Can I return the warranty after the firmware?
Officially, no, because unlocking the bootloader is locked in the system, but some service centers may close their eyes if you: Sweat the official firmware through Fastboot with the Clean All and Lock option. Reset the unlock counter (only on some models via XiaomiTool). V2). Note that the block