5

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
http://www.glassechidna.com.au/

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

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

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.

Thanks.

6

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
1

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!
1

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.

1

I had similar issues, it turned out thet it only worked with heimdall v1.4.2 on my linux mint 19 system

THE SITUATION WITH HEIMDALL 1.4.0:

OS:LinuxMint 19 (tara) Kernel 4.20.0-042000-generic

heimdall flash --REOVERY /home/user/Downloads/twrp-3.3.1-0-gts210vewifi.img --pit /home/user/s2a.pit --no-reboot --verbose 
Heimdall v1.4.0

Copyright (c) 2010-2013, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

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

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
      Manufacturer: "Sasmsung"
           Product: "MSM8952"

            length: 18
      device class: 2
               S/N: 0
           VID:PID: 04E8:685D
         bcdDevice: 0100
   iMan:iProd:iSer: 1:2:0
          nb confs: 1

interface[0].altsetting[0]: num endpoints = 1
   Class.SubClass.Protocol: 02.02.01
       endpoint[0].address: 82
           max packet size: 0010
          polling interval: 09

interface[1].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: 0A.00.00
       endpoint[0].address: 81
           max packet size: 0200
          polling interval: 00
       endpoint[1].address: 01
           max packet size: 0200
          polling interval: 00
Claiming interface...
Setting up interface...

Initialising protocol...
WARNING: Control transfer #1 failed. Result: -9
WARNING: Control transfer #2 failed. Result: -9
WARNING: Control transfer #3 failed. Result: -9
WARNING: Control transfer #4 failed. Result: -9
WARNING: Control transfer #5 failed. Result: -9
WARNING: Control transfer #6 failed. Result: -9
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet.
ERROR: Failed to send request to end PIT file transfer!
ERROR: Failed to download PIT file!
Ending session...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet. Retrying...
ERROR: libusb error -7 whilst sending packet.
ERROR: Failed to send end session packet!
Releasing device interface...



    heimdall download-pit --output s2.pit --verbose
    Heimdall v1.4.0

    Copyright (c) 2010-2013, Benjamin Dobell, Glass Echidna
    http://www.glassechidna.com.au/

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

    If you appreciate this software and you would like to support future
    development please consider donating:
    http://www.glassechidna.com.au/donate/

    Initialising connection...
    Detecting device...
          Manufacturer: "Sasmsung"
               Product: "MSM8952"

                length: 18
          device class: 2
                   S/N: 0
               VID:PID: 04E8:685D
             bcdDevice: 0100
       iMan:iProd:iSer: 1:2:0
              nb confs: 1

    interface[0].altsetting[0]: num endpoints = 1
       Class.SubClass.Protocol: 02.02.01
           endpoint[0].address: 82
               max packet size: 0010
              polling interval: 09

    interface[1].altsetting[0]: num endpoints = 2
       Class.SubClass.Protocol: 0A.00.00
           endpoint[0].address: 81
               max packet size: 0200
              polling interval: 00
           endpoint[1].address: 01
               max packet size: 0200
              polling interval: 00
    Claiming interface...
    Setting up interface...

    Initialising protocol...
    WARNING: Control transfer #1 failed. Result: -9
    WARNING: Control transfer #2 failed. Result: -9
    WARNING: Control transfer #3 failed. Result: -9
    WARNING: Control transfer #4 failed. Result: -9
    WARNING: Control transfer #5 failed. Result: -9
    WARNING: Control transfer #6 failed. Result: -9
    ERROR: Failed to receive handshake response. Retrying...
    ERROR: Failed to receive handshake response. Retrying...
    ERROR: Failed to receive handshake response. Retrying...
    ERROR: Failed to receive handshake response. Retrying...
    ERROR: Failed to receive handshake response.
    ERROR: Protocol initialisation failed!

    Releasing device interface...

THE FIX:

...found this helpfull article and installed Heimdall v1.4.2

HOW TO INSTALL HEIMDALL VERSION 1.4.2 ON UBUNTU 16 AND UP

to install ver. 1.4.2 do the following:

sudo apt purge heimdall-flash
sudo apt install build-essential cmake zlib1g-dev qt5-default libusb-1.0-0-dev libgl1-mesa-glx libgl1-mesa-dev
cd ~
wget https://gitlab.com/BenjaminDobell/Heimdall/-/archive/master/Heimdall-master.tar.gz
tar -xvf Heimdall-master.tar.gz
cd Heimdall-master/
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo mv ./bin/heimdall* /usr/local/bin

check success with

heimdall version
v1.4.2

After this operation the bahavior changed as follows:

heimdall flash --RECOVERY /home/user/Downloads/twrp-3.3.1-0-gts210vewifi.img --pit /home/chris/s2.pit --no-reboot --verbose 
Heimdall v1.4.2

Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

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

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
      Manufacturer: "Sasmsung"
           Product: "MSM8952"

            length: 18
      device class: 2
               S/N: 0
           VID:PID: 04E8:685D
         bcdDevice: 0100
   iMan:iProd:iSer: 1:2:0
          nb confs: 1

interface[0].altsetting[0]: num endpoints = 1
   Class.SubClass.Protocol: 02.02.01
       endpoint[0].address: 82
           max packet size: 0010
          polling interval: 09

interface[1].altsetting[0]: num endpoints = 2
   Class.SubClass.Protocol: 0A.00.00
       endpoint[0].address: 81
           max packet size: 0200
          polling interval: 00
       endpoint[1].address: 01
           max packet size: 0200
          polling interval: 00
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...

Some devices may take up to 2 minutes to respond.
Please be patient!

WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
Session begun.

WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
Downloading device's PIT file...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
PIT file download successful.

Uploading RECOVERY
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
0%WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...

7%

14%

21%

28%

35%

42%

49%

56%

63%

70%

77%

85%

92%

99%

100%
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
RECOVERY upload successful

Ending session...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
ERROR: libusb error -7 whilst receiving bulk transfer. Retrying...

Releasing device interface...

before the operation I unplugged and replugged the Tablet

so I could flash the TWRP

HAPPY

0

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.