How to properly stitch Xiaomi devices: from unlocking to installing custom firmware

Xiaomi’s smartphone firmware is a process that scares many users from the risk of β€œbricking” the device or losing warranty. However, when approached correctly, it’s a safe procedure to get the latest updates, uninstall unnecessary software, or even install alternative firmware like LineageOS. In this guide, we’ll go through all the steps from preparing the device to choosing a firmware method and solving typical bugs.

It is important to understand that the procedure is different for different models. Xiaomi/Redmi/POCO. For example, unlocking the bootloader on Xiaomi 13 The Pro requires other actions than the Redmi Note. 10, a Global installation ROM Fastboot is a very different experience from Recovery. We'll look at the universal steps that are relevant to most devices. 2020–2026 Years, and also point out the key differences for specific lines.

If you've never flashed a smartphone before, don't worry. We've broken it down into simple steps with checklists and alerts. And for experienced users, we'll give you a few more advanced instructions on how to work with it. ADB, EDL-squatting and custom-type recavers TWRP.

1. Preparation of the device for firmware

Before you start firmware, you need to follow several mandatory steps, neglecting them can lead to data loss, locking the device or even the inability to turn it on.

The first and most important thing is to back up, even if you're planning to upgrade over the air" (OTA), There is always a risk of failure. Use the built-in Mi Mover app or third-party utilities like Titanium Backup (requires root:

  • πŸ“± Contacts (export to.vcf)
  • πŸ“Έ Photos and videos (copy to PC or cloud)
  • πŸ“„ Messages (annexes such as: SMS Backup & Restore)
  • πŸ”‘ Wi-Fi passwords (take a photo or write down) QR-code)

Second, check the version. MIUI And the device model. This is critical for choosing the right firmware. Go to Settings. β†’ About the phone and write it down:

  • πŸ“‹ Device model (e.g. Redmi Note 12 Pro)+ 5G)
  • πŸ”’ Version. MIUI (for example, MIUI Global 14.0.5)
  • πŸ”„ Assembly number (e.g, TP1A.220624.014)

Check the device model|Create a backup copy of the data|Write down the version MIUI and assembly number|Charge the battery at least 60 times%|Install Xiaomi drivers on PC-->

Third, charge the battery at least 60 percent. It can take 10 minutes to an hour to run the firmware, and it's almost guaranteed to crash during the process. Also make sure you have a stable Internet connection (if you download the firmware directly to your phone) and an original one. USB-cable (cheap cables often cause errors in data transmission).

πŸ’‘

If you are flashing a device with MediaTek (e.g. Redmi) 10C or POCO M5), download the drivers MTK VCOM Without them, the PC won't recognize the phone in Fastboot mode or EDL.

2 Unlocking the bootloader (Bootloader)

Without unlocking the bootloader, you will not be able to install custom firmware or TWRP. Xiaomi blocks it by default on all devices released after 2017.The unlock process takes between 3 and 360 hours (depending on Xiaomi policy) and requires a Mi Account to be linked.

Here's the step-by-step instruction:

  1. Link your Mi Account to your device: go to Settings β†’ Xiaomi Account and log in.
  2. Activate. OEM Unlock and Debugging by USB: πŸ”“ Settings β†’ The phone. β†’ Version. MIUI (Click 7 times to become a developer) πŸ”§ Back to Settings β†’ Additionally. β†’ For developers πŸ”— Turn it on. OEM Unlock and Debugging by USB
fastboot oem unlock

A warning will appear on the phone screen – confirm the unlock.

Mi Unlock

What happens if you break the unlock?
If you disconnect the phone from your PC or restart it during the fastboot oem unlock process, the bootloader will remain locked, but the unlock counter will reset, and you will have to wait another 3-360 hours before trying again.

Once you successfully unlock it, the Unlocked will appear on the boot screen, and you can now install the unofficial firmware.

⚠️ Warning: Unlocking the bootloader resets all data on the device (including internal memory), and this can cause denial of warranty service in official Xiaomi service centers.

3. Selection of firmware: official vs custom

Before you flash the device, decide on the type of firmware. Each option has pros and cons:

Type of firmwareAdvantagesDeficienciesWho's right for?
Official MIUI (Fastboot/Recovery)Stable work, support OTA-Updates, retaining warranty (unless the bootloader is unlocked)Lots of Bloatware, limited customization, possible regional restrictionsFor beginners who want to upgrade without risks
Global ROMGoogle Services Support, Many Languages, No Chinese AppsIt may contain ads, updates come later than for China ROMUsers outside of China
EU ROM (xiaomi.eu)Advertising-free, weekly updates, optimized performanceNo official support, possible bugs, requires unlocked bootloaderEnthusiasts who are ready for small risks
Castomium (LineageOS, Pixel Experience)Clean Android, long-term support, advanced settingsCamera/sensors may not work, no Widevine L1 (No Netflix in the world HD)Advanced users

