Open XVilka opened 5 months ago
I'm using rusb
in another project:
https://github.com/orangecms/sg_boot
You're suggesting nusb
in the title, could you elaborate a bit what your opinion is on each? :)
Both are fine, it's just nusb
is pure Rust, not a binding to anything like rusb
I gave it a shot: https://github.com/platform-system-interface/fastboot/tree/nusb
The getvar example sorta works, but my target device hangs after it. I do get the expected reponse though.
Any idea?
I essentially rewrote the usbio crate based on https://github.com/probe-rs/probe-rs/blob/bba1bb553cc8b80902f498b7e7be4ba085197dcf/probe-rs/src/probe/usb_util.rs
I figured it out:
Per https://android.googlesource.com/platform/system/core/+/master/fastboot/README.md the read buffer must be max. 512 bytes for super speed, but the current code has FB_MAX_REPLY_LEN
set to 64
- changing that to 512
lets me do multiple runs. :)
I've cleaned it up and pushed everything to main
.
https://github.com/platform-system-interface/fastboot
Should we move there to continue discussions? Feel free to open issues, I just enabled it. :)
Currently,
libusb-rs
is unmaintained. What's worse, latest Rust (1.79) isn't able to compile it anymore because of the cargo changes:Two most promising alternatives are: