How to flash Xiaomi Redmi 4X through MiFlash: a complete guide to error solutions

Xiaomi Redmi 4X firmware via MiFlash is one of the most reliable ways to bring a smartphone back to life if it stops loading, slows down or requires an upgrade to the current version of MIUI. This method is suitable for both restoring bricks and installing custom firmware after unlocking the bootloader. However, the process has nuances, from choosing the right version of the Fastboot firmware to working with drivers and EDL mode.

Unlike the Recovery update, the firmware through MiFlash completely overwrites the system partition, which guarantees a clean installation without traces of the previous software. An error at any stage can lead to the inability to recover without service equipment, especially if we are talking about models with a locked bootloader. In this article, we will discuss the entire process from A to Z, including driver preparation, unlocking Bootloader and solving typical errors such as: flash_all_lock.bat or anti-rollback.

1. Firmware Preparation: What to Do Before Starting

Before you connect the Redmi 4X to your computer, make sure all the preliminary steps are followed. Neglect of preparation is the main reason for the "bricking" of devices.

First, check the bootloader version of your smartphone. To do this, go to Settings β†’ About Phone β†’ MIUI Version and tap 7 times on the kernel version bar to activate the hidden menu. In it, select Hardware info and find Bootloader. If Locked status, the firmware through MiFlash is only possible after official unlocking through the Mi Unlock Tool.

  • πŸ”‹ Battery charge at least 60 percent. Fastboot runs a lot of power, and a sudden shutdown will cause a crash.
  • πŸ’» Computer on Windows 7/10/11 (64-bit On macOS or Linux, MiFlash does not work consistently.
  • πŸ”Œ Original. USB-Cheap cables often don't transmit data in Fastboot mode.
  • πŸ“₯ Backup data. MiFlash firmware erases everything, including photos and contacts.

Pay special attention to drivers. Xiaomi requires the installation of Mi USB Driver and Qualcomm HS-USB QDLoader 9008 (for EDL mode). Without them, the computer will not recognize the device in firmware mode. You can download drivers from the official Xiaomi website or through the Mi Developer Portal.

πŸ“Š What kind of firmware you used before?
Through Recovery.
Through Fastboot (MiFlash)
Through Custom Recovery (TWRP)
Never stitched.

2. Select firmware: which version of MIUI to download for Redmi 4X

Redmi 4X (codenamed santoni) supports several types of firmware, and choosing the wrong version can lead to an anti-rollback error or total loss of functionality.

  • πŸ“Œ Stable. MIUI β€” official firmware with minimal bugs, suitable for everyday use.
  • πŸ§ͺ Developer (weekly) – test builds with new features, but errors are possible.
  • πŸ”“ Global vs China. For Russian users, it is better to choose Global (support for Google services). China requires manual installation of GApps.
  • πŸ”’ Fastboot vs Recovery. MiFlash requires a Fastboot version (a file with the.tgz or.zip extension that contains scripts). flash_all.bat).

You should download firmware only from official sources:

  1. The official MIUI website (select the Redmi 4X section).
  2. Xiaomi Firmware Updater (alternative source with archive of old versions)
Type of firmwareDownload linkFeatures
MIUI Global StableOfficial websiteSupport for Google services, updates every 1-2 months
MIUI China StableOfficial websiteWithout Google services, updates are more common than in the Global
MIUI DeveloperXiaomi Firmware UpdaterWeekly updates, possible bugs
Custom firmwareXDA DevelopersRequires an unlocked bootloader and TWRP

⚠️ Note: If your device was purchased in China and previously operated on China ROM, firmware Global ROM It may lead to problems with IMEI In this case, install China Stable first, and then switch to Global via fastboot.

πŸ’‘

Before downloading the firmware, check the version on MIUI Anti-Rollback. Installing an older version than the current one will lock the device!

3. Unlocking the bootloader: a mandatory step before the firmware

If your Redmi 4X has a locked bootloader (which is typical for most devices purchased officially), you can’t flash it through MiFlash without first unlocking. Xiaomi requires confirmation of your Mi Account account and waiting 72-360 hours after you peg the device.

The unlocking process:

  1. Link Mi Account to your device: Settings β†’ Mi Account β†’ Add an account.
  2. Activate USB debugging and OEM unlocking: Settings β†’ About Phone β†’ MIUI version (shoot 7 times), then Additional β†’ For Developers.
  3. Download Mi Unlock Tool and log in to the program.
  4. Transfer the phone to Fastboot mode (press Power + Volume Reduction) and connect to the PC.
  5. In Mi Unlock Tool, press Unlock and wait until it is completed (it may take several attempts).

⚠️ Note: After unlocking the bootloader, all data will be reset, and the warranty (if any) will be canceled.

What if the Mi Unlock Tool gives you a "Couldn't unlock" error?
This error often occurs due to: - Unbound Mi Account to the device (check in account settings). - Too old version of Mi Unlock Tool (download the latest from the official website). - Insufficient latency (wait 72-360 hours after binding). - Problems with drivers (reinstall Mi USB Driver manually through Device Manager).

4. Installation of MiFlash and drivers: step-by-step instructions

To run the Redmi 4X through MiFlash, you will need:

  1. Download MiFlash latest version (at the time of 2026, the current MiFlash20200314).
  2. Install Mi USB Driver (included in the MiFlash or downloaded separately).
  3. Install the Qualcomm HS-USB QDLoader 9008 driver for EDL mode (if you plan to stitch through it).

