Skip to content

Commit

Permalink
Merge pull request jeanthom#10 from UweBonnes/transfer_size
Browse files Browse the repository at this point in the history
Always download full pages.
  • Loading branch information
Jean THOMAS authored Oct 13, 2019
2 parents 18339a0 + f57eb10 commit 3a78a01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/stlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ int stlink_flash(libusb_device_handle *dev_handle,
}

memcpy(firmware_chunk, firmware+flashed_bytes, cur_chunk_size);
memset(firmware_chunk+cur_chunk_size, 0, chunk_size-cur_chunk_size);
res = stlink_dfu_download(dev_handle, firmware_chunk, cur_chunk_size, 2, stlink_infos);
memset(firmware_chunk+cur_chunk_size, 0xff, chunk_size-cur_chunk_size);
res = stlink_dfu_download(dev_handle, firmware_chunk, chunk_size, 2, stlink_infos);
if (res) {
fprintf(stderr, "Erase error\n");
return res;
Expand Down

0 comments on commit 3a78a01

Please sign in to comment.