Xiaomi Mi Flash Tool: Fastboot ROM Flashing Guide (HyperOS & MIUI)
Step-by-step stock firmware flashing guide for Xiaomi, Redmi, and POCO devices using Mi Flash Tool. Learn how to flash official Fastboot packages safely across HyperOS and MIUI, handle dynamic partitions in fastbootd, and fix bootloops without bricking.
Pre-Flight Checklist
Complete ALL items before proceeding. Skipping any step increases the risk of bricking your device.
Guide Steps
Download and extract official Mi Flash Tool (version 20200314 or newer) to a simple directory path without spaces or special symbols, such as C:\XiaomiFlash\.
Modern HyperOS and MIUI builds write multi-gigabyte dynamic super partition blocks that require updated 64-bit fastboot binaries. If using an existing Mi Flash installation, copy the latest fastboot.exe and AdbWinApi.dll from Google's official Android SDK Platform-Tools into C:\XiaomiFlash\Source\ThirdParty\Google\Android\ to avoid sparse chunk timeouts.
Download the verified Fastboot TGZ package for your exact phone codename from AndroidFirmwareFile.com. Modern HyperOS and MIUI Fastboot packages range from 6 GB to 10 GB+ in compressed size.
Fastboot packages are compressed twice (.tgz is a tar.gz archive). Standard Windows zip utilities cannot unpack them properly. Use 7-Zip to decompress:
- Right-click the
.tgzfile β 7-Zip β Extract Here (this extracts a.tararchive). - Right-click the resulting
.tarfile β 7-Zip β Extract to [folder name].
Confirm that the final extracted directory contains the following file structure:
images/β Directory containing boot.img, super.img chunks, vendor_boot.img, and modem binariesflash_all.batβ Standard script that flashes full factory firmware and keeps bootloader unlocked (Recommended)flash_all_except_storage.batβ Script that attempts to retain user data (Not recommended across major updates)flash_all_lock.batβ Script that flashes and locks the bootloader (Hazardous on cross-region software)
C:\MiROM\pearl\. Do not use paths containing spaces, accents, or non-English characters, or Mi Flash will report "cannot find flash_all.bat".Power off your device completely. Wait 5 seconds to ensure internal storage has stopped writing, then enter Fastboot Mode:
- Press and hold Volume Down + Power simultaneously for 5 to 8 seconds.
- Release both buttons immediately when the screen displays the orange FASTBOOT graphic (older MIUI models show the classic cartoon mascot).
Connect the phone to your Windows PC using a high-quality USB-C data cable plugged directly into a rear motherboard USB 2.0 port.
adb reboot bootloader.
Right-click XiaoMiFlash.exe and select Run as administrator.
Click the Refresh button at the top right. Mi Flash Tool will query connected USB devices. Your phone's alphanumeric serial number will populate in the device list along with an active progress row.
If the device list remains blank:
- Open Device Manager (Win + X β Device Manager) and verify that Android Bootloader Interface appears without a yellow exclamation mark.
- If listed as "Android" under Other Devices, right-click β Update driver β Browse my computer β point to your Google USB driver directory.
- Switch to an alternative USB port, avoiding front panel chassis connectors and external hubs.
Click the Select button (folder icon) at the top left of Mi Flash Tool.
Browse to and select the root folder where you extracted the firmware. This is the parent directory that contains flash_all.bat and the images/ folder.
images/ subfolder itself. You must select the outer parent folder. If you choose the images/ folder, Mi Flash will fail with the error "Script missing: cannot find flash_all.bat".Look at the bottom right corner of the Mi Flash window. You will see three flashing mode radio options:
clean all(Runs flash_all.bat) β Flashes all factory partitions and leaves the bootloader UNLOCKED. STRONGLY RECOMMENDED FOR ALL USERS. This is the safest method to repair bootloops, unbrick devices, or install factory updates.save user data(Runs flash_all_except_storage.bat) β Flashes system partitions while attempting to retain personal files. Only usable for minor maintenance releases within the identical regional branch. Frequently causes encryption bootloops across major Android or HyperOS upgrades.clean all and lock(Runs flash_all_lock.bat) β Flashes the firmware and RELOCKS the bootloader.
Click the Flash button at the top right to start partition writing. The status column will display active partition targets (boot, dtbo, modem, etc.) and the progress bar will advance.
On modern Xiaomi, Redmi, and POCO handsets running Android 11 through Android 15, notice the following normal behaviors:
- Automatic fastbootd Transition: To flash the multi-gigabyte dynamic super partition (system, product, vendor, odm), the script automatically transitions the handset into userspace fastbootd mode. The phone display may change to a FastbootD menu, and Windows may sound a USB reconnection chime.
- Super Partition Transfer Duration: The super partition image is split into several large chunks (e.g. super.img.0, super.img.1). Writing these blocks takes several minutes, especially on devices with eMMC 5.1 storage. Do not unplug the cable if the progress bar stays on super blocks.
When flashing finishes successfully:
- The status column displays "Flash done" or "success".
- The progress bar turns solid green.
- Your device will automatically reboot into the system.
If the tool reports "success" but the phone remains in fastboot mode after 60 seconds, unplug the cable and hold the Power button for 10 seconds to initiate boot.
First Boot Time: Initial boot into HyperOS or MIUI takes 5 to 15 minutes while the OS initializes user space encryption and rebuilds application caches. Once the setup wizard appears, follow the on-screen prompts to connect to Wi-Fi and configure your handset.
Congratulations! Flash Successful!
You've successfully completed all steps. Your device should now be running the new firmware. If it's booting normally β you're done! Check the troubleshooting section below if you encounter any issues.
Troubleshooting & FAQ
Common errors and their solutions. Read this before asking for help.
This error occurs when Mi Flash cannot locate the batch execution script in the folder path. The three most common causes are:
- Selecting the images/ subfolder: Always select the outer parent folder that holds flash_all.bat and the images/ directory, not images/ itself.
- Incomplete extraction: Fastboot ROMs are compressed twice (.tgz β .tar β folder). If you only extracted once, you left a .tar file. Extract with 7-Zip until the actual folders and .bat scripts appear.
- Spaces or special symbols in directory path: Move your firmware folder to a short path like
C:\MiROM\pearl\without spaces or accents.
Modern HyperOS and MIUI dynamic super partitions exceed several gigabytes. Older 32-bit fastboot binaries bundled with legacy Mi Flash Tool versions fail to allocate buffer memory for large sparse chunks.
To fix this:
- Connect your phone directly to a rear motherboard USB 2.0 port rather than a front panel hub or USB 3.0/3.1 port.
- Download the latest official Google Android SDK Platform-Tools (v34+ or v35+), copy fastboot.exe and AdbWinApi.dll, and paste them into
C:\XiaomiFlash\Source\ThirdParty\Google\Android\, replacing older binaries. - Disable USB selective suspend in Windows Power Options.
This fatal recovery error occurs when "clean all and lock" (flash_all_lock.bat) is executed on cross-regional software. Xiaomi enforces cryptographic region locking: if you flash European (EEA) or Global software onto hardware originating from China (or vice-versa) and relock the bootloader, security verification aborts boot.
Because the bootloader is now locked, fastboot flashing is blocked. Recovery requires authorized Xiaomi service credentials via EDL 9008 on Qualcomm devices, or MTK bypass DA on MediaTek devices. On all future flashes, strictly select "clean all" to keep the bootloader unlocked.
Yes, provided the bootloader is officially unlocked, BUT you must always use "clean all" (flash_all.bat) and NEVER relock the bootloader.
Keep hardware disparities in mind: Chinese domestic models may lack European cellular frequencies (such as LTE Band 20 800MHz) or physical NFC controllers. Flashing European firmware cannot activate hardware antennas or chips physically missing from the motherboard.
Anti-Rollback is a hardware fuse mechanism Xiaomi uses to prevent downgrading to older Android versions with vulnerable bootloaders. If you attempt to flash an older package with an ARB index lower than your phone's current fused index, the device will hard-brick into emergency mode.
Before flashing older software, put your phone in Fastboot mode, open a command prompt, and run:
fastboot getvar anti
If this returns a number (e.g. 1 or 2), open the flash_all.bat of your target firmware in Notepad and look for the CURRENT_ANTI_VER check. If the target package has a lower number than your phone's return value, do not flash that build.
This is completely normal. On Android 10, 11, 12, 13, 14, and 15, dynamic partitions (system, vendor, product, system_ext, odm) cannot be flashed in traditional bootloader Fastboot. The script reboots the phone into userspace fastbootd mode to allocate partition geometry.
During this handoff, Windows plays a USB disconnect chime and the phone screen shows a FastbootD menu. Do not unplug the cable. Mi Flash Tool will detect the fastbootd connection within a few seconds and continue writing partition blocks.
If your connected device is not detected, follow these steps:
- Confirm the phone is in Fastboot mode with the orange FASTBOOT graphic visible.
- Open Windows Device Manager. Under "Android Device", verify that "Android Bootloader Interface" appears without error icons. If it appears under "Other Devices" with a yellow warning, install the Google USB drivers.
- Connect using a verified USB data cable plugged directly into a rear motherboard USB 2.0 port.
- Run Mi Flash Tool as Administrator.
- If you have AMD Ryzen chipset USB dropouts, connect via a basic USB 2.0 hub or rear USB 2.0 header.
No. Mi Flash Tool flashes system software partitions; it does not clear factory reset protection (FRP) or Xiaomi Find Device locks stored in protected hardware NVRAM and Xiaomi servers. Upon initial boot, the phone will request the previously linked Mi Account password or Google credentials.
On MIUI, unlocking was initiated by binding your Mi Account under Developer Options β Mi Unlock Status and waiting out the countdown in the PC Mi Unlock tool.
On Xiaomi HyperOS, Xiaomi introduced stricter requirements: on Global devices, you must apply for unlock permission through the Xiaomi Community App (Global), hold an account older than 30 days, secure an unlock quota token, bind your account in Developer Options using mobile data, and then run Mi Unlock on your PC.
Prioritize our guides in your Google search results.
No comments yet. Be the first to share your experience with this guide!