Flash OpenStick on HMUF02-V05

OpenStick Build Guide · MSM8916

Flashing Debian onto the HMUF02-V05 4G Dongle

A complete, no-steps-skipped walkthrough for turning a ~$10 HiMI "UFI" MSM8916 4G LTE Wi-Fi dongle into a 64-bit Debian Linux computer - done entirely from a Raspberry Pi over SSH, with a full calibration backup so your IMEI survives.

Board: HMUF02-V05 (zbx002) SoC: MSM8916 / Snapdragon 410 RAM: 512 MB Flash: 4 GB eMMC Host: Raspberry Pi (Linux)
The 4G LTE USB modem (HiMI / MSM8916 family) this build targets
The cheap 4G LTE USB modem this build targets - a HiMI / MSM8916 family dongle.
Read this first

This rewrites low-level eMMC partitions over Qualcomm EDL. Done carefully it is reversible, but a skipped backup can permanently kill cellular on your stick. The fsg, modemst1/2 and fsc partitions hold your factory IMEI and RF calibration - they are unique to your device and cannot be downloaded from anywhere. Do Step 4 before you flash anything. You do this at your own risk.

Step 1

What you need

Why a Raspberry Pi

The Pi gives you a clean Linux host with working adb, fastboot and edl, and sidesteps the Windows Qualcomm 9008 driver headaches entirely. Plug the dongle directly into a USB port, not through an unpowered hub - it draws a fair bit of current at boot.

Step 2

Install the tools on the Pi

SSH into your Pi and install the Android platform tools plus bkerler/edl, the Qualcomm EDL/Firehose client. ModemManager on the Pi will grab Qualcomm serial ports and interfere with EDL, so remove it from the Pi.

Pi - terminal
# platform tools + build/usb deps
sudo apt update
sudo apt install -y adb fastboot git python3-pip python3-venv libusb-1.0-0 tmux

# ModemManager breaks EDL - remove it on the Pi (not the dongle)
sudo apt purge -y modemmanager
Pi - terminal
# clone and install edl in a virtualenv
git clone https://github.com/bkerler/edl.git ~/edl
cd ~/edl
git submodule update --init --recursive
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install .

