Complete guide to flashing stock firmware using Fastboot

Last update: November 2, 2026
  • It is essential to have an unlocked bootloader and a battery charge above 50%.
  • The ROM must be in .tgz format and extracted to a folder whose path does not contain spaces.
  • The MiFlash tool allows you to choose between erasing all data or locking the bootloader upon completion.

Close-up of a person connecting a smartphone to a computer using a USB cable.

If you've found yourself in a situation where your Xiaomi device is malfunctioning or you simply want to restore it to its factory settings, flashing the stock firmware is the ultimate solution. It's not rocket science, but it does require you to follow the steps precisely to avoid turning your phone into an expensive paperweight, as modifying the system always carries a small degree of risk.

To accomplish this task, we'll use Fastboot mode, which is essentially a direct communication channel between your PC and your phone's hardware. This guide will tell you everything you need to know to complete the process safely, avoiding the common mistakes that often cause headaches for users.

Essential preparations and tools

Minimalist arrangement of a laptop and smartphone on a modern background.

Before diving in, make sure you have all your equipment ready on your desk. Ideally, you should use a Windows computer , as that's where Xiaomi's tools work best and most smoothly; although it can be emulated on a Mac, it's just asking for unnecessary trouble.

  • The appropriate terminal: In this case, a Redmi Note 5 with the previously unlocked bootloaderbecause if it's closed, the PC won't let you write anything to the memory.
  • Sufficient energy: Don't risk it with the battery. Make sure your phone has at least 50% charge to prevent it from shutting down mid-flash, which would be a disaster.
  • Flashing software: Download the tool MiFlash Tool, which is the official application for managing these facilities.
  • The correct firmware: You need the ROM in Fastboot formatNote here: these versions usually end in .tgz These differ from those installed via recovery (which come in a .zip file). Make sure you download the exact version for your model from the official MIUI forums.
  • File manager: I recommend you use 7-Zip or WinRAR to extract the firmware contents.

How to prepare the ROM for flashing

Backlit keyboard with a screen that displays the message 'Data Transfer Complete'.

This is where many people go wrong. If you use 7-Zip, you'll see that the .tgz file requires two decompression processes : first, you'll get a .tar file, and then you'll need to extract that .tar file to reach the final folder. If you prefer WinRAR, it usually does it all in one go.

A vital detail is the name of the resulting folder. I advise you to rename it with something short , like "RDN5," and place it directly in the root directory of your hard drive or desktop. Most importantly, the path must not contain spaces or special characters, because if the MiFlash program finds a space in the folder path, it will display an error in red and the process will stop.

Step-by-step instructions for installing the firmware

Laptop screen showing lines of programming code in a technical environment.

Once you have the files ready and your data backed up (because you're going to lose absolutely everything ; it's a complete wipe), it's time to take action. First, install the drivers included in the Mi Flash package so that your PC recognizes your phone.

Power off your device and enter Fastboot mode by pressing and holding the power and volume down buttons simultaneously until you see the Xiaomi bunny logo. Now, run the Mi Flash program with administrator privileges and select the folder where you saved the ROM.

Connect your phone to the USB port and press the Refresh button . If everything is correct, you will see an alphanumeric code appear that identifies your device. Before pressing the Flash button, you must choose what type of cleaning you want to perform in the bottom right corner:

  • Clean All: Delete all user data; this is the most recommended option to ensure the system is clean.
  • Save User Data: Try to keep your files, although it may cause stability issues.
  • Clean All and Lock: Erase everything, and also, relocks the bootloaderleaving the phone exactly as it came from the factory.

After selecting the option, tap Flash and wait patiently. The process usually takes between 2 and 5 minutes. When it's finished, the phone will restart and display a screen with the Mi logo and some moving dots; this is the most tense moment, but don't touch anything, just let the system finish configuring itself.

Performing this procedure primarily requires patience and careful attention to the details of file extraction and the folder path. Once the device restarts and prompts you to configure Wi-Fi and language, you'll know the flashing process was successful and you have a fully functional, updated stock operating system.

Alberto navarro

Alberto Navarro

I am a sociologist, digital marketing expert and content writer at ActualidadBlog, passionate about technology, with a special focus on Android and video games for PC, consoles and mobile devices.

I have a curious mind like yours and I'm used to finding solutions to all kinds of problems related to the digital world, since I've shown a lot of interest in this subject since I was little.

Thanks to my years of experience in the sector, I will keep you informed of all the good and bad things about the Android operating system with fresh, informative and entertaining content for readers.