Returning the official firmware to Xiaomi: from unlock to installation MIUI

Return of official firmware to Xiaomi smartphones is a task that users face after experiments with custom devices ROM, Failed updates or purchase of a device with modified software. Faced with bugs, unstable work or loss of warranty, many decide to return the "stock" - factory version MIUI, But it's not as simple as it sounds: it requires unlocking the bootloader, choosing the right firmware version, and following the instructions carefully to avoid turning the smartphone into a brick".

In this article, we will look at all the steps from the device preparation to the final system setup, and also look at the typical errors and how to fix them. Xiaomi/Redmi/POCO, Because the algorithm may vary depending on the chipset (Qualcomm vs Mediatek) and the bootloader version. EDL-Donโ€™t worry, we will explain everything as easily as possible, without unnecessary technical terminology.

Why you should return the official firmware

Castom firmware and modified versions MIUI Often promises enhanced features, no ads, or more recent versions of Android, but in practice, users face a number of problems that force them to return to official software:

  • ๐Ÿ”„ Unstable operation: Accidental reboots, interface freezes, or sensor failures (e.g., a fingerprint scanner).
  • ๐Ÿ“ก Network problems: poor coverage LTE/5G, Lack of VoLTE or VoWiFi support on unofficial builds.
  • ๐Ÿ”’ Blocking services: ban in Mi Account, inability to use Xiaomi Cloud or Mi Pay.
  • ๐Ÿ”‹ Accelerated battery discharge: Optimizing power consumption in stock firmware often works more efficiently.
  • ๐Ÿ›ก๏ธ Security: The risk of installing malware from unofficial sources or vulnerabilities in modified kernels.

In addition, the official firmware is required for warranty repairs โ€“ Xiaomi service centers refuse to service devices with unlocked bootloader or custom software. Even if you do not plan to carry the phone for repair, the stock version guarantees stable operation of all functions, including branded chips like Always-on Display or Game Turbo.

โš ๏ธ Note: On some models (e.g. Xiaomi) 12T Or the Redmi Note 11 Pro.+) Installation of custom firmware can lead to hardware locking anti-rollback, in which case it will be impossible to return the official software without replacing the motherboard.

Preparation of the device: what to do before the firmware

Before starting to restore the firmware, several critical steps must be taken, and neglecting them can lead to loss of data, or the inability to complete the process.

First, back up all the data, firmware through fastboot or EDL Use Mi Cloud, Google Drive or physical copying on your PC to save:

  • ๐Ÿ“ฑ Contacts, SMS and call log (export through Settings) โ†’ Google โ†’ Backup).
  • ๐Ÿ“ท Photos and videos (check folders) DCIM, Pictures, Downloads).
  • ๐ŸŽต Music and documents (especially files from the MiXplorer folder or other file managers).
  • ๐ŸŽฎ Game savers (use Helium or manual export for games without cloud backup).

Second, check the bootloader model and version, which is critical for choosing the right firmware.

  • In settings: Settings โ†’ The phone. โ†’ Model (e.g. Redmi Note 10 Pro) codenamed sweet).
  • Using fastboot: connect your phone to your PC, run the command fastboot getvar product and record the result.

Also make sure that the bootloader is unlocked on the device, and if not, you will have to go through the unlock procedure through the Mi Unlock Tool (more on this in the next section).

  1. Turn off the phone.
  2. Press Volume Down + Power to enter fastboot.
  3. Connect to the PC and execute the command fastboot oem device-info
  4. If the answer is Device unlocked: true, the bootloader is unlocked.
๐Ÿ“Š What kind of firmware are you using now?
Official MIUI
Custom (LineageOS, Pixel Experience, etc.)
Modified MIUI (xiaomi.eu, MIUIMix)
I don't know.

Unlocking the loader: step-by-step instructions

If your Xiaomi has never been unlocked, you will need the official Mi Unlock Tool. note that the process is tied to your Mi Account โ€“ one account can unlock no more than 3 devices per month. New models (released after 2022) can also have a 72-hour wait timer after linking your account to your device.

Unlocking algorithm:

  1. Link your Mi Account to your phone: Go to Settings โ†’ Mi Account and log in. Enable data sync and confirm the link via SMS. B Settings โ†’ Additionally. โ†’ For developers, activate OEM-unlocking and debugging USB.
  2. Download Mi Unlock Tool: Official page: en.miui.com/unlock (Registration required. Install the program on a Windows PC (on the macOS/Linux It works through emulators).

Launch unlock.

  • Turn off your phone and log in to fastboot (Loudness Down + Power).
  • Connect to your PC and run the Mi Unlock Tool on behalf of the administrator.
  • Sign in with the same Mi Account as you do on your phone.
  • Press Unlock and wait until it is completed (it can take up to 10 minutes).

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

  • ๐Ÿ”Œ Use the other USB-cable (preferably original).
  • ๐Ÿ–ฅ๏ธ Run the program in compatibility mode with Windows 8.
  • โณ Wait 72 hours if the device is new (timer resets after account linking).

โš ๏ธ Note: On models with a Mediatek chipset (e.g. Redmi) 9A or POCO M3) Unlocking via Mi Unlock Tool may not work, and alternative methods (e.g., Mi Unlock Tool) may be required, SP Flash Tool in the BROM-mode).

Linking your Mi Account to your phone|Turn on OEM-unlocking|Download Mi Unlock Tool from the official website|Prepare. USB-cable and PC|Turn off the antivirus (can block the tool)-->

Choosing the right firmware: where to download and which version to choose

Firmware error is the most common reason for hardware to โ€œbrickโ€ devices. Never install firmware from another model, even if the chipsets match! For example, firmware for the Redmi Note 10 Pro (sweet) will not work for the Redmi Note 10 Pro. 5G (Sweetin', the names are similar.

Official firmware for Xiaomi are of three types:

Type of firmwareDescriptionWhere to downloadWho's right for?
Stable (Stable)The official version of MIUI with a minimum number of bugs is updated every 1-2 months.Official websiteFor most users, it is recommended for everyday use.
Developer (Developer)Weekly builds with new features, but possible bugs. Requires manual installation.Xiaomi.eu (informal portal)For enthusiasts who are ready for unstable work.
Fastboot ROMFull image for installation via fastboot, suitable for recovery of bricks.MiuiROM.orgFor forced return to stock firmware.
Recovery ROMUpdate through Recovery. It doesn't erase data, but it requires a working system.Official website (section "Recovery" ROM")Update without losing data.

How to choose the correct version:

  1. Check the code name of your model (e.g., alioth for the model). POCO F3).
  2. Select region: Global for international versions (supports Google Services); China โ€“ without Google, but with maximum optimization. EEA โ€” for Europe (corresponding to) GDPR). India โ€“ for India (may contain local applications).

Android

Android 12

Android 11

anti-rollback

Only download firmware from trusted sources. Avoid torrents and third-party sites, which often contain modified or infected files. Models with Mediatek may require an additional auth file (e.g., Redmi). 9C or POCO C31).

What is an anti-rollback and why is it dangerous?
Anti-rollback is a hardware protection that blocks rollbacks to an older firmware version. MIUI On Android 11, on a device that already ran Android 12, the chipset will block the boot and the phone will turn into a brick. This can only be fixed by replacing the motherboard or through the official Xiaomi service (which often costs like a new phone).

Installation of official firmware through fastboot

The most reliable way to return stock firmware is to use fastboot, which is suitable even for devices that are not turned on or stuck on the logo. MI. You'll need it:

  • ๐Ÿ–ฅ๏ธ Windows PC (or Linux/macOS with fastboot and adb installed).
  • ๐Ÿ”Œ Original. USB-cable (better from the set).
  • ๐Ÿ“ Downloaded Fastboot ROM for your model.
  • ๐Ÿ”ง The Mi Flash Tool (you can download it here).

Step-by-step:

  1. Unpack the firmware: The firmware file is usually.tgz or.zip. Unpack it into a folder without Cyrillic characters (e.g., unpack it in a folder, C:\MIUI\sweet_global). There's gotta be a file inside. flash_all.bat (for Windows or flash_all.sh (for Linux/macOS).
  2. Connect your phone to fastboot: Turn off the device. Press Volume down. + Power before the rabbit appears in the hat-fastboot.

Run the firmware.

  • Open the firmware folder and launch it. flash_all.bat (double-click).
  • Wait until the process is completed (usually takes a lot of time). 5-15 minute).
  • The phone will automatically reboot.

If the process is interrupted with the error "remote: partition table doesn't exist", try:

  • Use the Mi Flash Tool instead of the flash_all.bat.
  • Select the option Clean all in Mi Flash settings (complete cleaning).
  • Repeat the process with another firmware version (for example, a newer one).

For devices with Mediatek (e.g., Redmi 9 or POCO M2) may be required SP Flash Tool:

  1. Download. SP Flash Tool and Mediatek Drivers.
  2. In the tool settings, select Download Only and specify the path to the scatter.txt file from the firmware folder.
  3. Connect the phone turned off (without pressing buttons!) โ€“ the program should detect it.
  4. Press Download and wait until the end (indicator - green circle).

๐Ÿ’ก

If the Mi Flash Tool doesn't see the device, try installing drivers manually through Device Manager. In the list of devices, look for the Android Bootloader Interface and update the driver by specifying the folder with the Mi Flash Tool.

Recovery through EDL-regime (for bricks")

If your Xiaomi doesnโ€™t turn on, doesnโ€™t respond to buttons, or is stuck in fastboot mode, you may need to run through the firmware. EDL-Emergency Download Mode: This is a processor-level technique that allows you to recover a device even if it has a broken firmware, but it requires special hardware and expertise.

What you'll need:

  • ๐Ÿ”ง EDL-cable (or a jumper for closing contacts on the board).
  • ๐Ÿ–ฅ๏ธ Mi Flash Pro or QFil (for Qualcomm).
  • ๐Ÿ“ Firmware in.mbn or.elf format (for Mediatek).
  • ๐Ÿ”‘ Authorization file auth (for new models).

The firmware algorithm through EDL:

  1. Enter in. EDL-Mode: For Qualcomm: Press Volume Up + Volume down and connect the cable to the PC. For Mediatek: it may require disassembling the device and closing the contacts EDL board-board.
  2. Install drivers: Device Manager should have a Qualcomm device HS-USB QDLoader 9008. If the driver is not installed, download it manually (for example, here).

Switch the device.

  • In Mi Flash Pro, select the firmware file (.mbn).
  • Press Refresh โ€“ the program must detect the device in mode EDL.
  • Press Flash and wait until it is completed (it can take up to 30 minutes).

For devices with Mediatek instead of Mi Flash Pro used SP Flash Tool in Firmware Upgrade mode. EDL erases all data, including IMEI After recovery, manual restoration may be required (e.g. via Maui). META for Mediatek or QCN for Qualcomm).

โš ๏ธ Attention: On Xiaomi models 12/13 series K50 firmware EDL Without an authorization file, auth will lock the device, and the file can only be obtained through the official Xiaomi service (cost) ~$20-50).

๐Ÿ’ก

EDL-The mode is the last chance to save a bricked-up device, but it requires technical skills.

Set up the phone after firmware

Once the official firmware is successfully installed, the device will start in initial configuration mode, but there are a few nuances to consider:

1. Re-assignment of the Mi Account:

  • If you have unlocked the bootloader, log in under the same Mi Account you used earlier.
  • Otherwise, some features (such as Find Device) may not work.

Verification IMEI and serial number:

  • Type *#06# - should be displayed IMEI.
  • If you see Null or Invalid instead of a number, you will need to restore (the instructions for Qualcomm and Mediatek are different).

Update to the latest version:

  • Go to Settings โ†’ About the phone โ†’ System update.
  • If an update is available, install it (this will fix possible bugs of the initial firmware).

Data recovery:

  • If you have backup done through Mi Cloud, log in and restore the data.
  • For a local backup, connect the phone to your PC and copy the files manually.

It is also recommended that:

  • ๐Ÿ”’ Turn on OEM-unlocking and debugging USB (If you are planning further experiments with the).
  • ๐Ÿ›ก๏ธ Install antivirus and check the system for malware (for example, through Malwarebytes).
  • ๐Ÿ“ก Check mobile network and Wi-Fi (sometimes manual setup is required) APN).

If after firmware the phone is very warm or discharges quickly, reset to factory settings:

  1. Go to Settings โ†’ Additional โ†’ Recovery and Reset.
  2. Choose to erase all data.
  3. After restarting, set your phone as new.

Frequent mistakes and their solutions

Even with the correct following of the instructions, errors can occur, and let's consider the most common ways to eliminate them:

Mistake.Reason.Decision
remote: device is lockedThe bootloader is not unlocked.Unlock the device through the Mi Unlock Tool.
partition table doesn't existThe section table is damaged.Use the Mi Flash Tool with the Clean All option.
anti-rollback check failTrying to roll back on an older version of Android.Install firmware not lower than the current version of Android.
firehose program failedIncompatible firmware or corrupted files.Download the firmware again and check the checksum (MD5).
The phone does not turn on after the firmwareThe wrong firmware region or model is selected.Repeat the firmware with the correct version or contact the service.

If you see a mistake SLA Auth Error or Mi Account Lock, this means that the device is linked to another Mi Account:

  • ๐Ÿ”‘ Enter the original account details (if the phone is purchased from hand, ask the seller for them).
  • ๐Ÿ“ง Contact Xiaomi with proof of purchase (check, box).
  • ๐Ÿ’ฐ Use paid unlocking services (risky - you can run into scammers).

For errors related to EDL (for example, SAHARA Failure, try it:

  • Use the other EDL-cable USB.
  • Install drivers manually (e.g. LibUSB for Qualcomm).
  • Try another PC (sometimes the problem is in driver conflict).
What if the phone gets stuck on the MI logo after the firmware?
1. Wait. 10-15 Minutes โ€“ sometimes the first load takes a long time. 2. Try to go to Recovery (Loudness Up). + Powering) and making Wipe Data. 3. If it doesnโ€™t work, repeat the firmware via fastboot with the Clean All option. 4. For devices with Mediatek may need firmware through SP Flash Tool with Format All Checkmark + Download.

FAQ: Answers to Frequent Questions

Can I return the official firmware without unlocking the bootloader?
Not if the device already has custom firmware installed. ROM The exception is the Recovery update, but it won't work if the current firmware is heavily modified.
Will the data be lost when you return to the stock firmware?
Yes, firmware via fastboot or EDL It completely erases the internal memory, and the only way to save the data is to back up the data in advance. If the phone doesn't turn on, try extracting the data through the backup. TWRP (if it is installed).
How do I know which firmware is suitable for my model?
Check the device code name through fastboot getvar product or in settings (About phone) โ†’ Version. MIUI). Then download the firmware from the official website, selecting the right region (Global/EEA/China) Android version (not lower than current version!).
What to do if the mobile network does not work after the firmware?
This is a typical problem when installing firmware in the wrong region. IMEI (If you have it, you can type *#06#. If it is missing, restore it. <