# install the udev rules so edl can reach USB without root
sudo cp Drivers/*.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
About "Keystone library is missing"

If pip install complains about keystone-engine failing to build, ignore it. Keystone is optional - it is only used for some loader patching, not for the backup or flash. Everything in this guide works without it, and edl will simply print "Keystone library is missing (optional)" and carry on.

Step 3

Connect and identify the stick

Plug the dongle into the Pi and give it ~30 seconds to boot (its Wi-Fi network will appear). The stock firmware exposes ADB. Confirm the Pi sees it:

Pi - terminal
lsusb | grep -i 05c6
adb devices
adb shell getprop | grep -iE "model|board|product|manufacturer"

On a HMUF02-V05 you'll see a Qualcomm device (05c6:9024), one attached ADB device, and properties reporting ro.product.manufacturer: HiMI, ro.product.model: UFI, and ro.board.platform: msm8916. That confirms you're on the right hardware.

Fix the Pi's internet route

The moment the dongle is plugged in, it hands the Pi a usb0 address (e.g. 192.168.100.x) and a default route with no working data behind it - so the Pi loses internet. If ping 1.1.1.1 hangs, delete the dongle's default route. Check first with ip route, then:

Pi - terminal
sudo ip route del default dev usb0
# make it permanent so it never steals the default route again
CON=$(nmcli -t -f NAME,DEVICE con show --active | grep ':usb0' | cut -d: -f1)
sudo nmcli con mod "$CON" ipv4.never-default yes ipv6.never-default yes
Step 4a

Enter EDL mode - the button trick

EDL (Emergency Download, USB ID 05c6:9008) is the low-level mode where you back up and flash. On most MSM8916 sticks you can trigger it with adb reboot edl - but not on this firmware.

The HMUF02-V05 quirk

On this board's stock firmware, adb reboot edl lands in Qualcomm diagnostic mode (05c6:9091), not EDL. The stock bootloader also doesn't understand fastboot oem reboot-edl. EDL is entered by the physical button only.

So do it by hand:

  1. Unplug the dongle.
  2. Find the small reset/recovery button on the PCB.
  3. Hold the button down, plug the stick into the Pi, keep holding ~3 seconds, then release.
  4. Check for the 9008 device:
Pi - terminal
lsusb | grep 9008
Success looks like

Bus 001 Device 0xx: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode) - the stick's LED usually goes dark and its Wi-Fi disappears. That's normal; you're now in EDL.

If you can't find or reach the button, the alternative is shorting the EDL test point to ground while plugging in - but the button is far easier, so try it a few times first.

Step 4b

Back up calibration and the full eMMC

This is the step you never skip. Run it inside tmux so an SSH drop can't kill a multi-minute dump halfway through.

Pi - terminal
tmux new -s backup
cd ~/edl && source venv/bin/activate
mkdir -p ~/stick-backup/critical && cd ~/stick-backup/critical

First, dump the small, irreplaceable partitions one by one (this takes about a minute total):

Pi - EDL
# IMEI, RF calibration, modem, and the stock boot chain
for p in fsc fsg modemst1 modemst2 persist sec modem \
         sbl1 aboot rpm tz hyp boot config; do
    edl r $p $p.bin || echo "FAILED: $p"
done
ls -lh

Confirm the files exist and match these sizes before going further. Zero-byte files mean a bad dump - redo them.

FileExpected sizeHolds
fsg.bin1.5 MBRF calibration
modemst1.bin1.5 MBIMEI / modem state
modemst2.bin1.5 MBIMEI / modem state
fsc.bin1 KBModem filesystem ctrl
persist.bin32 MBWi-Fi / BT calibration
modem.bin64 MBModem firmware
sec.bin16 KBSecurity / fuses
aboot / sbl1 / rpm / tz / hyp0.5–1 MBStock boot chain
boot.bin16 MBStock Android boot

Then take a complete 1:1 image of the whole eMMC - the ultimate "undo button" (~3.7 GB, around 12 minutes):

Pi - EDL
cd ~/stick-backup
edl rf full_emmc.bin

# verify size and checksum everything
stat -c %s full_emmc.bin        # ~3909091328 bytes
sha256sum critical/*.bin full_emmc.bin > SHA256SUMS
Harmless noise you'll see

Sector size in XML 4096 does not match disk sector size 512 and Host's payload to target size is too large are expected on this board and don't affect the dump. If a partition read stalls at ~0.05 MB/s, press Ctrl+C, re-enter EDL with the button, and continue - the files already written are fine.

Copy it off the Pi

Copy the whole ~/stick-backup folder to another machine (and ideally a second place). If the Pi's SD card dies, so does your only way back to stock.

Your PC
scp -r pi@<pi-ip>:~/stick-backup .
Step 5

Flash OpenStick Debian

The cleanest route for this board is the Basistiy/openstick-installer, which has a dedicated HMUF02 profile. It downloads a universal Debian image, injects your calibration partitions into it, and flashes it over EDL. It's pure Python + edl, so it runs fine on the Pi.

Pick HMUF02 - never UZ801

The installer also lists UZ801 and HM-MIFIB. Those flash a full eMMC image that rewrites the whole boot chain and partition table. Choosing the wrong board for your stick replaces your board's own bootloader and breaks it. On a HMUF02-V05, select HMUF02 and nothing else.

Pi - terminal
cd ~
git clone https://github.com/Basistiy/openstick-installer.git
cd openstick-installer

# hand it the calibration you already dumped
mkdir -p calibration
cp ~/stick-backup/critical/{modemst1,modemst2,fsg,fsc,persist,sec,modem}.bin calibration/

# run inside tmux; over SSH, call main.py directly (run.sh wants a desktop terminal)
tmux new -s flash
python3 main.py

Then follow the menu:

  1. Select board: choose 2 · HMUF02
  2. Backup original partitions? Answer n - you already have a verified backup in calibration/, which this step uses. (Answering yes just repeats the ~12-min dump.)
  3. When it waits for the device in EDL: unplug the stick, hold the button, plug it back into the Pi.
  4. Choose next action: 1 · Install Linux (Debian). It downloads the HMUF02 image, injects your calibration, and flashes with edl wf.
  5. Don't touch anything during the flash (a few minutes). It resets the stick when done.
Sanity check before it writes

When the installer names the image it's about to flash, confirm it says HMUF02. If you ever see it about to flash a UZ801 image onto this stick, stop immediately.

Step 6

First login and network

After it reboots, the stick comes up as a USB network adapter and hands your Pi an address on its subnet (typically 192.168.5.x). The stick itself is .1:

Pi - terminal
ssh [email protected]
# password: 1
Common mix-up

If SSH rejects the password 1, check the address - you may be SSHing into the Pi's own IP (e.g. 192.168.5.242), where no user account exists. The dongle is always the .1 gateway address, not whatever DHCP gave the Pi.

Once in, confirm the port and do basic housekeeping:

On the stick
cat /proc/device-tree/model     # should name the board
uname -a
passwd                          # change the default "1"
sudo apt update && sudo apt upgrade -y

To bring up cellular (with an active SIM inserted), the calibration you restored means your IMEI is intact:

On the stick
mmcli -L                        # list the modem
mmcli -m 0                      # shows IMEI if calibration is good
sudo nmcli con add type gsm ifname '*' con-name lte apn <your-APN>
sudo nmcli con up lte
ping -c 3 1.1.1.1
Default access points

USB: ssh [email protected] (or 192.168.68.1), password 1, root via sudo su.
Wi-Fi fallback: SSID Openstick, password openstick, stick at 192.168.4.1. Exact IPs vary slightly by image.

Step 7

Restoring stock (recovery)

Because you kept a full backup, you can always go back - to stock Android, or to redo the flash. Enter EDL with the button, then either use the installer's 2 · Restore Stock Backup option, or restore partitions directly:

Pi - EDL
cd ~/edl && source venv/bin/activate
cd ~/stick-backup/critical

# write back the full image (safest, complete restore)
edl wf ~/stick-backup/full_emmc.bin
edl reset

# - or - just restore calibration if only the modem broke
for p in fsg modemst1 modemst2 fsc sec persist; do
    edl w $p $p.bin
done
edl reset
Why this matters

As long as full_emmc.bin and the critical/ files are safe on another machine, this dongle is effectively un-brickable over EDL - the button always gets you back to 9008, and EDL writes below Android.

Step 8

Troubleshooting

9008 never appears after the button

Hold the button before plugging in and keep holding a few seconds after. Try a different USB port, directly on the Pi. If you only ever get 05c6:9091 (diag) or 9024 (normal boot), that's the firmware ignoring software EDL - the button is the only reliable way in on this board.

"No loader given" and edl just waits

That means no 9008 device is connected yet - edl is waiting for one. Confirm lsusb | grep 9008 shows the device first; re-do the button trick if it doesn't.

A dump stalls at ~0.05 MB/s

Press Ctrl+C, re-enter EDL, and continue. The individual critical/ partition files are what matter for recovery; a stalled tail on the full image doesn't cost you them.

SSH password "1" rejected after flashing

You're on the wrong IP - that's the Pi answering, not the stick. Use the .1 address of the dongle's subnet. Clear a stale host key with ssh-keygen -R 192.168.5.1 if it complains.

Modem won't enable / no IMEI

Check mmcli -m 0 - if the IMEI is blank or zeroed, restore modemst1, modemst2 and fsg from your backup (see Step 7). Also make sure the image you flashed was the HMUF02 one, not a mismatched board's.