From b6dd33076a90c99df203c4c2bbddfec67dfdfb56 Mon Sep 17 00:00:00 2001 From: Luciano Martin Date: Mon, 26 Feb 2018 11:58:53 +0000 Subject: [PATCH 1/3] - add warning for empty uploaded image in USB DFU --- host/xmosdfu/xmosdfu.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/host/xmosdfu/xmosdfu.cpp b/host/xmosdfu/xmosdfu.cpp index a0aca676..44093a0f 100644 --- a/host/xmosdfu/xmosdfu.cpp +++ b/host/xmosdfu/xmosdfu.cpp @@ -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 : install a new firmware\n"); - fprintf(stderr, " --upload : extract a firmware image\n"); + fprintf(stderr, " --download : write an upgrade image\n"); + fprintf(stderr, " --upload : read the upgrade image\n"); fprintf(stderr, " --revertfactory : revert to the factory image\n"); fprintf(stderr, " --savecustomstate : \n"); fprintf(stderr, " --restorecustomstate : \n"); From ef364c9d5915b62d18ff08ec37b6376bb5ce2b3d Mon Sep 17 00:00:00 2001 From: Luciano Martin Date: Mon, 26 Feb 2018 12:21:19 +0000 Subject: [PATCH 2/3] - update CHANGELOG --- CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 211bf644..9e573b68 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 + * ADDED: Warning about empty image in USB DFU upload 0.1.1 ----- From 77d1de14aa92d2488427c7bb35d88b676eeb542d Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Mon, 26 Feb 2018 14:50:06 +0000 Subject: [PATCH 3/3] Update CHANGELOG.rst --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9e573b68..d2885e83 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,7 +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 - * ADDED: Warning about empty image in USB DFU upload + * CHANGE: xmosdfu emits warning if empty image read via upload 0.1.1 -----