How to Flash Qualcomm Stock Firmware Using QFIL
Step-by-step tutorial on flashing Qualcomm Snapdragon smartphones using QFIL (Qualcomm Flash Image Loader). Covers emergency 9008 EDL mode connection, UFS vs eMMC storage configuration, and resolving Sahara handshake failures.
Pre-Flight Checklist
Complete ALL items before proceeding. Skipping any step increases the risk of bricking your device.
Guide Steps
Install the official Qualcomm HS-USB QDLoader 9008 driver package for Windows (64-bit). Restart your computer after installation to ensure driver services register properly.
Install the latest QPST suite (v2.7.496 or higher). QFIL is located in C:\Program Files (x86)\Qualcomm\QPST\bin\QFIL.exe.
In QFIL, open the top menu bar and click Configuration β FireHose Configuration:
- Device Type: Select UFS for modern mid-range and flagship smartphones (e.g., UFS 2.1, 2.2, 3.1, or 4.0 storage). Select eMMC only for older or budget devices equipped with eMMC 5.1 storage.
- Validation Mode: Set to Basic or None.
- Reset After Download: Check this box if you want the phone to automatically restart after flashing finishes.
Back on the main QFIL interface:
- Under Select Build Type, click the radio button for Flat Build.
- Under Select Programmer, click Browse..., navigate to your extracted firmware folder, and select your Firehose programmer file (e.g.,
prog_firehose_ddr.elf,prog_firehose_ufs.elf, orprog_emmc_firehose_....mbn).
Under Select Download Files on the right side of QFIL:
- Click the Load XML... button.
- Select
rawprogram0.xml(or select allrawprogram*.xmlfiles if your firmware splits UFS storage into multiple LUNs). - A second file picker immediately opens asking for the patch file. Select
patch0.xml(or all matchingpatch*.xmlfiles).
These XML files map out the physical partition boundaries on your device's internal storage.
Qualcomm Emergency Download Mode (EDL) operates on low-level Boot ROM without turning on the display:
- Hardware Keys: Power off the phone. Hold Volume Up + Volume Down together and plug in the USB cable connected to your PC.
- Via Fastboot: If your phone is in Fastboot mode, run
fastboot oem edl(works on select devices). - Hardware EDL Test Points: If the phone is deeply bricked, remove the back cover and bridge the two gold EDL test points on the motherboard with metal tweezers while plugging in USB.
At the top of QFIL, click "Select Port". You should see Qualcomm HS-USB QDLoader 9008 (COMx). Select it and click OK.
Click the blue Download button in QFIL. The status box at the bottom will start logging the protocol handshake:
- Sahara Handshake: Transfers the Firehose programmer from PC to the phone's internal SRAM.
- Firehose Protocol: Initializes UFS/eMMC storage and partition tables.
- Writing Partitions: Flashes modem, boot, vendor, system/super, and recovery. This takes 3 to 10 minutes.
When flashing completes successfully, the QFIL log window displays:
To exit EDL mode and turn the phone on:
- Unplug the USB cable from the phone.
- Press and hold the Power button (or Power + Volume Down) for 12 to 15 seconds until the phone vibrates and shows the boot logo.
- The first boot will take 5 to 10 minutes to initialize Android.
Congratulations! Flash Successful!
You've successfully completed all steps. Your device should now be running the new firmware. If it's booting normally β you're done! Check the troubleshooting section below if you encounter any issues.
Troubleshooting & FAQ
Common errors and their solutions. Read this before asking for help.
The Sahara protocol handles the initial transfer of the programmer file. When this fails:
- Storage Type Mismatch: Open Configuration β FireHose Configuration and change Device Type to UFS (or eMMC depending on your device).
- Unsigned Programmer: Modern Qualcomm chips (Snapdragon 700/800 series and Gen 1/2/3) enforce secure boot. An unsigned generic programmer will be rejected by the hardware.
- Port Timeout: EDL mode has a short timeout window. Unplug the cable, hold Power for 15 seconds to reset, and re-enter EDL mode right before clicking Download.
- Use USB 2.0: Switch to a native USB 2.0 port on your computer.
This means Windows detected the phone in EDL mode, but the Qualcomm QDLoader driver is not installed or assigned.
- Download and install the Qualcomm HS-USB QDLoader 9008 driver package.
- In Device Manager, right-click "QUSB_BULK" β Update driver β Browse my computer for drivers.
- Point to the driver installation folder (typically in
C:\Program Files\Qualcomm). - Once installed, the device will immediately change to "Qualcomm HS-USB QDLoader 9008 (COMx)".
Modern smartphones with UFS storage divide physical flash memory into multiple Logical Unit Numbers (LUNs):
rawprogram0.xmlwrites to user data and system partitions (LUN 0).rawprogram1.xmlthroughrawprogram5.xmlwrite to bootloader, modem, and hardware configuration LUNs.
When QFIL prompts for rawprogram files, hold Ctrl and select all rawprogram*.xml files, then select all matching patch*.xml files so all memory LUNs are flashed.
In EDL mode, the phone screen is completely black and looks powered off. To force the phone out of EDL mode:
- Unplug the USB cable.
- Press and hold both Power + Volume Down + Volume Up together for at least 15 to 20 seconds.
- Release the buttons as soon as the phone vibrates or the manufacturer logo lights up.
Prioritize our guides in your Google search results.
No comments yet. Be the first to share your experience with this guide!