I want to install CyanogenMod on my Samsung Galaxy S5. I'd downloaded the version and did the excact steps from the wiki. But when I try to flash with Heimdall I get this error:

Ubuntu-Laptop:~/Downloads/cm-12.1-20151007-SNAPSHOT-YOG4PAO333-klte$ sudo heimdall flash --RECOVERY boot.img --no-reboot
Heimdall v1.4.1

Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna

This software is provided free of charge. Copying and redistribution is

If you appreciate this software and you would like to support future
development please consider donating:

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
ERROR: Protocol initialisation failed!

Releasing device interface...

I didn't find anything with Google. Please help.



I was experiencing the same problem, and I found a solution that worked for me in a comment on Heimdall issue #228.

The problem for me was that udev was reserving the phone as a modem when I plugged it in. If you run dmesg and see a line that says "This device cannot do calls on its own. It is not a modem.", then this could work for you.

As root, create a file named /etc/udev/rules.d/79-samsung.rules with the following content:

ATTRS{idVendor}=="04e8", ENV{ID_MM_DEVICE_IGNORE}="1"

Then restart udev with "sudo service udev restart", and unplug/replug the device, and you can try to install again.

If that doesn't work or if it's a different problem, you can edit your question to add the output of these commands:

heimdall detect --verbose --usb-log-level debug
sudo heimdall print-pit --verbose --no-reboot
  • 1
    If only I could hug you. Now I have to deal with ERROR: libusb error -4 whilst sending bulk transfer. Retrying... :S – 智障的人 Jan 25 '16 at 20:35

This happened for me on v1.4.1. There's a few ways to fix it:

  1. Ensure you have the latest & greatest version of Heimdall
  2. Install all this:
sudo apt-get install build-essential cmake zlib1g-dev qt5-default libusb-1.0-0-dev libgl1-mesa-glx libgl1-mesa-dev
  1. Reboot your computer
  2. Try connecting on a different USB port - 3 of my USB ports didn't work, and one did!

If none of the answers above worked, the answer might be as silly as it turned out to be for me.

Two things you might need to try before bumping your head into your screen:

Potential Fix 1: Reboot in download mode without having the USB plugged in and only plug it in after having pressed the button that allows you to continue embarking on this dangerous journey (Volume Up button I presume). Afterwards, if you haven't already done so, replace the drivers with Zadig and Heimdall might work. I'm guessing this was the fix for me, but it might aswell have been...

Potential Fix 2: Reboot your mobile device after replacing the drivers with Zadig. Yeah, super silly, but this might have easily been the fix (as the first fix required me to reboot).

Hope no one cracks a skull.


I also had a similar problem. I added the udev rule as suggested in GitHub (link above), but the phone still wouldn't download. Then I found another simple solution on GitHub:

  1. Disconnect the USB cable.
  2. Setup the flash in Heimdall Frontend or command line.
  3. Boot the phone into Download Mode.
  4. AFTER it's in Download Mode plug in the USB and flash immediately.

It worked like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.