jacobrosenthal / hf2-rs

Microsoft HF2 HID Flashing Format for UF2 Bootloaders
49 stars 14 forks source link

linux support #10

Closed jacobrosenthal closed 4 years ago

jacobrosenthal commented 4 years ago

closes #9

jacobrosenthal commented 4 years ago

Also requires #14

jacobrosenthal commented 4 years ago

TLDR linux users Is this working now? You can cargo install from this branch with cargo install --git https://github.com/jacobrosenthal/hf2-rs --branch bininfo --force cargo-hf2


The first problem with linux support is frankly documentation and deps. Weve seen something like the attached instructions get a few people there, but we could use more on that front.

Then we started seeing the second packet in the checksums command in rx() get 0 bytes for the nth packet. But the first packet and other commands with single packet result are working.

All the wiresharking didn't clear anything up, the command being sent, and the first packet received looked fine, we just werent getting the second packet.

After all our debugging we noticed the upstream code actually does work like 1/10 times! So there is technically nothing wrong upstream code. The best we can figure is to put 5 retries on the rx, and were now seeing successful uploads in linux.

I could see maybe only retrying if its a second packet? or maybe just sleeping for some amount of time and maybe no retries? But this set of commits works so Id like some more feedback from linux users.