{"id":34610100,"url":"https://github.com/qualcomm/qdlrs","last_synced_at":"2025-12-24T14:06:54.350Z","repository":{"id":291019140,"uuid":"974412458","full_name":"qualcomm/qdlrs","owner":"qualcomm","description":"Device flashing utility and library","archived":false,"fork":false,"pushed_at":"2025-11-18T19:01:59.000Z","size":94,"stargazers_count":45,"open_issues_count":6,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-11-18T21:05:03.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qualcomm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-28T18:30:38.000Z","updated_at":"2025-11-18T19:02:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"c480e2b2-700d-46ee-a8cf-e00554e489c9","html_url":"https://github.com/qualcomm/qdlrs","commit_stats":null,"previous_names":["qualcomm/qdlrs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qualcomm/qdlrs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qualcomm%2Fqdlrs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qualcomm%2Fqdlrs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qualcomm%2Fqdlrs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qualcomm%2Fqdlrs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qualcomm","download_url":"https://codeload.github.com/qualcomm/qdlrs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qualcomm%2Fqdlrs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28003724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T14:05:44.363Z","updated_at":"2025-12-24T14:06:54.344Z","avatar_url":"https://github.com/qualcomm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qdl - Sahara / Firehose tools, in Rust!\n\nQualcomm SoCs feature the Emergency Download Mode (EDL, widely known as '9008 mode'), a bootrom-initiated device flashing stack.\n\n`qdl` provides a Rust implementation for the Sahara and Firehose protocols that are used to communicate with a device in that mode.\n\n## Contents\n```\ncli/ - A CLI tool used to communicate with devices in EDL mode\nqdl/ - Sahara / Firehose library, with USB convenience wrappers\nqramdump/ - Tool to receive memory dumps from a crashed device\n```\n\n## Building\nYou're expected to have a recent installation of Rust. You can acquire one with [rustup](https://rustup.rs).\n\u003c/br\u003eIf you already have an older installation, try `rustup update`.\n\nRun `cargo build [--release]` to build all executables within this repo. The binaries will appear in `target/debug/` or `target/release`, respectively.\n\nUse `cargo run [--release] --bin \u003cqdl-rs/qramdump\u003e [-- args]` to quickly build one of the programs from source and run it.\n\n## Running the programs\n\u003cdetails\u003e\n\n\u003csummary\u003eqdl-rs\u003c/summary\u003e\n\n```\nUsage: qdl-rs [OPTIONS] --loader-path \u003cFILE\u003e --storage-type \u003cemmc/ufs/nvme/nand\u003e \u003cCOMMAND\u003e\n\nCommands:\n  dump               Dump the entire storage\n  dump-part          Dump a single partition\n  flasher            Invoke the flasher\n  erase              Erase a partition\n  nop                Ask the device to do nothing, hopefully successfully\n  overwrite-storage  Overwrite the storage physical partition contents with a raw image Similar to Flasher, but this one only takes a partition dump as input and performs no real validation on the input data\n  peek               Peek at memory\n  print-gpt          Print the GPT table\n  reset              Restart the device\n  set-bootable-part  Mark physical storage partition as bootable\n  write              Write a partition\n  help               Print this message or the help of the given subcommand(s)\n\nOptions:\n      --backend \u003cusb/serial\u003e\n\n      --bypass-storage\n          Accept storage r/w operations, but make them never actually execute (useful for testing USB throughput)\n  -d, --dev-path \u003cDEV_PATH\u003e\n          E.g. COM4 on Windows\n  -l, --loader-path \u003cFILE\u003e\n\n      --hash-packets\n          Validate every packet. Slow.\n  -L, --phys-part-idx \u003cPHYS_PART_IDX\u003e\n          e.g. LUN index for UFS [default: 0]\n      --print-firehose-log\n\n      --read-back-verify\n          Every \u003cprogram\u003e operation is read back. VERY SLOW!\n      --reset-mode \u003cedl/off/system\u003e\n          WARNING: Will be deprecated in release v1.0.0 [default: edl]\n      --serial-no \u003cSERIAL_NO\u003e\n\n  -A, --skip-hello-wait\n          Work around missing HELLO packet\n  -s, --storage-type \u003cemmc/ufs/nvme/nand\u003e\n\n  -S, --storage-slot \u003cSTORAGE_SLOT\u003e\n          Index of the physical device (e.g. 1 for secondary UFS) [default: 0]\n      --sector-size \u003cSECTOR_SIZE\u003e\n\n      --skip-storage-init\n          Required for unprovisioned storage media.\n      --verbose-sahara\n\n      --verbose-firehose\n\n  -h, --help\n          Print help\n  -V, --version\n          Print version\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eqramdump\u003c/summary\u003e\n\n```\nUsage: qramdump [OPTIONS] [REGIONS_TO_DUMP]...\n\nArguments:\n  [REGIONS_TO_DUMP]...\n\nOptions:\n      --backend \u003cusb/serial\u003e\n  -d, --dev-path \u003cDEV_PATH\u003e    E.g. COM4 on Windows\n      --serial-no \u003cSERIAL_NO\u003e\n      --verbose-sahara\n  -h, --help                   Print help\n  -V, --version                Print version\n```\n\n\u003c/details\u003e\n\n### Windows\nYou'll need to acquire an appropriate driver that exposes the device as a USB serial port, or use [WinUSB](https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/winusb-installation).\n\nSerial is used as the default backend on this platform.\n\n### Loader filename on newer platforms\nSome newer platforms (e.g. SM8750) require that a file called `xbl_s_devprg_ns.melf` is used instead of `prog_firehose_ddr.elf`. This change may be opaque to you if the file has been renamed as part of the binary delivery process.\n\n### LUN handling\nDue to how the protocol is constructed, particularly when interfacing with UFS, you ***must*** specify the LUN (physical storage partition) index on which you want to operate. This does not concern the `flasher` command (rawproramN.xml files include that information) and operations that aren't storage-related (e.g. `peek` or `nop`).\n\n## Common usage examples\n\n\u003cdetails\u003e\n\u003csummary\u003eFlash a full META image\u003c/summary\u003e\n  \n### Example with UFS as primary storage, reboots to OS after flashing ends\n```\nqdl-rs -l prog_firehose_ddr.elf -s ufs --reset-mode system flasher -p rawprogram*.xml -x patch*.xml\n\n# NOTE: qdl-rs will flash anything you pass as a parameter. Some METAs ship a number of rawprogram0_foo.xml\n# files which may be undesirable (e.g. _WIPE_GPT). You can filter those out with e.g.:\nfind /path/to/build/ -regex '.*/rawprogram[0-9]+\\.xml$'\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eReboot the device back to the OS\u003c/summary\u003e\n\n```\nqdl-rs -l prog_firehose_ddr.elf -s ufs reset system\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDump the entire physical storage partition (e.g. LUN)\u003c/summary\u003e\n  \n```\nqdl-rs -l prog_firehose_ddr.elf -s ufs --phys-part-idx 2 dump -o lun2/\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFetch a single partition from LUN2\u003c/summary\u003e\n\n```\nqdl-rs -l prog_firehose_ddr.elf -s ufs --phys-part-idx 2 dump-part EFI\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eOverwrite a single partition on LUN0\u003c/summary\u003e\n\n```\nqdl-rs -l prog_firehose_ddr.elf -s ufs --phys-part-idx 0 write boot boot.img\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePrint out the partition table on LUN4\u003c/summary\u003e\n\n```\nqdl-rs -l prog_firehose_ddr.elf -s ufs --phys-part-idx 4 print-gpt\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eOverwrite the entirety of LUN7 (VERY dangerous, may remove device-unique data)\u003c/summary\u003e\n\n```\nqdl-rs -l prog_firehose_ddr.elf -s ufs --phys-part-idx 7 overwrite-storage lun7_dump.img\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eErase a partition on eMMC (VERY dangerous, may remove device-unique data)\u003c/summary\u003e\n\n```\nqdl-rs -l prog_firehose_ddr.elf -s emmc erase boot\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eSet LUN2 as bootable (i.e. containing xbl)\u003c/summary\u003e\n\n```\nqdl-rs -l prog_firehose_ddr.elf -s ufs set-bootable-part 2\n```\n\n\u003c/details\u003e\n\n## Documentation\n\nRun `cargo doc --open` to generate and open the latest rustdoc. Learn more [here](https://doc.rust-lang.org/cargo/commands/cargo-doc.html).\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](/CONTRIBUTING.md).\nYour code is expected to pass `cargo fmt` and `cargo clippy` checks - the CI will be on the lookout for that.\n\n## License\n\nSee the [`LICENSE` file](/LICENSE).\n\n## Credits\n\n* [linux-msm/qdl](https://github.com/linux-msm/qdl) for the open C implementation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqualcomm%2Fqdlrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqualcomm%2Fqdlrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqualcomm%2Fqdlrs/lists"}