Xiaomi firmware via TGZ: full instruction with unlocking the bootloader

Xiaomi Smartphone Firmware Through TGZ-A file is one of the most reliable ways to update or restore a system when standard methods (via Settings) are used. β†’ About phone doesn't work. This is a method for power users who want to install official or custom firmware with full control over the process (OTA), Fastboot firmware avoids errors related to damaged partitions or version incompatibility.

But the process requires care: wrong actions can turn your Redmi, POCO, or Mi into a brick. In this article, we’ll take you through the steps from preparation to final installation, and we’ll also explain how to avoid common mistakes. If you’re a beginner, we recommend that you first learn the basics of working with ADB and Fastboot.

What is it? TGZ-firmware and when it is needed

TGZ-A firmware is an archive with a system image packaged in.tgz (or.tar.gz) format. OTA-With updates that are installed on top of the existing system, Fastboot firmware rewrites all partitions of the device, including boot, recovery and system. This makes it indispensable in several cases:

  • πŸ”„ Downgraid version MIUI β€” If the new firmware is unstable, and the rollback is OTA blocked.
  • πŸ› οΈ Recovery after a crash – when the device does not boot or hovers on the Mi logo.
  • πŸ”“ Installation of global firmware on the Chinese model (for example, from Mi 11 to Mi 11 Global).
  • πŸš€ Unlock additional features – some firmware modifications (e.g. Xiaomi.EU) add features not available in official builds.

It is important to understand that the firmware via Fastboot erases all data on the device, including photos, messages and installed applications.

⚠️ Note: Fastboot firmware requires an unlocked bootloader.If you haven't done this procedure before, the device will refuse to accept commands. Unlocking bootloader on Xiaomi is officially supported, but takes up to 7 days (due to checking your Mi Account).

Preparation for firmware: what will be needed

Before you start the firmware, gather everything you need. Here's the full list:

  • πŸ“± Xiaomi smartphone with a battery charge of at least 60% (better than 100%).
  • πŸ’» Computer running Windows 10/11, macOS or Linux (for macOS or Linux) Mac/Linux Additional drivers will be required).

Pay special attention to the choice of firmware. The official Fastboot firmware for Xiaomi can be downloaded on the sites:

  • Official MIUI portal (select the Fastboot version for your model).
  • Xiaomi Firmware Updater (alternative source with firmware archive).

⚠️ Warning: Never use firmware from unknown sources! Fake.tgz files may contain malware or be collected with errors, which will cause the device to fail.

πŸ“Š What Xiaomi model are you using?
Redmi Note 10/11/12
POCO F3/F4/F5
Mi 11/12/13
Another model

Unlocking the bootloader: a mandatory step

Without an unlocked bootloader, it is impossible to flash the device through Fastboot. Xiaomi blocks the bootloader on all devices by default, and unlocking it requires binding the Mi Account and waiting for confirmation (usually 3-7 days).

The unlocking process:

  1. Link your Mi Account to your device in the settings (Settings β†’ Mi Account).
  2. Include OEM Unlock in the developer menu (Settings β†’ About phone β†’ Tap MIUI version 7 times β†’ Developer options β†’ OEM Unlocking).
  3. Download the Mi Unlock Tool and run it on PC.
  4. Connect your phone in Fastboot mode (press Power + Vol Down when the device is off).
  5. If you receive a message about the need to wait, wait for SMS or push notification from Xiaomi.

Once you successfully unlock, you'll see Unlocked at the bottom of the Fastboot screen, and you can start with the firmware.

What if the Mi Unlock Tool can’t see the device?
1. Make sure Qualcomm drivers are installed (you can download here). 2. Try another one. USB-port USB Disable the antivirus - it can block the work of the Mi Unlock Tool. 4. Reinstall the program from the official website, avoiding "modified" versions.

Step-by-step: Firmware via Mi Flash Tool

When the bootloader is unlocked and the firmware is downloaded, you can start installing it. We will use the Mi Flash Tool, the official tool from Xiaomi for firmware through Fastboot.

Loader unlocked|The right firmware downloaded TGZ|Drivers installed ADB/Fastboot|Battery charge > 60%|Data backup made.

-->

Step 1 Installation of the Mi Flash Tool

  1. Download the Mi Flash Tool (Windows version).
  2. Unpack the archive and launch XiaoMiFlash.exe on behalf of the administrator.
  3. Install drivers if the program offers to do so.

Step 2: Preparation of firmware

  1. Unpack the downloaded.tgz archive in a folder (for example, C:\miui_ROM).
  2. Inside should appear folder with firmware files (for example, images with extensions.img).

Step 3: Firmware of the device

  1. Turn off your smartphone and turn it into Fastboot mode (press Power + Vol Down).
  2. Connect the device to the PC.
  3. In the Mi Flash Tool, click Select and specify the path to the unpacked firmware.
  4. At the bottom of the window, select firmware mode: Clean all – complete cleaning (recommended for changing the version of MIUI), Clean all and lock – cleaning + lock the bootloader (use if you want to return the official status), Save user data – data retention (not always working correctly!).

Flash

5-15 minutes

Once the firmware is successful, the device will automatically restart. The first run can take up to 10 minutes - don't interrupt the process!

1. Reconnect. USB-cable.

2. to run the program on behalf of the administrator.

3. Install drivers manually through Device Manager (select Android Bootloader Interface).

-->

Common mistakes and their solutions

Even with the correct following of the instructions, errors can occur, and we have collected the most common problems and ways to fix them:

Mistake.Reason.Decision
Invalid image formatA damaged or incomplete firmware archive.Download the firmware again and check the checksum (MD5).
Device not foundThe PC does not recognize the device in Fastboot mode.Check the cable, the USB port, the drivers. Try another computer.
Flash not done (error: 0x80070002)Incompatibility of the Mi Flash Tool and the firmware versionUpdate the Mi Flash Tool or use an older version.
The device hung on the Mi logoIncorrectly selected firmware mode or damaged boot.img.Repeat the firmware with a full clean (Clean all).

If the device does not turn on after firmware or gives a DM-Verity error, try:

  • πŸ”„ Re-switch with Clean All and Lock.
  • πŸ“₯ Install a different firmware version (for example, an older one).
  • πŸ› οΈ Use it. EDL-Mode (requires an authorized Xiaomi account).

πŸ’‘

If the firmware is interrupted in the middle, DO NOT DISTRIBUTE the device! Wait 10-15 minutes, sometimes it continues in the background. If nothing happens after that time, reconnect the phone and start again.

Fastboot Firmware Manually (without Mi Flash Tool)

If the Mi Flash Tool doesn’t work or you prefer more control, you can manually flash the device through the Fastboot using commands in the terminal.This method requires knowledge of the basics of ADB/Fastboot, but allows you to manage the process flexibly.

Step 1: Preparation

  1. Unpack the firmware.tgz in the folder (for example, C:\fastboot_rom).
  2. Open the Command Prompt (CMD) or PowerShell in this folder.
  3. Connect the device in Fastboot mode.

Step 2. Check the connection

Enter the command:

fastboot devices

If the device appears in the list, you can continue.

Step 3: Firmware by section

Use commands of the type:

fastboot flash boot boot.img


fastboot flash system system.img




fastboot flash vendor vendor.img




fastboot flash dtbo dtbo.img

For convenience, you can use the script. flash_all.bat (If it's in the firmware archive).

Step 4: Cleaning and restarting

After the firmware, do:

fastboot erase userdata


fastboot erase cache




fastboot reboot

⚠️ Note: With manual firmware, it is easy to skip critical partitions (e.g. modem or bluetooth). Always check the file list in the firmware and the documentation for your model!

Firmware custom ROM (Xiaomi.EU, LineageOS)

If the official firmware doesn’t suit you, you can install custom, for example, Xiaomi.EU (an optimized version of MIUI without Chinese restrictions) or LineageOS (pure Android), the process is similar to firmware through Fastboot, but has nuances:

  • πŸ”“ Requires an unlocked bootloader (as well as for official firmware).
  • πŸ“Œ You need to install custom recovery (for example, TWRP) for firmware via zip file.
  • ⚠️ The risk of loss of warranty – custom firmware is not officially supported.

Instructions for Xiaomi.EU:

  1. Download the firmware from the site Xiaomi.EU (choose the version for your model!).
  2. Unpack the archive and follow the instructions (usually you need to flash through TWRP or Fastboot).
  3. For TWRP: Install TWRP Recovery via Fastboot: fastboot flash recovery twrp.img Download to TWRP (Power + Vol Up) and run a.zip file.

After installing custom firmware, additional configuration may be required (for example, installing GApps for LineageOS).

What to do after the firmware

Successful firmware is only half the battle, so to keep the device running smoothly, follow a few steps:

  • βš™οΈ System setting: Go through the initial setup MIUI (Choose a language, connect to Wi-Fi. Update all apps through Google Play.
  • πŸ”„ Check for updates: Go to Settings β†’ About phone β†’ System update and install the latest security patches.
  • πŸ“± Data recovery: If you’ve backed up with Mi Cloud or Google Account, restore contacts, photos, and notes.
  • πŸ”’ Security: Enable Find My Device and set a strong password.

If there are bugs after firmware (for example, the camera or mobile network does not work), try:

  • πŸ”„ Refuse the device with full cleaning (Clean all).
  • πŸ“₯ Install a different firmware version (e.g., older or newer).
  • πŸ› οΈ Reset the settings to factory (Settings) β†’ About phone β†’ Factory reset).

πŸ’‘

Once you have been firmwareed through Fastboot, the bootloader remains unlocked. If you want to return to official status (for example, for warranty repairs), swipe the device with the Clean all and lock option in the Mi Flash Tool.

FAQ: Frequent questions about Xiaomi’s firmware through TGZ

❓ Can I flash Xiaomi without unlocking the bootloader?
No, Fastboot firmware (including.tgz files) requires an unlocked bootloader.The only exception is an update via OTA or Recovery, but these methods don't offer the kind of features that Fastboot does.
❓ How to check if the bootloader is unlocked?
Turn off the device and press Power + Vol Down to enter the Fastboot. If the bottom of the screen says Unlocked, the bootloader is unlocked. If Locked, you need to unlock.
❓ Which firmware to choose: Stable or Developer?
Stable is the official stable version, recommended for everyday use. Developer is a test version with new features but possible bugs. Suitable for enthusiasts. For most users, Stable is the optimal choice.
❓ Can I roll back the firmware to an older version?
Yes, but with reservations: To roll back the older version of MIUI via Fastboot, unlocking the bootloader is mandatory. Some models (e.g. Xiaomi 12/13) have Anti-Rollback protection, which blocks rollback on versions older than a certain date. In this case, the device can turn into a "brick." Always check the Anti-Rollback information for your model before rolling back!
❓ Why the Mi Flash Tool can't see my device?
The reasons may be as follows: Qualcomm drivers are not installed or ADB. It's not original. USB-The device is not in Fastboot mode (check button combinations). Antivirus blocks the Mi Flash Tool. Try connecting the phone to another port or computer.