Skip to content

Commit

Permalink
dfuse: Set address pointer before leave if we have a start address
Browse files Browse the repository at this point in the history
During an addressed download or upload we may have been moving the
device address pointer around so we need to set it back before the
leave request.

https://sourceforge.net/p/dfu-util/tickets/99/

Signed-off-by: Tormod Volden <[email protected]>
  • Loading branch information
tormodvolden committed Nov 14, 2020
1 parent c15ee60 commit 6e09e4d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dfuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ int dfuse_do_upload(struct dfu_if *dif, int xfer_size, int fd,

dfu_abort_to_idle(dif);
if (dfuse_leave) {
if (dfuse_address_present)
dfuse_special_command(dif, dfuse_address, SET_ADDRESS);
dfuse_dnload_chunk(dif, NULL, 0, 2); /* Zero-size */
}

Expand Down Expand Up @@ -727,6 +729,8 @@ int dfuse_do_dnload(struct dfu_if *dif, int xfer_size, struct dfu_file *file,
}

if (dfuse_leave) {
if (dfuse_address_present)
dfuse_special_command(dif, dfuse_address, SET_ADDRESS);
dfuse_dnload_chunk(dif, NULL, 0, 2); /* Zero-size */
}
return ret;
Expand Down

0 comments on commit 6e09e4d

Please sign in to comment.