Benjamin-Dobell / Heimdall

Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung Galaxy devices.
MIT License
2.6k stars 585 forks source link

New(?) Device: GT-I9500 #141

Open tapicer opened 11 years ago

tapicer commented 11 years ago

I'm using the latest version on Mac to flash a recovery to a Galaxy S4 (i9500) and it's failing (same thing happens on Linux). See below the commands I run. I've tried on several machines and with several images, it always fails. I can provide more info if needed.

Jonathans-MacBook-Pro:CF-Auto-Root-ja3g-ja3gxx-gti9500 tapicer$ heimdall flash --recovery CF-Auto-Root-ja3g-ja3gxx-gti9500.tar.md5 --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: "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...
Setting up interface...

Initialising protocol...
WARNING: Control transfer #2 failed. Result: -7
WARNING: Control transfer #3 failed. Result: -7
WARNING: Control transfer #4 failed. Result: -7
WARNING: Control transfer #5 failed. Result: -7
WARNING: Control transfer #6 failed. Result: -1
ERROR: Failed to send data: "ODIN"
Releasing device interface...
Benjamin-Dobell commented 11 years ago

Have you read the README? Because the command you've used won't work for several reasons.

However, the error you're getting is unrelated to the incorrect command and seems to be a libusbx error communicating with your device. I don't know precisely the cause as there are many possibilities. However, it's not a bug with Heimdall but rather something to do with your particular setup (EDIT: Presumptuous on my behalf, and seemingly incorrect).. If you've installed it, please uninstall Samsung Kies, making sure the kernel extensions it installed are deleted.

If you don't have Samsung Kies then it's possible your USB cable or USB port is damaged, try a different port/cable and if necessary a powered USB hub.

tapicer commented 11 years ago

Yes, I have read the README, I'm using this command because it's recommended by Cyanogenmod. I have tried to use the print pit option from the frontend. The device is detected correctly, but for the print pit from device option it ends with this error: ERROR: Failed to send data!Releasing device interface.... I am sure that Kies is uninstalled and that the USB port works. I have tried this both on Mac and Linux and I get the same error in both environments. So, I still think this is a bug with Heimdall. I can provide more debug info if needed.

Benjamin-Dobell commented 11 years ago

Hmm, for some reason I was under the impression that users had reported success with the GT-I9500. However, I can't find reference to that, so I guess I was mistaken.

You wouldn't happen to have access to a Windows machine would you?

