Merge pull request #40 from lucianomartin/usb_dfu

USB DFU updates
This commit is contained in:
Ross Owen
2018-02-26 14:50:47 +00:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ lib_xua Change Log
(introduced in sc_xud 6.13)
* RESOLVED: Output sample counter reset on stream start. Caused playback
issues on some Linux based hosts
* CHANGE: xmosdfu emits warning if empty image read via upload
0.1.1
-----

View File

@@ -307,8 +307,15 @@ int read_dfu_image(char *file)
{
unsigned int numBytes = 0;
numBytes = dfu_upload(0, block_count, 64, block_data);
/* Upload is completed when dfu_upload() returns an empty block */
if (numBytes == 0)
{
/* If upload is complete, but no block has been read,
issue a warning about the upgrade image
*/
if (block_count==0) {
printf("... WARNING: Upgrade image size is 0: check if image is present in the flash\n");
}
break;
}
fwrite(block_data, 1, block_size, outFile);
@@ -338,8 +345,8 @@ static void print_usage(const char *program_name, const char *error_msg)
print_device_list(stderr, " ");
fprintf(stderr, " And COMMAND is one of:\n");
fprintf(stderr, " --download <firmware> : install a new firmware\n");
fprintf(stderr, " --upload <firmware> : extract a firmware image\n");
fprintf(stderr, " --download <firmware> : write an upgrade image\n");
fprintf(stderr, " --upload <firmware> : read the upgrade image\n");
fprintf(stderr, " --revertfactory : revert to the factory image\n");
fprintf(stderr, " --savecustomstate : \n");
fprintf(stderr, " --restorecustomstate : \n");