Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to flash SGS 5 #203

Open
gumbi2400 opened this issue May 27, 2014 · 26 comments
Open

Unable to flash SGS 5 #203

gumbi2400 opened this issue May 27, 2014 · 26 comments

Comments

@gumbi2400
Copy link

I've been attempting to root my SGS 5 (International) on OSX. The device is detected, but when performing an action (e.g. print-pit) It will fail. The specific error I see when using verbose output is:

ERROR: libusb error -7 whilst sending bulk transfer. Retrying...

Looking at the OSX specific logs I see:

kernel[0]: USBF: 88081. 66 AppleUSBEHCI::Found a transaction past the completion deadline on bus 0x1d, timing out! (Addr: 6, EP: 1)

This is both with the stock cable, as well as an old one that is known to be a good cable that I've used in the past. I have also tried on multiple different laptops (both Apple) with the same results.

Please let me know if any additional information is needed.

@Benjamin-Dobell
Copy link
Owner

@gumbi2400 What Heimdall version?

@gumbi2400
Copy link
Author

This would be using the latest Git build (1.4.1) as well as the stable 1.4.0.

@Benjamin-Dobell
Copy link
Owner

Could you please included the complete verbose output?

Also, have you installed Kies on your Mac in the past?

@gumbi2400
Copy link
Author

I haven't installed Kies (its a relatively fresh OSX install). Below is the pastebin with the verbose output:

http://pastebin.com/QTqfHKqc

@gumbi2400
Copy link
Author

A quick update. I fired up USB Prober and got a bit more detailed logs from OSX. Not sure if it helps, but here you go:

May 30 13:11:29.887 [1] AppleUSBEHCI::Found a transaction past the completion deadline on bus 0x1d, timing out! (Addr: 6, EP: 1)
May 30 13:11:29.887 [6] AppleUSBEHCI[0xffffff80fda88000]::HaltAsyncEndpoint - unlinking, halting, and relinking (0xffffff803f415c80)
May 30 13:11:29.888 [2] AppleUSBEHCI[0xffffff80fda88000]::ReturnOneTransaction - found the end of a non-multi transaction(0xffffff803ebfdef8)!
May 30 13:11:29.888 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions, pED(0xffffff803f415c80) until (0xffffff803ebfda78), clearToggle: 1
May 30 13:11:29.888 [5] AppleUSBEHCI[0xffffff80fda88000] returnTransactions: removing TDs
May 30 13:11:29.888 [5] AppleUSBEHCI[0xffffff80fda88000] returnTransactions: updating _qTD->pShared->flags(0x4008c80) to GetSharedLogical()->qTDFlags (0x82008c41)
May 30 13:11:29.888 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions, pED->qTD flags were 0
May 30 13:11:29.888 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions, pED->qTD flags now 0
May 30 13:11:29.888 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions, pED->qTD (L:0xffffff803ebfda78 P:0x22c940) pED->TailTD (L:0xffffff803ebfda78 P:0x22c940)
May 30 13:11:29.888 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions: clearing ED bit, qTDFlags = 82008c41
May 30 13:11:29.888 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions: calling back the done queue (after ED is made active)
May 30 13:11:29.889 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions: after bit clear, qTDFlags = 0

It looks like it's reaching out to the phone, and after setting up the connection, the phone stops responding. Again, not sure if it helps, but just thought I would throw that out there.

@gumbi2400
Copy link
Author

Oh and I forgot to mention that it is being improperly identified as "MSM8960" When in reality it should be "MSM8974AC"

@Benjamin-Dobell
Copy link
Owner

@gumbi2400 The misreporting of the chipset is due to Samsung not updating the value in their secondary bootloader. This is surprisingly common, however it does not have any impact on the ability to flash your device.

However, I've just made a new commit that might help help. Please pull the latest changes on the master branch, compile, and let me know if it works..

@gumbi2400
Copy link
Author

I gave it another try. I see the code change, it looks like it's probably the same issue. Here is the newest verbose output:

http://pastebin.com/1r6ZnHpF

I'll see if I can get more info from the OSX system logs.

@gumbi2400
Copy link
Author

Finally got the system USB logs.

