Update firmware on Xiaomi smartphones through custom recavery TWRP β It's a process that allows you to access the advanced capabilities of the device, but requires you to be careful and understand each step. OTA-Update, this method allows you to install unofficial assemblies, modified cores or go back to previous versions MIUI. However, improper actions can lead to a device blink (complete inoperability), so it is important to follow the verified instructions.
In this article, we will analyze the entire process from preparation to final setting, take into account the features of different models. Xiaomi/Redmi/POCO, And we'll warn you against common mistakes, and you'll learn how to choose the right firmware, avoid data loss, and what to do if something goes wrong. TWRP (version 3.6.0 newer).
1. Preparation of the smartphone: what to do before the firmware
Before you start upgrading via TWRP, make sure your device is ready for the procedure. The first and most important thing is an unlocked bootloader. Without this, customized backup and firmware installation is impossible. On Xiaomi devices, unlocking is done through the official Mi Unlock Tool, but requires a Mi Account and wait (usually 7-15 days).
The second is to check your smartphone model, and the firmware is strictly codenamed to the device (e.g., Redmi Note 10 Pro is codenamed sweet), and you can find it through the Device Info app or the ADB team:
adb shell getprop ro.product.deviceAlso prepare:
- π Battery charge of at least 60% (better 80-100%). interruption of the process due to discharge can make the phone inoperable.
- π± Backup of the data, firmware through TWRP Often requires formatting of the section /data, This leads to loss of photos, contacts and apps.
- π Cable USB Type-C (or Micro-USB for older models) and a computer.
- π Folder with firmware and additional files (for example, Magisk for root rights) on internal memory or SD-map.
β οΈ Note: If you are upgrading from Android 10 Android 12+, It may be necessary to format the section. /data filesystem F2FS. This erases all data without any recovery capability!
2. firmware selection: official MIUI vs custom builds
Not only does the firmware type determine the functionality, but also the stability of the device, and Xiaomi offers two types of official firmware:
- π¦ Stable version MIUI β Proven build with minimal bugs, but no last features.
- π οΈ Webly β Updated weekly, contains new features, but may be less stable.
Custom firmware (e.g. LineageOS, Pixel Experience, Havoc-OS) gives you more freedom: pure Android without Xiaomi bells and whistles, regular security updates and additional settings. However, they can deprive you of some features (e.g., they can deprive you of some features (e.g., Xiaomi, IR-blaster MIUI).
Where to download:
| Type of firmware | Source | Recommendations |
|---|---|---|
| Official MIUI (Stable/Developers) | Official Xiaomi website | Choose the version for your region (Global/EU/China). For TWRP, download the file with the.zip extension (not.tgz!). |
| Castom firmware (AOSP) | XDA Developers, Telegram channels | Check user reviews and compatibility with your model. Avoid "unofficial" builds without developer support. |
| Modified cores (e.g., Perseus) | GitHub | Power users only: An incompatible core can cause overheating or accidental reboots. |
Check before downloading MD5-hash of the firmware file (for example, through the HashMyFiles utility) This will prevent downloading corrupt or fake files.
π‘
If you are upgrading from Android 11 to Android 12+, download the firmware package for your model separately. It must be flashed before the main firmware, otherwise errors with the camera modules or sensors may occur.
3. Install firmware via TWRP: step-by-step instruction
Once all the files are ready, we move to the most important step, and it is important that the process may differ depending on the type of firmware (official / castom) and the version of TWRP.
Steps for the official MIUI:
Reboot to TWRP (Put Power + Volume Up)|
Backup the current firmware (Backup β Select partitions)|
Click Wipe β Advanced Wipe and tick Dalvik, Cache, Data|
Install the firmware (Install) β Choose. ZIP-file)|
Reboot (Reboot β System)
-->
For custom firmware (for example, LineageOS), the order is different:
- In TWRP, run Wipe β Format Data (this will remove everything from internal memory!).
- Install firmware, then GApps (if you need Google services).
- Make sure you have a Magisk (if you need a rut) or disable_forceencrypt (de-encrypt).
- Reboot. The first launch can take 10 to 15 minutes.
If after the reboot, the device is stuck on the MI logo or loaded into TWRP, then the firmware is not suitable or the formatting step is missed.
β οΈ Warning: Don't try to flash the same version over the non-functioning system! TWRP, Format all partitions (Format Data), then re-install with another firmware.
What if TWRP doesnβt see internal memory?
4. Typical errors and their solutions
Even with the correct following of the instructions, errors can occur, and let's consider the most common and ways to correct them:
| Mistake. | Reason. | Decision |
|---|---|---|
| Error 7 when installed | The firmware is not designed for your model or Android version. | Check the device's codename and download the correct version. To bypass the error, you can edit the updater-script file in the ZIP-archive. |
| The device is loaded into Fastboot | The boot boot boot boot.img file is damaged or missing. | Sweep boot.img from the firmware via fastboot flash boot.img. |
| Permanent rebuttals after installation | Incompatibility of a kernel or modules (e.g., a vendor) | Slice vendor.img and dtbo.img from stock firmware. |
| TWRP asks for password after formatting | Encryption is FBE (File-Based Encryption) enabled. | Use it. disable_forceencrypt Or run the firmware without encryption. |
If Wi-Fi/Bluetooth stopped working after firmware or the camera, the firmware and vendor versions are likely not the same.
- Download the full firmware package for your model (for example, with Xiaomi Firmware Updater).
- Unpack. ZIP-archive and file firmware-update and vendor through TWRP.
- Reset the device.
π‘
If the smartphone doesn't turn on after firmware, don't panic! In 90% of cases, it can be restored via Fastboot or re-routing in TWRP. The main thing is not to try to flash random files and format partitions without a backup.
5. Set up the system after the update
Once the firmware is successful, the device requires initial setup, and if you have an official MIUI, the process is not much different from factory reset: select a language, connect to Wi-Fi, and log in to your Mi Account (if required).
What needs to be done:
- π§ Set up Root access (if you have been flashing Magisk): Open the Magisk app and perform an additional installation.
- π Update Google Play Services and Apps through Play Market.
- π‘ Check the sensors (gyroscope, compass) with the Sensor Test app. If something doesn't work, run through the missing modules.
- π Calibrate the battery: discharge the device to 0%, then charge to 100% without interruptions.
For official MIUI after firmware may require:
- π± Activate OEM Unlock in the developer settings (if you plan to further manipulate).
- π Reset network settings if mobile internet is not working (Settings) β SIM-maps and mobile networks β Resetting settings).
- π― Set up gestures and theme for yourself (in) MIUI This is done through themes and additional settings).
If after the update the device began to warm or discharge quickly, check:
- π Background activity of applications (Settings) β Battery β Battery utilization).
- π Kernel version (Settings) β The phone. β The kernel version. Unofficial kernels may conflict with firmware.
- π Availability of updates for firmware (especially relevant for custom assemblies).
6. How to roll back to the previous firmware version
If the new firmware is unstable or you don't like the changes, you can go back to the previous version.
Steps of rollback:
- Download the archive with the desired version of MIUI (required for your model!).
- Reboot to TWRP.
- Make a backup of the current system (Backup).
- Run Wipe β Advanced Wipe and mark System, Data, Cache, Dalvik.
- Install the old firmware through Install.
- If required, run vendor and firmware from the older version.
- Reset the device.
Important: When rolling back from Android 12 to Android 11 (and below), you may need to:
- π Formatting the Data section in ext4 (if previously F2FS).
- π± Delete your Mi Account through TWRP (If the device asks for an old password).
- π§ Shutdown AVB 2.0 (Android Verified Boot with the command: fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
β οΈ Note: A rollback to an older version of Android may result in the loss of functionality of some applications (such as banking) as they require up-to-date versions. API. SafetyNet may also be in trouble.
7. Security and optimization tips
Firmware via TWRP is not only an update, but also a risk of disrupting the security of the device.
Safety:
- π Don't install firmware from unverified sources. Attackers can embed backdoors or miners.
- π± Before firmware, disable the Mi Account in the settings (Accounts) β Mi Account. β Delete your account.This will prevent blocking after resetting.
- π‘οΈ After installing custom firmware, check SafetyNet status through the SafetyNet Test app. If it doesn't pass, use MagiskHide or the Universal SafetyNet Fix module.
Optimization:
- β‘ To speed up work, turn off animation in the developer settings (Windows animation) = 0.5x).
- ποΈ Clean the cache regularly through TWRP (Wipe β Cache/Dalvik).
- π If the battery is fast-setting, check apps for background activity with BetterBatteryStats.
For experienced users:
- π§ Use it. EX Kernel Manager for fine-tuning the kernel (frequency) CPU, governor, etc.).
- π‘ Optimize your network with Network Signal Guru (allows you to manually select frequencies) 4G/5G).
- π― Install. ViPER4Android To improve the sound (requires Magisk).
Remember, custom firmware and modifications can take your warranty out of the way. If the device is warranty, weigh the pros and cons before the firmware.