Closed Qyriad closed 2 years ago
to me It looks like you can set the address on creation via DfuSync::new
. I could be wrong though.
hah! ... :thinking: did I forget something....
:thinking: ....
Reading the code it seems the address is not settable by the user but is based on the config descriptor.
You can see that here: https://docs.rs/dfu-libusb/0.2.0/src/dfu_libusb/lib.rs.html#145-148
It's been a long time so I'm not sure my memory is correct: I think I have tested writing manually on a segment of memory I want and it failed. The data was not properly written on the device for some reason. So I settled that by only allowing to write on the address in the config descriptor. But I'm not certain.
However it is possible that this was an issue for my particular device. So I guess we could add a method set_address
on DfuSync
to override the address afterwards.
I really depend on your experience of you both here because I'm not originally an embedded developer. You need to make sure that:
to me It looks like you can set the address on creation via
DfuSync::new
. I could be wrong though.
yes but the user don't usually create that manually. It's created through an implementation (DfuLibusb
in this case)
@Qyriad if you're happy with the solution in #9 I can merge that and make a release if you need.
As for whether behavior like this is technically allowed by the spec, I truly have no idea, but as for whether its useful, I can think of a few example cases:
I think some mix of 1 and 2 is my use case at the moment. I'll check #9 on my hardware later today, but a glance on the diff looks pretty good, thank you!
Whoops! Sorry, I got a bit distracted. But I did test #9 on my hardware, and I can confirm it does indeed work, so it should be mergeable. Thank you!
I completely forgot xD
Ok fixed by #9 then
Published 0.3.0 (there is a small breaking change in the API for the progressbar but shouldn't be a problem for anyone I think)
Thank you!
Currently, it doesn't seem that
DfuSync
offers a method to set the starting address (equivalent todfu-util
's-s
/--dfuse-address
argument). I see a command for setting the address indfu_core::download
, but there doesn't seem to be a public interface for doing so, unless I'm mistaken?In either case, a
set_address()
method onDfuSync
would be amazing, if possible 🙂