AppleUSBEHCI::Found a transaction past the completion deadline on bus 0x1d, timing out! (Addr: 6, EP: 1)
Jun 2 09:10:30.204 [6] AppleUSBEHCI[0xffffff80fda88000]::HaltAsyncEndpoint - unlinking, halting, and relinking (0xffffff803f415280)
Jun 2 09:10:30.206 [2] AppleUSBEHCI[0xffffff80fda88000]::ReturnOneTransaction - found the end of a non-multi transaction(0xffffff803ebfdb98)!
Jun 2 09:10:30.206 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions, pED(0xffffff803f415280) until (0xffffff803ebfdd00), clearToggle: 1
Jun 2 09:10:30.206 [5] AppleUSBEHCI[0xffffff80fda88000] returnTransactions: removing TDs
Jun 2 09:10:30.206 [5] AppleUSBEHCI[0xffffff80fda88000] returnTransactions: updating _qTD->pShared->flags(0x88d80) to GetSharedLogical()->qTDFlags (0x88d40)
Jun 2 09:10:30.206 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions, pED->qTD flags were 0
Jun 2 09:10:30.206 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions, pED->qTD flags now 0
Jun 2 09:10:30.206 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions, pED->qTD (L:0xffffff803ebfdd00 P:0x22cb80) pED->TailTD (L:0xffffff803ebfdd00 P:0x22cb80)
Jun 2 09:10:30.206 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions: clearing ED bit, qTDFlags = 88d40
Jun 2 09:10:30.206 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions: calling back the done queue (after ED is made active)
Jun 2 09:10:30.206 [5] AppleUSBEHCI[0xffffff80fda88000]::returnTransactions: after bit clear, qTDFlags = 0
Jun 2 09:10:35.209 [2] AppleUSBEHCI[0xffffff80fda88000]::CheckEDListForTimeout - Found a TD [0xffffff803ebfdd00] on QH [0xffffff803f415280] past the completion deadline, timing out! (0x1e56e26 - 0x1e5626b)
Jun 2 09:10:35.209 [1] AppleUSBEHCI::Found a transaction past the completion deadline on bus 0x1d, timing out! (Addr: 6, EP: 1)

This just repeats quite a few times. Hope it helps.

@ulidtko
Copy link

ulidtko commented Jul 5, 2014

Same on Linux, logs:

% heimdall/heimdall print-pit --verbose
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...
      Manufacturer: "SAMSUNG"
           Product: "Gadget Serial"

            length: 18
      device class: 2
               S/N: 0
           VID:PID: 04E8:685D
         bcdDevice: 021B
   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: 83
           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: 02
           max packet size: 0200
          polling interval: 00
Claiming interface...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Initialising protocol...
ERROR: Failed to receive handshake response. Result: -7
ERROR: Protocol initialisation failed!

Releasing device interface...
Re-attaching kernel driver...

@Benjamin-Dobell
Copy link
Owner

@ulidtko Your problem is different than gumbi2400's. Your flash is failing during protocol initialisation, whilst gumbi2400 gets past that point. This makes me think your problem is a result of a faulty USB cable or USB port/hub. If you could please try again with a different cable and USB port that would be great. If you continually get failures during protocol initialisation then please open another issue and include as much detail as possible (in particular your device model).

@Benjamin-Dobell
Copy link
Owner

@gumbi2400 Can you please try the latest commit on the master branch, I've made a change which I'm hoping will solve your problem.

@ulidtko
Copy link

ulidtko commented Jul 5, 2014

@Benjamin-Dobell tried with another cable, result is the same. Also, adb works fine over both cables, so I don't think it's a USB hardware problem.

Your latest commit doesn't help too. Also,

/usr/include/libusb-1.0/libusb.h:1074:  LIBUSB_ERROR_TIMEOUT = -7,

but yeah, that doesn't tell much.

@gumbi2400
Copy link
Author

Looks like still the same error:

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...
Manufacturer: "Sasmsung"
Product: "MSM8960"

        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.

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...
ERROR: libusb error -7 whilst sending bulk transfer. Retrying...
ERROR: libusb error -7 whilst sending bulk transfer. Retrying...
ERROR: libusb error -7 whilst sending bulk transfer. Retrying...
ERROR: libusb error -7 whilst sending bulk transfer. Retrying...
ERROR: libusb error -7 whilst sending bulk transfer. Retrying...
ERROR: libusb error -7 whilst sending bulk transfer.
ERROR: Failed to send request to end PIT file transfer!
ERROR: Failed to download PIT file!
Ending session...

Let me know if you want system logs as well.

@ulidtko
Copy link

ulidtko commented Jul 9, 2014

I've captured the USB traffic of the Heimdall session with my SGS5 using Wireshark: https://gist.github.com/ulidtko/f34303b9ef5c05e0faa4

The gist contains Heimdall's log with libusb debug logging enabled, a textual export of Wireshark capture, and the binary capture file itself.

@srhb
Copy link

srhb commented Sep 13, 2014

While this patch works for me with print-pit and flashing recovery, download-pit appears to be broken still.

❯ sudo ./heimdall download-pit --output out.pit --no-reboot --verbose
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...
      Manufacturer: "Sasmsung"
           Product: "MSM8960"

            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...
ERROR: Failed to receive handshake response. Result: -7
ERROR: Protocol initialisation failed!

Releasing device interface...

@phillipberndt
Copy link