For most users, Xiaomi is the best choice – the official Global ROM The first is suitable for those who do not want to lose the warranty, the second is for those who are willing to sacrifice official support for the lack of advertising and more frequent updates.

Where to download firmware:

  • 🌍 Official: en.miui.com (choose Fastboot or Recovery)
  • πŸ‡ͺπŸ‡Ί Xiaomi.eu: Xiaomi.eu (weekly and stable builds)
  • πŸ› οΈ Castomy: XDA Developers (Search for themes for your model)

Official. MIUI Global|Xiaomi.eu (without advertising)|LineageOS (Pixel Experience)|Another (I will write in the comments)-->

Note the firmware version of Android. For example, Redmi Note 11 officially supports Android 13, but custom firmware may offer Android 14. However, newer OS versions don’t always mean better performance β€” sometimes they bring bugs with camera drivers or modules. NFC.

4. Firmware methods: Fastboot, Recovery and OTA

The way you run your firmware depends on the type of firmware and your goals. Let's look at three basic methods:

Firmware via Fastboot (for official and custom firmware)

This is the most reliable way, but it completely erases data from the device.

  • πŸ“± Installation of official firmware from scratch
  • πŸ”„ Brick reconstruction"
  • πŸ› οΈ Installation of custom firmware (if supported)

Instructions:

  1. Download the Fastboot firmware (a file with the.tgz or.zip extension) and unpack it into a folder.
  2. Connect your phone to your PC in Fastboot mode (press Power) + Vol- with the device switched off).
  3. Launch the script: For Windows: flash_all.bat For Linux/macOS:./flash_all.sh

Wait until the end (usually 5-15 minutes).

πŸ’‘

If the script flash_all.bat It makes an error, try to start it. flash_all_except_storage.bat β€” It saves user data (but it is risky and can cause crashes).

Firmware through Recovery (without data loss)

This method is suitable for updating within one version. MIUI (for example, MIUI 14.0.3 by 14.0.5) It stores user data but does not work for transitions between major versions (e.g., with MIUI 13 on MIUI 14).

How to stitch:

  1. Download the firmware for Recovery (.zip file).
  2. Rename it to update.zip and put it in the root of your internal memory.
  3. Go to Recovery (press Power + Vol+ when the phone is off).
  4. Select Install update.zip and confirm the installation.

To launch OTA-update:

  1. Go to Settings β†’ About the phone β†’ System update.
  2. Click Check for updates.
  3. If the update is available, download and install it.

πŸ’‘

Fastboot firmware is the most reliable method for solving system problems, but it erases all data. OTA Keep files, but not suitable for all cases.

5. Installation of custom Recovery (TWRP)

If you plan to install informal firmware or modified cores, you will need to TWRP (Team Win Recovery Project. It's an alternative Recovery that allows you to:

  • πŸ“¦ Install ZIP-firmware
  • πŸ”„ Make full backups (including data and boot)
  • πŸ”§ Edit system files

How to install TWRP:

  1. Download the image TWRP for your model with twrp.me (.img file).
  2. Move it to the folder from fastboot to PC.
  3. Connect your phone in Fastboot mode and execute the command: fastboot flash recovery twrp-3.7.0_12-0-redminote12proplus.img (Replace the file name with yours)
  4. Immediately after installation, restart in TWRP Team: fastboot boot twrp-3.7.0_12-0-redminote12proplus.img That'll prevent replacement. TWRP on the stock Recovery at the first load.

V TWRP You can:

  • πŸ“ Make a backup of the current firmware (Backup) β†’ Select Partitions)
  • πŸ“₯ Install ZIP-firmware (Install) β†’ Select ZIP)
  • 🧹 Clear cache and Dalvik (Wipe) β†’ Advanced Wipe)

⚠️ Note: Some Xiaomi models (e.g. Xiaomi) 12T or Redmi K50) installation TWRP It can cause data loss due to encryption FBE. Before installing, be sure to make a backup or decrypt. /data.

6. Solving typical firmware errors

Even with strict adherence to instructions, errors can occur, and here are the most common ways to solve them:

Mistake.Reason.Decision
Fastboot: error: failed to load/commandIncorrect drivers, damaged cable or port USBTry another cable/port, install Mi Flash Tool drivers
This package is for "tapas" devices; this is a "alioth".The firmware is not suitable for your model.Check the device codename (fastboot getvar product) and download the correct firmware
E: Footer is wrong (in Recovery)Damaged. ZIP-firmwareDownload the firmware, check the MD5 checksum
The phone does not turn on after firmware ("brick")Incompatible firmware or interrupted processSweat through the Fastboot official firmware or use EDL-regime
Anti-rollback check failReversed to an older version of MIUIJust try the new version or the one that was originally

If the device has turned into a β€œbrick” (does not turn on, does not respond to buttons), try the following steps:

  1. Connect your phone to your PC and check if it is identified in Device Manager as Qualcomm HS-USB QDLoader 9008 (for Snapdragon) or MTK Preloader (for MediaTek).
  2. If yes, use the Mi Flash Tool in mode. EDL (Requires an authorized Xiaomi account).
  3. If not, check the cable, port and port. USB Try charging the device for 10-15 minutes.
What if the Mi Flash Tool can’t see the device?
1. Install Qualcomm QDLoader drivers manually through Device Manager. 2. Use the original Xiaomi cable (cheap cables don’t transfer data to the same device) EDL). 3. Try another PC with Windows 10/11 (on Linux/macOS EDL doesn't work). 4. If the device is new (2023–2026 You may need to log in through Mi Account with unlocked status.

7. Firmware of devices with a MediaTek processor (MTK)

Devices on MediaTek (e.g. Redmi) 10A, POCO C40) They're stitched differently than they are on Qualcomm Snapdragon:

  • πŸ”§ To work with Fastboot need drivers MTK VCOM.
  • 🚫 No official support EDL-The system (instead of being used) BROM).
  • ⚠️ High risk of β€œbrick” with incorrect firmware preloader.

Instructions for MediaTek:

  1. Download the firmware in format SP Flash Tool (.zip file with image folder).
  2. Install. SP Flash Tool and Drivers MTK VCOM.
  3. Launch it. SP Flash Tool, download the scatter file from the firmware folder.
  4. Connect the device to the PC (without buttons!).
  5. Press Download and wait until it is completed (usually 5-10 minutes).

⚠️ Warning: Never flash preloader on MediaTek devices unless you are sure of compatibility! this can permanently knock your phone out (even a service center won't be able to restore it).

To restore the brick to MTK use:

  • πŸ”§ SP Flash Tool: Firmware Upgrade (not Format All) + Download!).
  • πŸ› οΈ Utility. MTK Bypass (if the device is not detected).

8.After Firmware: First Steps and Optimization

After successful firmware, follow a few steps to ensure that the device is stable:

  1. Reset to factory settings (recommended even after) OTA-update): πŸ”„ Go to Settings. β†’ Additionally. β†’ Recovery and discharge. 🧹 Select Reset (does not delete files on the memory card).
  2. Verification of updates: πŸ” Go to Settings. β†’ The phone. β†’ Updating the system. πŸ“₯ If a new update is available, install it (sometimes 2-3 firmware reflashes are required for stable operation).
  3. Disconnection of unnecessary services: 🚫 Turn off Miui Analytics in Settings β†’ Confidentiality. πŸ“΅ Limit background activity for Mi Browser, Mi Video and other system applications.

Checking of operability:

  • πŸ“ž Test calls, mobile internet, Wi-Fi, Bluetooth.
  • πŸ“Έ Check the camera (especially on custom firmware).
  • πŸ”‹ Watch for battery heat and discharge in the first hours.

If there are problems after the firmware:

  • πŸ”‹ Fast battery discharge: Perform 2-3 full charge/discharge cycles.
  • πŸ“Ά Network problems: re-flash the modem module separately (search files) NON-HLOS.bin for your model).
  • 🎡 No sound: check the Device Manager settings in Windows (sometimes you need to reinstall the driver). ADB).

πŸ’‘

After custom-made firmware ROM (For example, LineageOS, be sure to install GApps (Google Apps) and Magisk (root) if you need them. Without them, Google services and many apps will not work.

FAQ: Frequent questions about Xiaomi firmware

Can I use Xiaomi without unlocking the bootloader?
Yes, but only official updates through Recovery or OTA. For custom firmware installation (Xiaomi.eu, LineageOS) or TWRP unlocking is mandatory.
How to check if the bootloader is unlocked?
Turn off your phone and press the power. + Vol- to log into Fastboot. If you have Unlocked at the top of the screen (usually red or orange), the bootloader is unlocked. If there is no sign or Locked, it is blocked.
Why is the camera or fingerprint sensor not working after the firmware?
This is a typical problem when installing custom firmware or firmware for another model: πŸ” Check that the firmware is specifically for your device (check the code name). πŸ“₯ Set a separate patch for the camera (search for the camera) XDA Developers or 4PDA). πŸ”„ Return to the stock firmware via Fastboot.
How to return the official firmware after custom?
Download the Fastboot firmware for your model from the official Xiaomi website and run it through the Mi Flash Tool: Unpack the firmware into a folder. Connect your phone in Fastboot mode. In the Mi Flash Tool, select the firmware folder and press Refresh β†’ Flash. Select Clean All mode (erase everything, including internal memory!) After the firmware is installed, the device will return to a drain state, but the bootloader will remain unlocked.
Can I use Xiaomi on a Mac or Linux computer?
Yes, but with reservations: 🐧 Linux will require fastboot and adb to be installed via a package manager. 🍎 Macs need drivers for Xiaomi (e.g., HoRNDIS for Macs) USB-network). ⚠️ Mi Flash Tool and SP Flash Tool officially supports only Windows. For alternative OSes, use fastboot manually.