Installing custom firmware via TWRP on Xiaomi smartphones is a process that opens up access to advanced features of the device, from removing system applications to installing the latest versions of Android on older models. However, the wrong actions can turn the phone into a brick.
Many Redmi, POCO or Mi users are faced with having to reflash the device due to slow operation, lack of updates or desire to get root rights. But before you start, it is important to understand that firmware through TWRP will void the official warranty of Xiaomi and can lead to blocking of certain features (for example, Google Pay or banking applications).
In this guide, we will take a look at the process from unlocking the bootloader to the final system setup, focusing on the nuances of popular models (Redmi Note 10 Pro, POCO X3 Pro, Mi 11) and the typical errors that beginners experience. All steps are tested on current versions of TWRP 3.7.0 and MIUI 14/LineageOS 20 firmware.
Preparation of the device: unlocking the loader
The first and most critical step is unlocking the bootloader. Without it, TWRP simply cannot be installed. Xiaomi officially allows you to unlock the bootloader, but the process requires waiting and following the rules.
First, check the blocking status:
- Turn off the phone.
- Press Volume Down + Power to log into Fastboot Mode.
- Connect the device to the PC and type the command: fastboot oem device-info
If you see Device unlocked: false in the answer, the bootloader is locked.
- π± Download Mi Unlock Tool (Official Tool from Xiaomi).
- π Link your Mi Account to your device in settings (Settings) β Xiaomi account β Mi Unlock status).
- β³ Wait 7 to 168 hours (depending on model) Xiaomi deliberately delays the process so users don't accidentally unlock the bootloader.
β οΈ Warning: Once the bootloader is unlocked, all data on the device will be reset! backup via Mi Cloud or locally on PC.
When the wait is over, launch the Mi Unlock Tool, log in to your account and follow the instructions of the program. Successful unlocking will be confirmed by the message Unlocked successfully. You can now proceed to install TWRP.
2. Installation of TWRP Recovery
TWRP (Team Win Recovery Project) is a custom recovery that allows you to install firmware, backup and get root rights. There is a different version of TWRP for each Xiaomi model, so it is important to download the correct file.
Where to get TWRP:
- π Official website: twrp.me (see your model in the list).
- π€ Developer Telegram channels (e.g, @XiaomiFirmwareUpdater).
- π οΈ Forums XDA Developers (tested themes only!).
Installation instructions:
- Download the TWRP file in.img format.
- Rename it to twrp.img and place it in a folder with fastboot.
- Transfer your phone to Fastboot Mode (Loudness Down + Power).
- Connect to your PC and execute the command: fastboot flash recovery twrp.img
- After successful installation, immediately boot into TWRP, holding Volume Up + Power.
β οΈ Note: On some models (POCO F3, Redmi K40) post-fix TWRP The system can automatically restore stock recovery, and to avoid that, immediately after entering the system. TWRP Go to Advanced. β Flash Current TWRP.
If TWRP doesnβt start or gives you an OrangeFox (alternative recovery) error, try a different version of the file. New Qualcomm Snapdragon 8 Gen 1/2 devices may require TWRP with dynamic partitions support.
Data backup made.|Downloaded the correct version TWRP|Loader unlocked|Battery charge > 50%|Antivirus on PC is disabled-->
3. Selection and loading of firmware
The firmware choice is the key to the stability of the device, and there are several types of firmware for Xiaomi:
- π± Officially MIUI (stock, but with a remote ad block).
- π Castomy MIUI (for example, MIUI EU, MIUI Pro).
- π€ AOSP-Firmware (LineageOS, Pixel Experience, Havoc-OS).
- π₯ Firmware for gamers (Corvus) OS, DerpFest).
For beginners, we recommend starting with MIUI EU β This is a modified official firmware without ads and with advanced settings. You can download it at xiaomi.eu. AOSP-Firmware contact the forums XDA or telegram chat developers.
Before downloading, check:
- Compatible with the code name of your model (for example, Redmi Note 10 Pro is sweet).
- Android version (some firmware requires Android 12+).
- Firmware type: Fastboot (installed via PC) or Recovery (installed via TWRP).
The firmware file is usually.zip. Download it and transfer it to your phone or to your phone. SD-Don't unpack the archives!
How do I find out the code name of my model?
4. The firmware process through TWRP
Now, to the most important step, installing the firmware, follow the instructions carefully to avoid errors.
Step 1: Download to TWRP
- Turn off the phone.
- Press Volume Up + Power to enter TWRP.
- If you request permission to change, swipe to allow modifications.
Step 2. Cleaning the sections
Before installing a new firmware, you need to clear the old data. In the main TWRP menu, select: Wipe β Advanced Wipe and tick:
- ποΈ Dalvik / ART Cache
- π System
- π Data
- π Cache
Swipe to Wipe. Do not clean the Internal Storage if the firmware is in internal memory!
Step 3: Installation of firmware
- Go back to the main menu and select Install.
- Find the firmware file (.zip) and select it.
- Swipe to Confirm Flash (Swipe to Confirm Flash)
- Wait until the process is completed (it can take 5-15 minutes).
Step 4: Additional actions
After installing the firmware:
- π If the firmware requires Google services, install them immediately (download the appropriate Open GApps or NikGApps package).
- π If you want root, go through it. Magisk.zip (download on GitHub).
- π± For AOSP-You may need to run vendor and firmware separately.
When completed, press Reboot System. The first run can take up to 10 minutes - don't interrupt the process!
π‘
If your phone is stuck on the Xiaomi logo after you have firmware, try going to TWRP and re-cleaning Dalvik/Cache. If it doesn't work, then re-sweeten the firmware.
5. Typical errors and their solutions
Even if you follow the instructions accurately, you can get errors, and we'll look at the most common ones and how to fix them.
| Mistake. | Reason. | Decision |
|---|---|---|
| Error 7 in TWRP | Incompatibility of the firmware with the device | Check the code name of the model and download the correct version of the firmware |
| The phone does not turn on after the firmware | Incorrect cleaning of partitions or interrupted process | Repeat the firmware to make sure System and Data are cleaned |
| No OS installed in TWRP | There is no firmware in the System section | Install the firmware again, having cleaned the System beforehand |
| Constant reboots (bootloop) | Conflict of the kernel or modules | Swipe the stock kernel (boot.img) or roll back to the previous version |
| The sensor is not working in TWRP | The Wrong Recovery Version | Download TWRP with support for your display (for example, for AMOLED) |
If your mobile network is not running after AOSP firmware is installed, check if firmware and vendor are stitched. Some models (Redmi Note 8 Pro, POCO X2) require an additional patch for modems.
Another common problem is encryption, and if TWRP asks for a password after you've firmwareed it and you haven't set it, do it:
- In TWRP, go to Wipe β Format Data.
- Type in yes and confirm.
- Reboot and re-install the firmware.
β οΈ Note: Data formatting will delete all data, including files on internal memory! Use this method only if other methods have not helped.
6.Setting up the system after firmware
After successful firmware, you must perform the initial setup. Depending on the type of firmware (MIUI or AOSP), the steps may differ.
For MIUI-firmware:
- π Choose a language and region (we recommend Russia or Europe for the first time). MIUI EU).
- π Skip Mi Account binding if you donβt plan to use cloud services.
- π Turn on Debugging. USB in the developer settings (Settings) β The phone. β Version. MIUI, tap 7 times).
For AOSP-Firmware (LineageOS, Pixel Experience):
- π€ Setting up is similar to pure Android: language selection, Wi-Fi connection, login to Google account.
- π If root is required, install Magisk Manager and check the status in the app.
- π Update the firmware through the built-in updater (if available).
After setting up, we recommend:
- Check the operation of the main functions: calls, mobile Internet, Wi-Fi, Bluetooth.
- Install Titanium Backup or Swift Backup for data recovery (if there is a backup).
- Disable unnecessary system applications via Magisk or ADB.
If gestures or animations donβt work after AOSP firmware, check the settings in System β Gestures or install an alternative launcher (e.g. Nova Launcher).
π‘
After you have firmware custom firmware, do not update via OTA (over the air) - this can cause a failure. All updates are installed only through TWRP!
7. How to get back the stock firmware
If custom firmware is unstable or you want to return the official MIUI, you can do it in two ways: via Fastboot or Recovery.
Method 1: Fastboot (recommended)
- Download Fastboot firmware for your model from the Xiaomi website.
- Unpack the archive in a folder with fastboot.
- Transfer the phone to Fastboot Mode and connect to the PC.
- Launch the file. flash_all.bat (For Windows, run the command: fastboot flash all
Method 2: Through TWRP
- Download the Recovery firmware (.zip) from the same site.
- Put it on the phone.
- In TWRP, select Install and file.
- Clean Dalvik/Cache and reboot.
Once you return to the firmware, the bootloader will remain unlocked. To lock it back, use the command:
fastboot oem lockWarning: Locking the bootloader will erase all data and may cause a failure if the firmware is modified!