Regarding the timeout (-7) problem upon protocol initialization, that seems to be a driver related issue: With my G900F (S5), the problem goes away if I run wireshark/usbmon while trying to run heimdall. That's only a workaround and probably won't help resolving this bug, but maybe this information helps others...

@promovicz
Copy link

I also have problems getting heimdall to work with various GS5 (model SM-G900F) that I use.

Protocol initialization and session start work for me, but the PIT download fails.

My heimdall is my own build of the latest master, without the GUI.

I am willing to provide timely updates on this as this is work-related for me.

Complete log:

prom@somehost:~/klte$ sudo heimdall flash --BOOT boot.img --RECOVERY recovery.img --SYSTEM system.img --USERDATA userdata.img
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...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Initialising protocol...
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: Failed to send request to end PIT file transfer!
ERROR: Failed to download PIT file!
Ending session...
ERROR: Failed to send end session packet!
Releasing device interface...
Re-attaching kernel driver...

@sshimko
Copy link

sshimko commented Sep 19, 2014

@promovicz did you try the patch referenced above #225?

@promovicz
Copy link

@sshimko I just did and it worked flawlessly! Thanks for the tip!

@Astragalus
Copy link

Chiming in again: I was able to download the pit file for my T-Mobile Samsung Galaxy S5 (SM-G900T aka kltetmo) using the fork of @sshimko (nice - btw is there a reason his changes haven't been pulled to master yet?) - however - flashing did not succeed. Here is the output - please let me know what I can provide that would help otherwise! (Apologies if this is old hat)

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...
      Manufacturer: "Sasmsung"
           Product: "MSM8960"

            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...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Initialising protocol...
ERROR: Failed to receive handshake response. Result: -7
ERROR: Protocol initialisation failed!

Releasing device interface...
Re-attaching kernel driver...

@sshimko
Copy link

sshimko commented Oct 10, 2014

@Astragalus based on the last line this is Linux right? Probably won't help, but could you try pull request #231? I was focused on OS X fixes for that one, but I was testing on both Fedora 20 and OS X and the fixes on OS X required further fixes to work on Fedora. Resolving those conflicts might impact other init problems.

@Astragalus
Copy link

I am indeed on linux (Mint, fwiw) - I was working from your gs5 branch but so far none of the silly things I've tried have stopped it from timing out when waiting for the handshake response. I'll try merging in your osx stuff now and see what I can do... Many thanks @sshimko !

@Turkzilla
Copy link

SM-G900T OSX Mavericks
heimdall flash --stdout-errors --verbose --no-reboot --BOOT boot.img --CACHE cache.img.ext4 --RECOVERY recovery.img
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: "MSM8960"

        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 #1 failed. Result: 1025344
WARNING: Control transfer #2 failed. Result: -9
WARNING: Control transfer #2 failed. Result: 998992
WARNING: Control transfer #3 failed. Result: -9
WARNING: Control transfer #3 failed. Result: 998240
WARNING: Control transfer #4 failed. Result: -9
WARNING: Control transfer #4 failed. Result: 1031904
WARNING: Control transfer #5 failed. Result: -9
WARNING: Control transfer #5 failed. Result: 998240
WARNING: Control transfer #6 failed. Result: -9
WARNING: Control transfer #6 failed. Result: 998992
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.ERROR: libusb error 250 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 998240 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 998960 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 998960 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 1031904 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 998960 whilst sending packet.

ERROR: Failed to send request to end PIT file transfer!
ERROR: Failed to send request to end PIT file transfer!
ERROR: Failed to download PIT file!
ERROR: Failed to download PIT file!
Ending session...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 250 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 1031904 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 998208 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 998992 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 1031904 whilst sending packet. Retrying...
Retrying...
ERROR: libusb error -7 whilst sending packet.ERROR: libusb error 998208 whilst sending packet.

ERROR: Failed to send end session packet!
ERROR: Failed to send end session packet!
Releasing device interface...

Downloaded latest libusb, compiled and installed; again, same result.

@JochenHoch2
Copy link

Hi @ALL,

for what it's worth: A self-compiled heimdall from current master (as of 28.7.2016 - sorry, no commit ID...) had absolutely no problems with my SM-G900F (S5 international version/klte). I did have a bad USB port/cable combination (USB device resetting after every open()), but changing cables did the trick.

What I did:

  • Compiled heimdall from master on Kubuntu 16.04 by following Linux/README.
  • Updated stock ROM to 6.0.1 on phone
  • Entered Download Mode
  • Downloaded PIT without rebooting, worked correctly
  • Printed PIT without rebooting, worked correctly
  • Flashed TWRP 3.0.1, worked correctly
  • Booted into Recovery

Hope this helps anyone!

@ghost
Copy link

ghost commented Nov 29, 2016

FYI I just had success using the commandline (not frontend) compiled from source 1.4.1 on Samsung Galaxy S5 G900F #348 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants