Owners of Xiaomi, Redmi and POCO smartphones sooner or later face the need for deep intervention in the software part of the device. Standard methods of updating βover the airβ do not always work correctly, and sometimes you need to change the firmware region from Chinese to global or restore the phone after a failed experiment, it is in these situations that the tools of ADB and Fastboot come to the rescue, allowing you to manage the system at a low level.
The process of flashing through a computer requires carefulness and strict adherence to the algorithm of actions. A mistake at any stage can lead to data loss or, in the worst case, turn the device into a brick. However, with the right tools and knowledge, you get full control of your gadget, the ability to install any version of MIUI or HyperOS, and also clean the system of preinstalled debris.
In this article, we will discuss the entire process in detail, from the preparation of the workspace and the installation of drivers to the final command to start the firmware. We will look at the nuances of working with different software, the types of unlocking the bootloader and methods for solving common problems that arise during the flashing process.
Preparation of the workplace and the necessary software
Before you connect your smartphone to your computer, you need to make sure that your PC has all the required components installed. The basic set is the ADB and Fastboot platforms, which are distributed by Google as part of the SDK Platform Tools. Without these tools, the computer will not be able to send commands to the phone in the appropriate modes.
Drivers are critical. Xiaomi devices often require separate installation of Qualcomm or MediaTek drivers, as well as specific ADB Interface drivers. If the Device Manager displays an unknown device with a yellow exclamation mark when connecting a phone in Fastboot mode, then the drivers are not installed or are not working correctly.
β οΈ Note: Use of the original USB-The cable that comes with the kit significantly reduces the risk of communication breakdown during the recording of system partitions. Cheap "charging only" cables can not miss data.
For the firmware procedure itself, you'll need a firmware archive. It's important to download Fastboot firmware that has a.tgz extension, not Recovery firmware with a.zip extension. Inside the archive, you'll need image folders and a launch script. flash_all.bat (for Windows or flash_all.sh (for Linux/Mac).
- π± Download and install. SDK Platform Tools from the official Android developer website.
- π Install Xiaomi drivers USB Driver and, if necessary, Qualcomm Snapdragon drivers.
- πΎ Download the current Fastboot firmware for your specific model from miui.com or xiaomifirmwareupdater.com.
- π Charge the device to at least 60% to avoid suddenly shutting down at a critical moment.
Once all the components are installed, it is recommended to restart the computer, which ensures that all system variables are updated and the paths to the executables are spelled out correctly. Check for utilities by opening the command line and entering adb version and fastboot version. If you see the version number in response, then the environment is ready to go.
Unlock the bootloader and log into Fastboot mode
Xiaomi has implemented non-sancone firmware protection, so to work through Fastboot, the device bootloader must be unlocked. Unlock Bootloader is officially performed through the Mi Unlock Tool utility and requires the Mi Account to be linked to the device. Without this procedure, Fastboot teams will return an access error.
To get your smartphone into Fastboot mode, you need to turn the device off completely. Then press the power and volume buttons at the same time. The screen should show an image of a rabbit repairing an android, or the inscription FASTBOOT in orange. Connect the phone to the PC in this state.
Check the connection by typing in the command line the command fastboot devices. If the system gives the serial number of the device, then the connection is established. If the screen is black or the command does not execute, try reinstalling the drivers or replacing the drivers. USB-port USB 2.0, as some older versions of Fastboot are unstable USB 3.0.
β οΈ Warning: Unlocking the bootloader automatically performs a full Wipe Data reset. All your photos, contacts and applications will be deleted without the possibility of recovery.
There is also an EDL (Emergency Download Mode) mode that is used for deep recovery of bricks, often requiring disassembly of the device and closing contacts on the board, or the use of special authorized Mi Flash accounts. For standard firmware via ADB/Fastboot, this mode is usually not required if the bootloader is unlocked.
The process of firmware through the Mi Flash Tool
The easiest and safest way to install firmware for beginners is to use the official Mi Flash Tool.This tool automatically executes all the necessary commands in the correct order, minimizing the risk of human error. After unpacking the archive with the firmware and running the program, click the "Select" button and specify the path to the folder with the firmware files.
In the program interface, you'll see three options at the bottom of the window: Clean all mode cleans the device's memory completely and installs the clean system; save user data tries to save user data, but can lead to errors when you change region; clean all and lock mode does the same thing as the first one, but after firmware re-locks the bootloader.
βοΈ Pre-firmware check
After selecting the mode, press the Flash button. The process will take 200 to 500 seconds. At this time, it is strictly forbidden to turn off the cable or interrupt power. The program log will display progress in the execution of operations. Successful completion is marked with a green label "flash success".
If the process hangs on a certain percentage or an error is issued, try using another one. USB-port, preferably on the motherboard, not on the front panel of the case, and it is also worth disabling antivirus software, which sometimes blocks the work of the scripts of the sewer.
Manual firmware through the command line (CMD)
For power users or when the Mi Flash Tool is bugged, there is a method of manual firmware through the console, which gives you complete control over the process and allows you to see each command you execute. Open the folder with the unpacked firmware, pinch the Shift and right-click by selecting "Open PowerShell window here" or "Open Command Prompt".
First, clear the partitions of the device. Enter fastboot erase cache and wait until it is completed. Then fastboot erase userdata, which ensures that the old system files do not conflict with the new version of the OS.
fastboot flash ablk emmc_appsboot.mbn
fastboot flash tz tz.mbn
fastboot flash rpm rpm.mbn
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash sbl1 sbl1.mbn
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img
fastboot rebootThe list of instructions may vary depending on the processor model (Snapdragon or MediaTek) and the firmware structure. flash_all.bat, You can start it by typing its name in the command line, but manually typing it allows you to stop the process when the first error occurs, which saves you from writing broken data.
What if the fastboot command is not found?
Once all the commands are done, the phone will restart. The first boot can last up to 10-15 minutes, as the system optimizes applications and creates new configuration files. Don't panic if the screen is lit with the MI logo for a long time - this is normal behavior.
Using ADB to install Recovery and firmware
The ADB (Android Debug Bridge) tool works when Android is already running or in Recovery mode, and allows you to transfer files, install apps, and, importantly for us, download temporary Recovery images. This is useful if you want to install customized recoveries like TWRP without constantly flashing the recovery partition.
To start, make sure that the phone has USB Debugging enabled, which is done in the Developer Menu, which is activated by seven clicks on the build number in the About Phone section. Connect the device and enter adb devices. Confirm the debugging permission on the smartphone screen.
To temporarily boot TWRP, use the adb reboot bootloader command to go to Fastboot, then fastboot boot twrp.img. Pay attention to the boot command instead of flash - it loads the image into RAM without writing it permanently. This is safe for testing.
| Team team. | Mode of work | Appointment | Risk of data loss |
|---|---|---|---|
| adb push | Android OS | Copying files to the phone | No. |
| adb install | Android OS | Installation of APK applications | No. |
| fastboot flash | Fastboot | Recording the image in the memory section | High (depending on section) |
| fastboot erase | Fastboot | Complete removal of the section | Critical (removes everything) |
| adb sideload | Recovery | Installation of firmware through Recovery | Medium (depending on the actions) |
ADB can also install firmware in.zip format via Recovery mode using the adb sideload update.zip command. This method is often used to update the system without data loss or patch installation. However, for global region change or recovery from critical failures, the Fastboot method remains the preferred method.
Possible errors and methods of their elimination
There are a number of bugs that can occur in the firmware process, and one of the most common is FAILED (remote:'Flashing is not allowed for Critical Partitions'). This means that the bootloader is locked, and the solution is one: unlock the bootloader through the Mi Unlock Tool, pre-assigning the account.
Mistake. FAILED (status_check_fail) or timeout connections often indicate problems with drivers or USB-Try reinstalling Qualcomm drivers in Device Manager by manually selecting the device model from the list, and disabling antivirus and using ports also helps. USB 2.0.
π‘
If the Mi Flash Tool gives an error of 0x80004005, try running the program on behalf of the administrator and rename the firmware folder, removing Russian letters and spaces from the path (for example, C:\rom\miui).
When the phone goes into an endless bootloop after firmware, it is solved by a clean all reboot. If that doesn't help, it may have been downloaded or the firmware is for another model of the device. Always check the code name of the model (e.g., cepheus for Mi 9) before starting work.
β οΈ Note: Firmware of the device with the blocked bootloader global version on top of the Chinese (or vice versa) without unlocking is impossible and will lead to a signature verification error (Signature Check Error).
In rare cases, firmware may need to be EDL-mode, which often requires an authorized Xiaomi account, as servers check the rights to flash, and it is easier for the average user to contact a service center if standard Fastboot methods do not help restore the device.
Frequently Asked Questions (FAQ)
Will the warranty be reset after unlocking the bootloader and firmware?
Can I flash a global version on a Chinese smartphone without unlocking?
What is Anti-Rollback and how is it dangerous?
How do I know if my bootloader is unlocked?
Should I? ROOT-Firmware rights through Fastboot?
π‘
Fastboot firmware is a powerful recovery and modification tool, but it requires precision. Always check model compatibility and firmware file integrity before you start.