Home > Unbrick

How to Unbrick Xiaomi Mi A1 via Fastboot Commands

In this guide, we will show you the steps to unbrick your Mi A1 device via Fastboot Commands. Xiaomi devices always have a stronghold in Asian countries such as India. The reason for the same stands simple- all its devices offer the absolute best at their price. So you would be getting many new and noteworthy features but without burning a hole in your pockets. Along the same lines, they have their own customized Android OS skin dubbed as MIUI.

They are probably the most customizable skins out there that any OEM has to offer. And this is where things become to go south for some. The reason for that is not everyone is a fan of such tweaks and customizations, especially when it comes to the all-important OS. A few years back, users didn’t have much say in that. However, all that changed with the initiation of the Mi A series. These were the set of Android One devices from Xiaomi that managed to incorporate features of both sides.

To begin with, you would be getting the clean OS experience without any massive customizations. Furthermore Android One also guaranteed timely OS upgrades. Then on the other side, the devices were still manufactured by Xiaomi hence the value for money stood as it is. Further add to the fact that it was (and still is) among the most active player in custom development, and one couldn’t have asked for more.

However as you might be aware, these tweaks might sometimes have negative consequences as well. If not done correctly, your device might end up in a bootloop, soft brick, or worse, a hard brick. But even if that happens, there is a handy way out. You could easily unbrick your Mi A1 device via Fastboot Commands. And in this guide, we will show you how to do just that. So without further ado, let’s get started.

Xiaomi and EDL Mode: It’s Complicated!

Recently Xiaomi made a massive change that leads to disastrous consequences for the tech enthusiasts and developers alike. The only ones who would remain unaffected by this decision are the ones who maintain a safe distance from Unlocking Bootloader, Rooting, and Flashing Custom binary. Rest all the users like us who are engrossed in these tweaks are the suffering party. So what really happened?

Well, if you step into custom development, then it opens the gates to the plethora of customization options. From installing a custom recovery like TWRP to getting access to the system partition via Magisk, the possibilities stand endless. Along the same lines, you could flash custom ROMs, Magisk Modules, Substratum Themes, Xposed Frameworks, and the likes. But these tweaks are risky in nature.

If you end up flashing a wrong binary or flash the correct binary to the incorrect slot (for A/B partition devices), then you are inviting trouble. By trouble, we mean the device would end up in a bootloop, soft brick, or worse hard brick. While the first two are usually easy to deal with, it is the latter one that might be concerning for the users.

Fortunately, the devices that have Qualcomm as the underlying chipset comes with EDL Mode or the Emergency Download Mode. You only need to boot your device to EDL and flash the firmware file and your device will be back from dead. Unfortunately, Xiaomi decided to block this EDL mode for the general users.


So only the users who have an authorized Mi Service Centre ID could flash the firmware via Mi Flash Tool in EDL Mode. As for the general users, there does exist a workaround in the form of using the Mi A1 Patched Firehose File (prog_emmc_firehose.mbn) or the prog_firehose_ddr_unbrick.elf file. However, finding both these files is among the most challenging task ever.

With that said, if your Xiaomi device is stuck in bootloop or soft brick mode, there is still a handy way out. You could easily unbrick your Xiaomi device (which in this case is Mi A1) via Fastboot Commands. We wouldn’t be using any Mi Flash Tool or any other software for that matter. So how will then this task be carried out? Follow along for the detailed instructions.

How to Unbrick Mi A1 via Fastboot Commands

Now that we are done with the explanation part, let’s turn our attention towards the unbrick instructions. As I have already mentioned before, the below instructions are only valid for devices that are soft-bricked or in a boot loop. Furthermore, the process is going to wipe all the data on your device.

So keep this thing in mind before proceeding and take a backup beforehand (if possible y any means). Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.

STEP 1: Download Android SDK

To begin with, download and install the Android SDK Platform Tools. This is the official ADB binary file provided by Google and is used to execute ADB and Fastboot Commands.

STEP 2: Download Mi A1 Fastboot ROM

Next up, download the Fastboot ROM for your device. As for this guide, I am using the Mi A1 (tissot) Global Stable Fastboot V10.0.24.0.PDHMIXM. You are free to try any version of your choice, but it is recommended to try the newer builds only and of your region. Here is how to understand the Xiaomi Fastboot firmware version. [Don’t Miss: How to Flash Xiaomi Fastboot ROM without Mi Flash Tool].

  • – Firmware version
  • P – Android version (P-> Android 9).
  • DH – Smartphone model code (DH = Xiaomi Mi A1).
  • MI – Firmware build type (MI for Global | EU for Europe | IN for India)
  • XM – Firmware version code​

Now that you have got hold of the required firmware file, proceed ahead to the next step to unbrick Mi A1 via Fastboot Commands.

STEP 3: Move Mi A1 Fastboot ROM Files to ADB Folder

  1. To begin with, extract the downloaded firmware file. Once the extraction is complete, you should see the following files:
    mi a1 fastboot rom files
  2. So head over to the Images folder and the following files will be present there:
    xiaomi mi a1 fastboot rom partition image files
  3. Select all these files via Ctrl+A shortcut keys and copy them to the platform-tools folder. This is the same folder that you have got after installing the Android SDK.
  4. Once done, proceed to the next step to unbrick your Mi A1 device via Fastboot Commands.

