Heimdall: ERROR: libusb error -7 whilst receiving bulk transfer

I am having a similar issue to https://github.com/Benjamin-Dobell/Heimdall/issues/413 trying to install TWRP on a Samsung Galaxy Note 3, SM-N900V (Verizon version) The USB device is USB 3. I have USB2 devices if this will help.

Original log of trying to flash is gone, but here are the snippets of trying to get the PIT file: Note: I have changed the permissions fo the USB device so I can perform this as my normal user as I have heard that doing this as root can be problematic.

./heimdall print-pit --verbose --no-reboot
...
--- Entry #28 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 73
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 61071327
Partition Block Count: 33
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: SGPT
Flash Filename: sgpt.img
FOTA Filename: 

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

Releasing device interface...

And my libusb

ii  libusb-0.1-4:amd64                                          2:0.1.12-30                                       amd64        userspace USB programming library
ii  libusb-1.0-0:amd64                                          2:1.0.21-1                                        amd64        userspace USB programming library
ii  libusb-1.0-0:i386                                           2:1.0.21-1                                        i386         userspace USB programming library
ii  libusb-1.0-0-dev:amd64                                      2:1.0.21-1                                        amd64        userspace USB programming library development files
ii  libusb-1.0-doc                                              2:1.0.21-1                                        all          documentation for userspace USB programming
ii  libusb-dev                                                  2:0.1.12-30                                       amd64        userspace USB programming library development files

Heimdall built from git (pulled yesterday), ubuntu 17.04.

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 2
  • Comments: 24

Most upvoted comments

I had this problem with a Galaxy Note 4 (SM-N910F) on Ubuntu 22.04 on a USB 3 port (USB-C to MicroUSB cable, no USB 2 ports available). I could download the PIT but any firmware download failed with this error and the debug log had failures with “urb status -2”.

I got it to work with:

  • compiling myself from source, not using the Ubuntu package
  • not using --resume
  • booting the phone into download mode, then plugging it in immediately before running the flash command

The full command:

Heimdall/build/bin/heimdall flash --APNHLOS NON-HLOS.bin --ABOOT aboot.mbn --BOOT boot.img \
  --CACHE cache.img.ext4 --HIDDEN hidden.img.ext4 --MODEM modem.bin --RECOVERY recovery.img \
  --RPM rpm.mbn --SBL1 sbl1.mbn --DBI sdi.mbn --SYSTEM system.img.ext4 --TZ tz.mbn --usb-log-level debug

I ran into this error using Heimdall 4.1.2 with an I9105P device when the --resume argument was present in any of the commands (print-pit, download-pit, flash):

# heimdall print-pit --verbose --no-reboot --resume
[...]

Beginning session...
ERROR: libusb error -7 whilst receiving bulk transfer. Retrying...

Without --resume the first command sent to the device works (with some warnings):

# heimdall print-pit --verbose --no-reboot
[...]
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...
WARNING: Empty bulk transfer after receiving packet failed. Continuing anyway...
WARNING: Empty bulk transfer after sending packet failed. Continuing anyway...
PIT file download successful.
[...]

Note that with the --no-reboot argument alone (without --resume which does not work) it is not possible to issue further commands, that would result in errors:

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