mashed-potatoes / Potato.Fastboot

A 10KB wrapper over LibUsbDotNet for easy and convenient communication with mobile devices in Fastboot mode.
GNU General Public License v3.0
21 stars 15 forks source link

Invalid Response from Device Exception #1

Open ybtag opened 1 year ago

ybtag commented 1 year ago

When I send a large (> 800MB) file to the device, I get an exception: System.Exception: Invalid response from device! (data size: 834666496) at Potato.Fastboot.Fastboot.SendDataCommand(Int64 size) at Potato.Fastboot.Fastboot.UploadData(FileStream stream) at Potato.Fastboot.Fastboot.UploadData(String path)

ybtag commented 1 year ago

The problem is caused when the file is larger than the Max Download Size of the bootloader. The Max Download Size should be checked first by getvar:max-download-size. If the file is larger than the Max Download Size then it needs to be converted to a sparse image (if it is raw) and split.

ybtag commented 1 year ago

However, now I have a different issue. I split the sparse image and it flashes fine with Google's fastboot without being further split. But when I send it with Potato.Fastboot, the USB pipe gets URB_FUNCTION_ABORT_PIPE when I send the flash command. The uploading works fine and receives OKAY but for some reason it seems to break the pipe afterwards.

HadiKhoirudin commented 1 year ago

I also faced this issue when I try to build Mi Fastboot flash tool with Potato.Fastboot btw.

I don't know how to implement sparse function to Potato.Fasboot.

image-2023-06-13-222314810.png

But for write RAW sparse file from Qualcomm EDL function it's like this.

image-2023-06-13-222852071.png

You can see more at my repository.

ybtag commented 1 year ago

I managed to implement Sparse but I still had problems flashing large files, I got USB pipe issues. I don't know how to solve this so I didn't bother pulling my implementation. I used https://github.com/TalAloni/SparseConverter