Heimdall: flash fails to start with Galaxy Note 3 SM-N9005

I’ve observed the same issue that is described in this thread: http://forum.xda-developers.com/showthread.php?t=2684410

I run

heimdall flash --recovery something.tar

and it fails:

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...

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 53 (6 by maintainers)

Most upvoted comments

I’m not sure how relevant my particular case was, but for what it’s worth, I am using a clean checkout of master.

The latest commit is: d0526a3b74a003dfc6f805682693be9173ffcd88 Date: Sat Mar 21 14:53:43 2015 +1100

As I stated in my previous comment, it worked perfectly once I unhooked unnecessary USB devices and found the magic USB port. Thank you very much for this extremely useful tool!

i can confirm that @hesem3 suggestion has worked for me!

i have created a branch at: https://github.com/karabijavad/Heimdall/tree/issue-197

you should be able to follow all the directions as normal for compiling heimdall from source and it would work

It seems that the PIT file receive requires empty packet reading before sending the PitFilePacket::kRequestEndTransfer packet.

Here is a quick and dirty solution to the BridgeManager::ReceivePitFile(…) function.

Add the “empty” packet reading just before sending the PitFilePacket(PitFilePacket::kRequestEndTransfer)


...
Interface::Print("PIT file data received, read 'empty' packet...\n");
int dataTransferred = 0;
int timeout = 1000;
unsigned char* bufferEmpty = (unsigned char*)malloc(1);
int result = libusb_bulk_transfer(deviceHandle, inEndpoint, bufferEmpty, 1, &dataTransferred, timeout);
delete bufferEmpty;
Interface::Print("PIT file data receive completed, send kRequestEndTransfer...\n");
...

I think you can also remove the empty packet sending by setting the SendPacket(…) sendEmptyTransferFlags parameter default value to kSendEmptyTransferNone