[Bug 673] New: [PATCH] Handle the DFU status value correctly during download

bugzilla-daemon at bugzilla.openmoko.org bugzilla-daemon at bugzilla.openmoko.org
Tue Jul 31 15:15:32 CEST 2007


http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=673

           Summary: [PATCH] Handle the DFU status value correctly during
                    download
           Product: OpenMoko
           Version: current svn head
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dfu-util
        AssignedTo: werner at openmoko.org
        ReportedBy: nick at anywi.com
                CC: buglog at lists.openmoko.org


During download you can end up in an endless loop if the dst.bStatus changes 
to != DFU_STATUS_OK. dfu-util never recovers and keeps sending GET_STATUS 
requests.

Fail the transfer as DFU_STATUS seems to indicate a fatal error in all cases 
except DFU_STATUS_OK.

Index: sam7dfu.c
===================================================================
--- sam7dfu.c   (revision 2384)
+++ sam7dfu.c   (working copy)
@@ -127,8 +127,11 @@
                                goto out_close;
                        }
                        usleep(5000);
-               } while (dst.bState != DFU_STATE_dfuDNLOAD_IDLE ||
-                        dst.bStatus != DFU_STATUS_OK);
+               } while (dst.bState != DFU_STATE_dfuDNLOAD_IDLE);
+               if (dst.bStatus != DFU_STATUS_OK) {
+                       printf(" failed!\n");
+                       goto get_status;
+               }
 
                hashes_todo = (bytes_sent / bytes_per_hash) - hashes;
                hashes += hashes_todo;



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the buglog mailing list