STEP 4: Boot Bootloop/Soft Bricked Mi A1 to Fastboot Mode

  1. First off, boot your device to the Fastboot Mode. For that, power it off.
  2. If you cannot do so (due to your device being stuck in a bootloop) then the only option left is to let the entire battery drain out (remember the good old days when we could easily remove the battery!).
  3. Once your device has turned off, press and hold the Volume Down and Power buttons for a few seconds.
  4. This will boot your device to Fastboot Mode. You should see the famous Mi Bunny Logo with the Fastboot text underneath it.
    fastboot mode xiaomi device
    Fastboot Mode in Xiaomi
  5. Now head over to the platform-tools folder where you have extracted the Fastboot ROM.
  6. Go to its address bar, type in CMD, and hit Enter. This will launch the Command Prompt window. Keep this window opened from now on until the end of this guide.

STEP 5: Flash Firmware via Fastboot Commands to Unbrick Mi A1

Finally, we are down to the most important part of this article. I have shared all the required fastboot commands to flash the stock firmware onto your Mi A1 and unbrick it. To begin with, make sure that your device is connected to the PC via USB in Fastboot Mode. Then head over to the Command Prompt window that is opened inside the platform-tools folder. Now execute the below commands in this CMD window.


I would highly recommend that you execute these commands one at a time, rather than copy-pasting all of them at one go. Furthermore, right before we use the command to boot your device to the OS (fastboot reboot), we would be setting Partition A as the active partition (via fastboot set_active a). This is because the actual system fule is being flashed to partition A (fastboot flash system_a system.img).

On the other hand, we are just flashing a dummy system file to partition B (fastboot flash system_b system_other.img). So when your device reboots, it will be on the A slot/partition. Just thought of sharing this information as it might come in useful to some of our readers. With that said, let’s turn our attention towards the fastboot commands to unbrick your Mi A1.

fastboot erase boot_a

fastboot flash modem_a modem.img
fastboot flash modem_b modem.img
fastboot flash sbl1 sbl1.img
fastboot flash sbl1bak sbl1.img
fastboot flash rpm rpm.img
fastboot flash rpmbak rpm.img
fastboot flash tz tz.img
fastboot flash tzbak tz.img
fastboot flash devcfg devcfg.img
fastboot flash devcfgbak devcfg.img
fastboot flash dsp dsp.img
fastboot flash sec sec.dat
fastboot flash splash splash.img
fastboot flash misc misc.img
fastboot flash aboot emmc_appsboot.mbn
fastboot flash abootbak emmc_appsboot.mbn
fastboot flash boot_a boot.img
fastboot flash boot_b boot.img
fastboot flash system_a system.img
fastboot flash system_b system_other.img
fastboot flash lksecapp lksecapp.img
fastboot flash lksecappbak lksecapp.img
fastboot flash cmnlib cmnlib.img
fastboot flash cmnlibbak cmnlib.img
fastboot flash cmnlib64 cmnlib64.img
fastboot flash cmnlib64bak cmnlib64.img
fastboot flash keymaster keymaster.img
fastboot flash keymasterbak keymaster.img
fastboot flash userdata userdata.img

fastboot set_active a
fastboot reboot

Once you have successfully executed all the above commands, your device will reboot to the OS. And with this, we conclude the guide on how to unbrick Mi A1 via Fastboot Commands. The best part about this tutorial is the fact that it doesn’t require any Mi A1 Patched Firehose File (prog_emmc_firehose.mbn) or the prog_firehose_ddr_unbrick.elf file.

Furthermore, we didn’t need to make use of the Mi Flash Tool. With that said, if you have any queries concerning the aforementioned steps, do let us know in the comments section below. We will get back to you with a solution at the earliest.

  • Hi,
    Great guide. Thanks

    But my WIFI now won’t turn on. Any ideas ?

  • Oem unlock failed cant able to unlock ,
    Gets rebooted after executing fastboot oem unlock command.
    And the phone oem will be in locked condition after rebooting.

  • finally, a guide that works, phewwwww

  • Does it works if bootloader is locked?

    • Sadique Hassan

      Unfortunately, no. It requires an unlocked bootloader.

  • Does it work if bootloader is locked?

  • Nazmus Sadat

    Hello there, thanks for your guide. But I can’t erase boot_a, as it’s showing “FAILED (Write to device failed (no link))”. Can you please tell me what to do?

    • Sadique Hassan

      Hi Nazmus, it is suggested to use USB 2.0 port and try with another USB cable as well.

  • fastboot flash sec sec.dat

    When I flashed it on my Mi A1 I got an error FAILED(remote: ‘flash write failure’)

    fastboot error: command failed

    • Sadique Hassan

      Hi Harees, try skipping this command: fastboot flash sec sec.dat., and flash all the other ones. I guess the DAT format isn’t made for device partition. And if possible, please do let me know the results as well.

  • Hi, thx for a guide.
    I did get into problem to cmd not detecting phone but after some time I manage to do it.

    Is Any way to flash it without gapps ?

    • Sadique Hassan

      Hi Mike, unfortunately, No. After using the above commands, your device will be back to stock, as it was originally shipped. So this would re-install all the Google Apps. Though there is a way to remove it via ADB commands and the app’s package name, if you’re interested in that, let me know I’ll cover a separate guide on that.