Why do you need to re-flash Xiaomi Mi9 and what are the risks?
Flashing the Xiaomi Mi9 through a computer is a process that can solve many problems, from slow work to no updates. However, it is not just an update via OTA. The firmware from the PC gives access to custom builds (for example, LineageOS or Pixel Experience), allows you to bring the device back to life after a brick or remove unnecessary software from the manufacturer.
On the other hand, incorrect actions lead to loss of warranty, locking of the device or even physical damage to the board. For example, installing firmware from the Mi9 SE on a standard Mi9 (cepheus model) will lead to a broken camera module or sensors. So before you start, check the exact model in the settings (Settings β Phone β Model).
In this article, we will discuss both versions of the firmware: official (via Mi Flash Tool) and custom (via TWRP).
Preparation for firmware: what to do before the start
Before you connect the Xiaomi Mi9 to your PC, follow a few critical steps, and ignoring them can lead to data loss or a βbrick.β
- π± Save all the data: firmware erases internal memory. Use Mi Mover, Google Drive, or physical copying on your PC. It's especially important to save folders. DCIM (Photos), Downloads and WhatsApp/Databases (If you need to restore chats).
- π Charge your phone at least to the minimum. 60%: interruption of the process due to battery discharge can damage system partitions β 80-100%.
- π₯οΈ Install drivers: without them, the PC will not recognize the device in Fastboot mode. USB Driver or use a universal driver ADB Driver Installer.
- π Prepare the cable: use the original USB-C Xiaomi cable. Cheap analogues may not transmit data in Fastboot mode.
Also check the MIUI version in the settings. If it is older than MIUI 12, you may need to pre-update through OTA to avoid errors when unlocking the bootloader.
Make a backup on a PC or cloud|Charge the phone to 80%+|Install Xiaomi drivers|Download the firmware for your model (cepheus)|Prepare original USB-cable-->
Unlocking the bootloader: a mandatory step for any firmware
Xiaomi blocks the bootloader on all devices, including the Mi9. Without it unlocking, it is impossible to install custom software or even official firmware via Fastboot.The process takes up to 72 hours due to Xiaomi's security policy.
To unlock, you will need:
- π± Phone with a linked Mi Account (mandatory confirmed by the SMS/email).
- π₯οΈ Windows PC and Mi Unlock Tool installed.
- π Developer mode enabled and permitted debugging USB (Settings β The phone. β Version. MIUI (7 times press) β Additionally. β For developers β Debugging by USB).
Instructions:
- Link your Mi Account to your phone in Settings β Xiaomi Account.
- Enable OEM Unlock in the developer settings.
- Connect your phone to your PC in Fastboot mode (turn off the device, then press Power + Volume Down).
- Run the Mi Unlock Tool, log in and follow the instructions. The first attempt to unlock can end in error, which is normal. Repeat the process in 24-72 hours.
What if the Mi Unlock Tool canβt see the device?
β οΈ Note: Once the bootloader is unlocked, all data, including files on internal memory, will be deleted from the phone, and some features (such as Find Device or Mi Pay) may stop working.
Installation of official firmware through Mi Flash Tool
The official firmware is suitable if you need to return the phone to a factory state or fix errors after a failed update. Mi9 (cepheus model: use only tagged files cepheus_global or cepheus_eea (European version).
Step-by-step:
- Download the latest stable version MIUI for Mi9 Choose a file with the.tgz extension (for example, cepheus_global_images_V12.5.1.0.RFAMIXM_20210310.0000.00_10.0_global_1234567890.tgz).
- Unblock the file to a folder without Cyrillic characters (for example, C:\Mi9_Firmware).
- Install the Mi Flash Tool and run on behalf of the administrator.
- Connect your phone in Fastboot mode (as described above).
- In the Mi Flash Tool, click Select, specify the folder with the unarched firmware, then Refresh - the device must be determined.
- Select firmware mode: Clean all - complete cleaning (recommended when changing the region or after custom firmware); Clean all and lock - cleaning + lock the bootloader (use if you want to return the warranty); Save user data - data storage (does not always work correctly).
Flash
| Firmware mode | Are the data stored? | Is the loader locked? | When to use |
|---|---|---|---|
| Clean all | β No. | β No. | Change of region, correction of errors |
| Clean all and lock | β No. | β Yes. | Return of warranty, sale of phone |
| Save user data | β Partially. | β No. | Update without data loss (risky) |
β οΈ Note: If after firmware the phone is stuck on the logo MI For more than 15 minutes, don't panic. Try to go to Recovery. + Turn up the volume and make Wipe Data. If that doesn't work, repeat the firmware with Clean all.
Official. MIUI (stable)|Official. MIUI (designer)|LineageOS (Pixel Experience)|Another.-->
Installation of custom firmware through TWRP
Custom firmware like LineageOS or Pixel Experience gives you more freedom: pure Android without ads, regular security updates and additional features. However, installing them requires an unlocked bootloader and a TWRP installed.
Download it first.
- π± TWRP for Mi9 (The version should support your region).
- π± The firmware itself (e.g. LineageOS or Pixel Experience).
- π Open GApps (if firmware is not Google-services; choose the option) arm64 β 10.0 β pico).
Instructions:
- Install. TWRP Fastboot: Fastboot Flash Recovery twrp-3.6.2_10-0-cepheus.img fastboot boot twrp-3.6.2_10-0-cepheus.img The phone will reboot to TWRP.
- In TWRP, backup your current firmware (Backup β Select all partitions β Swipe for confirmation). Save the backup to your PC.
- Sweep through custom firmware: Press Wipe β Advanced Wipe, tick Dalvik, Cache, System, Data. Go back to the main menu, select Install, specify the firmware file (for example, lineage-20.0-20230601-nightly-cepheus-signed.zip). After installing the firmware, immediately swipe Open GApps (if necessary).
Reboot β System
π‘
If your mobile network is not working after installing custom firmware, check your APN settings in Settings β SIM cards and mobile networks β Access Points (APN). Often, factory resets or manual operator settings help.
Solving common errors in firmware
Even with the correct instructions, errors can occur, and here are the most common ways to correct them:
| Mistake. | Reason. | Decision |
|---|---|---|
| This device isnβt connected (Mi Flash Tool) | Drivers not installed or cable is faulty | Reinstall the drivers, try another one. USB-port (preferably 2.0) |
| Anti-rollback check | Trying to install an older version of MIUI | Use firmware no older than the current one or reset the anti-rollback via Fastboot (risky!) |
| The phone does not turn on after the firmware | Incompatible firmware or interrupted process | Repeat the firmware with Clean All or restore the backup via TWRP |
| E: Unknown command [log] (TWRP) | A damaged firmware file | Download the firmware, check the checksum (MD5) |
Critical information: If the phone is no longer detected by the PC in Fastboot mode after firmware, this may indicate damage to the EDL partition. In this case, specialized hardware (for example, Qualcomm HS-USB QDLoader 9008) and firmware through Mi Flash Pro in EDL mode will be required.
β οΈ Note: If you see a Critical partition flashing error is not allowed in the Mi Flash Tool, it means that your Mi Account does not have the right to the firmware of this model. Solution: log in to the Mi Flash Tool under the same account as your phone, or use another PC.
How to return the warranty after firmware
If you have been flashing your phone for experiments, but now want to return it to the factory state for warranty repair, follow the following steps:
- Install the official firmware through the Mi Flash Tool in Clean All and Lock mode.
- After firmware, turn on your phone and perform a full reset in the settings (Settings β Additional β Reset and Reset β Reset settings).
- Make sure the bootloader is locked: turn off the phone, press Power + Volume Down. If the screen shows Phone Locked, the bootloader is locked.
- Disable your Mi Account in the settings and delete all personal data.
However, keep in mind that some Xiaomi service centers may detect signs of unlocking the bootloader even after blocking, in which case the warranty is canceled. To check the "purity" of the device, use the command in ADB:
adb shell getprop ro.boot.verifiedbootstateIf the answer is orange, the bootloader was once unlocked. The answer is green means the device is in factory condition.
FAQ: Answers to Frequent Questions
Can I flash Xiaomi Mi9 without unlocking the bootloader?
Which firmware is better to choose: official or custom?
What if the touchscreen doesnβt work after the firmware?
Can I roll back the MIUI version to an older version?
How to check which firmware is installed on the Mi9?
π‘
Always check firmware compatibility with the phone model (cepheus for Mi9). Installing an inappropriate version can damage the camera modules, sensors or mobile network.