EDL and Firehose
EDL (Emergency Download mode) is the low-level recovery protocol of the Qualcomm primary boot
loader. It is in the mask ROM. It shows a USB device ID of 05c6:9008. It accepts a signed
Firehose programmer that can read and write the eMMC. EDL is in the boot ROM, so you can get to it
from almost any software state. EDL is the most powerful recovery tool and also the most
dangerous tool.
WARNING: Use only read-only commands (
printgptand partition reads) until you have a verified backup. EDL can write every partition on the device. An incorrect write can brick the phone. Do not write NV partitions. See NV partitions and backup.
Entering EDL
| Method | Detail |
|---|---|
| Hardware keys | Turn the phone off. Hold Volume+ and Volume−. Then connect the USB cable. Do not push Power |
adb reboot edl |
Can work on some builds |
| Host check | lsusb shows 05c6:9008 Qualcomm, Inc. |
On the reference unit, EDL entry was most reliable when both volume keys were held and the cable went
into a direct host port. EDL dropped out on a hub. The stock ABL does not support
fastboot oem edl.
USB IDs
| Mode | Vendor:Product |
|---|---|
| Android (adb) | 18d1:4ee7 |
| Fastboot | 18d1:d00d |
| EDL | 05c6:9008 |
The device uses generic Android USB IDs. It does not use the vendor ID of Sonim.
Sahara and the Firehose programmer
EDL starts with the Sahara handshake. During the handshake, the host must supply a matching signed Firehose programmer. The programmer is for one device and one platform.
| Item | Value |
|---|---|
| Programmer | prog_emmc_ufs_firehose_Sdm660_ddr.elf (also known as the Sonim peek loader) |
| SHA-256 | d25b298ca36f467c3e30293e25492f08ea4831b4e98140313ff9ebca065c59b2 |
| Size | 631,232 bytes |
| Format | ELF64 ARM with an embedded aarch64 ELF at 0x87400 |
| Sahara HWID | 0x0AC0E1 = SDM630 (from the config tables of Qualcomm) |
On this platform, the SDM630 and SDM660 firehose builds are interchangeable. The loader above is the
same byte-for-byte file that is used for SDM660-family XP8 flashing. In some collections, its filename
starts with 0008c0e1.
CAUTION: Do not trust the programmer until its SHA-256 is the same as the value above. ClamAV can flag the programmer as
Heuristics.Broken.Executable. This is expected for a Firehose blob and does not show malware.
Tooling
The usual host tool is bkerler/edl. It operates Sahara and Firehose. It can dump and flash partitions. These commands give a read-only start:
edl printgpt # list the GPT, no writesedl r <partition> out.imgKeep the Python tooling in its own virtual environment. Do not use the system Python.
EDL reachability and failure modes
- You can get to EDL with the keys from these states: power-off, Android, ABL, fastboot, or U-Boot.
- EDL is not always available if early boot-chain partitions (
xbl*,keymaster*,tz*) or the hardware are damaged. - EDL reports the device state over USB. A bad cable or hub can cause dropouts during a data transfer. Use a direct, known-good port.
Typical uses
| Task | Command |
|---|---|
| Read the GPT | edl printgpt |
| Dump a partition | edl r <name> <file> |
| Write a partition | edl w <name> <file> (destructive) |
| Reset | edl reset |
WARNING: Make a verified backup before you use
edl w. The command overwrites the partition. Do not use it onmodemst1,modemst2,fsg,fsc, orpersist. These partitions hold per-unit data that you cannot recover.