If you are able to gain access to a computer running Windows at some point and follow the instructions in this (http://www.youtube.com/watch?v=qFIg5fu0PTg) video that would be immensely appreciated. Please excuse the general crudeness of the video!

Obviously one of the main benefits to Heimdall is supposed to be that you don't need Windows. However there are a lot of Samsung device variants out there so it's pretty impossible for me to get a hold of them all. The only way I can test and support new devices is to either physically get my hands on a device, or to look at a USB packet captures of flashing a device with Kies (or Odin).

Having physical access to a device is by far the best option, but a USB capture is the bare minimum requirement for adding/fixing support for a particular device.

tapicer commented 11 years ago

I'm sorry but I don't have a Windows machine I can use, I would have used Odin to root in that case. I've tried with a Virtual Machine but I can't get it to detect the device.

Benjamin-Dobell commented 11 years ago

@tapicer Heimdall's most popular platform by number of downloads is actually Windows. A lot of people use Heimdall over Odin because it's open-source, more reliable (for supported devices anyway) and 100% legal. The legality of Odin is somewhat questionable due to it being leaked software.

Anyway, I have read about numerous users having success with Odin via VirtualBox using a Linux host machine (they're less successful with OS X). You just need to make sure you install the drivers in the Windows VM.

However, I tend not to advocate Odin if I can help it, so even if you find Odin doesn't work you could try follow the instructions in my video and see if you can flash with Kies itself. Of course that won't root your device, but if it works and you provide me with a capture, then you'll be helping both yourself and the community in general as I'll be able to try fix support for your device in Heimdall.

koush commented 11 years ago

Hey @Benjamin-Dobell, bumping this thread.

I have a i9500 and can help out as necessary to get this device working. Let me know what you need.

axet commented 11 years ago

I have i9500 which can't be flashed using heimdall, but I successfully did it using VirtualBox + Odin 3.09. I can provide usb traffic dump if nessesery.

ik5 commented 11 years ago

I'm also using Linux (Arch) and i9500, and it is failing with: ERROR: Failed to send data!Releasing device interface... Using heimdall detect does work, but not flushing.

the dmesg shows:

usb 4-1.2: new high-speed USB device number 13 using ehci-pci
usbip-host 4-1.2:1.0: 4-1.2 is not in match_busid table... skip!
nadzree commented 10 years ago

If you installed kies before, try this:

sudo sh - kextunload -b com.devguru.driver.SamsungComposite kextunload -b com.devguru.driver.SamsungACMData kextunload -b com.devguru.driver.SamsungACMControl

yujikiriki commented 10 years ago

I replicated the heimdall behaviour @tapicer mentions. I'm using Ubuntu with Linux kernel 3.12.0.

ghost commented 10 years ago

I replicated the heimdall behaviour @tapicer mentions also. Running Gentoo Linux multilib unstable. Heimdall-1.4.0, libusb-1.0.18. S4 GT-I9500 on stock rom, and custom roms :-(

d4vsanchez commented 10 years ago

Same is happening here with OS X Mavericks. I've unloaded the Kexts but still got the same error message.

icemodding commented 10 years ago

then there really can not be used with the Samsung i9500 heimdall?

diegocpires commented 10 years ago

I have a same problem. Using OSX 10.9.3

And same issue using Windows 7 with Parallels.

eflee commented 9 years ago

Same here, OSX 10.10.1 and Samsung Galaxy Tab Pro 10.1

gandalfk7 commented 9 years ago

I have the same problem with a SM-T520, on 2 different linux (ubuntu 12.04 and 14.04) machines and a windows 7 machine: my output (on a linux, ubuntu 12.04) is:

heimdall flash --RECOVERY ./recovery.img --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: "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...
WARNING: Control transfer #2 failed. Result: -7
WARNING: Control transfer #3 failed. Result: -7
WARNING: Control transfer #4 failed. Result: -7
WARNING: Control transfer #5 failed. Result: -7
WARNING: Control transfer #6 failed. Result: -99
ERROR: Failed to send data: "ODIN"
Releasing device interface...
Re-attaching kernel driver...
aol-nnov commented 9 years ago

+1 for this!

I have samsung I9500 non-LTE international

sudo heimdall flash --RECOVERY ./recovery-clockwork-6.0.3.2-i9500.img --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: "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...
Setting up interface...

Initialising protocol...
WARNING: Control transfer #2 failed. Result: -7
WARNING: Control transfer #3 failed. Result: -7
WARNING: Control transfer #4 failed. Result: -7
WARNING: Control transfer #5 failed. Result: -7
WARNING: Control transfer #6 failed. Result: -1
ERROR: Failed to send data: "ODIN"
Releasing device interface...

same behaviour on linux and mac.

j-woodlee commented 9 years ago

Any updates on this problem? Galaxy Tab Pro 10.1 on Mac OSX 10.10.1 and getting this:

heimdall flash --RECOVERY recovery.img --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: "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...
Setting up interface...

Initialising protocol...
WARNING: Control transfer #2 failed. Result: -7
WARNING: Control transfer #3 failed. Result: -7
WARNING: Control transfer #4 failed. Result: -7
WARNING: Control transfer #5 failed. Result: -7
WARNING: Control transfer #6 failed. Result: -1
ERROR: Failed to send data: "ODIN"
Releasing device interface...

Any help is appreciated :)

apsabelhaus commented 9 years ago

Bump. Getting almost the exact same error as @j-woodlee, with the following minor difference at the end. Ubuntu 14.04.1, kernel 3.14.1. Samsung Galaxy Tab Pro 10.1, SM-T520.

Claiming interface... Attempt failed. Detaching driver... Claiming interface again... Setting up interface...

Initialising protocol... WARNING: Control transfer #2 failed. Result: -7 WARNING: Control transfer #3 failed. Result: -7 WARNING: Control transfer #4 failed. Result: -7 WARNING: Control transfer #5 failed. Result: -7 WARNING: Control transfer #6 failed. Result: -1 ERROR: Failed to receive handshake response. Retrying... ERROR: Failed to send data: "ODIN" Releasing device interface... Re-attaching kernel driver...

thanks all!

Benjamin-Dobell commented 9 years ago

Please try build the latest version from source, the issue should be resolved.

apsabelhaus commented 9 years ago

Hi Benjamin! Thanks for the tip about building from this repo. Unfortunately, it still doesn't seem to flash the device. Here's the full output from the build of heimdall as of this evening:

drew@heidi-linux:~/repositories/Heimdall/bin$ sudo ./heimdall flash --verbose --RECOVERY clockworkmodrecovery6051picassowifi.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... 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...

drew@heidi-linux:~/repositories/Heimdall/bin$

Can you think of anything I might need to check that might be causing this? Or would it still be a genuine bug? I've got the ubuntu packages for libusb-1.0.0 and its -dev and -dbg versions installed, but from what I understand, the -7 error is related to libusb. I'm happy to help debug however I can!

kriswebdev commented 9 years ago

heimdall print-pit (randomly) working after building from last (today) source!

Quick instructions for the lazy ones: git clone https://github.com/Benjamin-Dobell/Heimdall.git cd Heimdall sudo apt-get install build-essential cmake zlib1g-dev qt5-default libusb-1.0-0-dev libgl1-mesa-glx libgl1-mesa-dev mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release .. make cd bin ./heimdall print-pit --no-reboot

Just need to reboot the phone in download mode before issuing further heimdall commands.

NB: Need a USB2.0 port. Strangely, it works better after plugging the USB cable after entering download mode and waiting eg 5 sec to avoid several "ERROR: Protocol initialisation failed!", but that may be just a coincidence or bad cable issue.

kynan commented 8 years ago

@apsabelhaus @kriswebdev Your's might be the same issue as #228. Try my fix with the udev rule.