After installing MiFlash:

  1. Unpack the downloaded firmware (.tgz or.zip) into a folder without Cyrillic characters (for example, C:\MIUI\santoni_global).
  2. Run MiFlash on behalf of the administrator.
  3. Click Select and point the way to the firmware folder.
  4. In the drop-down menu, select the firmware mode: clean_all β€” complete cleaning (recommended for changing the firmware region). clean_all_lock β€” cleaning + Loader lock (only for official firmware!). save_user_data β€” User data storage (not always stable).

⚠️ Note: If you are flashing custom firmware (e.g. Pixel Experience), never use it. clean_all_lock β€” This will block the bootloader and make the device inoperable without EDL-firmware.

β˜‘οΈ Preparing MiFlash for work

Done: 0 / 5

5.The firmware process: from Fastboot to successful download

When everything is ready, we start to work on the firmware:

  1. Fastboot: Turn off your phone. Shut down Power + Volume down for 10 seconds. Connect to your PC, and you'll see a hare in a Fastboot hat.
  2. MiFlash Connection: In MiFlash, Press Refresh – Devices should appear in the list COM-If the device is not identified, check the drivers or try another one. USB-port (preferably) USB 2.0).

Firmware launch:

  • Press Flash and wait until it is completed (usually 5-10 minutes).
  • At the end of the log, Flash Done will appear, and the phone will automatically restart.

If the firmware is hanging on Waiting for device:

  • πŸ”„ Reconnect. USB-cable.
  • πŸ–₯️ Try another one. USB-port (better on the back of the PC).
  • πŸ”§ Reinstall drivers manually through Device Manager.
  • πŸ“± Put the phone in mode. EDL (see next section).

⚠️ Note: If after firmware the phone is stuck on the logo MI longer than 15 minutes, this is a sign of firmware incompatibility or an anti-rollback error. EDL Using Mi Flash Pro or QFil.

πŸ’‘

Always check the firmware of the device model (santoni) and its version (e.g. V12.5.1.0). Installing the firmware from Redmi 4/4A will lead to the brood!

6. Firmware through EDL: if the Fastboot doesn't work

EDL (Emergency Download Mode) is the last chance to bring the Redmi 4X back to life if it is not detected in Fastboot or the firmware through MiFlash ends in error.

  • πŸ”Œ Testpoint (closing contacts on the board) or Deep Flash Cable (special cable with resistor).
  • πŸ’» Mi Flash Pro or QFil (for firmware via Qualcomm).
  • πŸ“„ Firmware in.mbn or firehose format (can be found on Xiaomi Firmware Updater).

Instructions for EDL:

  1. Turn off the phone.
  2. Close the testpoint (contacts under the back cover, next to the battery) or use the Deep Flash Cable.
  3. Connect your phone to your PC – Qualcomm HS-USB QDLoader 9008 should appear in Device Manager.
  4. In Mi Flash Pro, select firmware and press Flash.

⚠️ Attention: Firmware through EDL If you don't have a testpoint or a cable, you can completely fail your device.

7.Typical errors and their solutions

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

Mistake.Reason.Decision
flash_all_lock.bat failedAttempt to block the loader on the custom firmwareUse it. clean_all instead clean_all_lock
anti-rollback check failTrying to install an older version of MIUISwitch a newer firmware or the same version
Waiting for deviceDrivers not installed or USB-port is notReinstall drivers, try another port/cable
Invalid sparse file format at headerFirmware file damagedDownload the firmware again and check the checksum
The phone does not turn on after the firmwareIncompatible firmware or anti-rollback errorSweep through the EDL official firmware

If none of these methods worked, try:

  • πŸ”„ Switch another version MIUI (For example, from China to Global).
  • πŸ”§ Use Mi Flash Pro instead of the standard MiFlash.
  • πŸ“± Contact the Xiaomi service center (if the device is guaranteed).

FAQ: Frequent questions about Redmi firmware 4X

Can I flash Redmi 4X without unlocking the bootloader?
No, if the bootloader is locked, firmware via MiFlash is only possible after official unlocking via Mi Unlock Tool.Exception is firmware via EDL using an authorized Xiaomi account (available only to service centers).
What to do if there is no network after the firmware (IMEI missing?summary?> This is a typical problem with Global Firmware. ROM Devices that originally worked in China ROM. Solution: Sweat back China Stable. Restore. IMEI through SN Write Tool (requires) EDL-mode and authorized account. Contact the service center to flash the module NVRAM.
How to return the official firmware after custom?
For a return to stock. MIUI: Download Global Stable Fastboot Firmware for Redmi 4X. Unpack it and delete the file in the folder. flash_all_lock.bat (In MiFlash, select the mode. clean_all. Sweep through the device. After restart, reset via Recovery (Wipe Data). ⚠️ If the bootloader has been unlocked, it will remain unlocked even after returning to the official firmware.
How long does it take to get through MiFlash?
Time depends on the regime: clean_all: 5–10 minute. clean_all_lock: before 15 minutes (due to additional checks). EDL: 10–20 minutes (depending on speed) USB-If the process takes longer 30 interrupt it and check the drivers/cable.
Can I flash Redmi 4X on Android 10 or later?
Officially, Redmi 4X (santoni) only supports Android 7.1.2 (MIUI 12.5 is the latest stable version), but there are custom firmware based on Android 10/11, such as LineageOS 17.1 (Android 10), Pixel Experience (Android 11), which will require an unlocked bootloader and TWRP Recovery to install.