r2769 - trunk/src/host/dfu-util/src

laforge at sita.openmoko.org laforge at sita.openmoko.org
Tue Aug 21 21:17:40 CEST 2007


Author: laforge
Date: 2007-08-21 21:17:35 +0200 (Tue, 21 Aug 2007)
New Revision: 2769

Modified:
   trunk/src/host/dfu-util/src/sam7dfu.c
Log:
prevent endless loop during DFU download.  We now just abort
in case DFU_STATUS != DFU_STATUS_OK. See http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=673 (Nick Hibma)


Modified: trunk/src/host/dfu-util/src/sam7dfu.c
===================================================================
--- trunk/src/host/dfu-util/src/sam7dfu.c	2007-08-21 19:12:52 UTC (rev 2768)
+++ trunk/src/host/dfu-util/src/sam7dfu.c	2007-08-21 19:17:35 UTC (rev 2769)
@@ -132,8 +132,15 @@
 				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");
+			printf("state(%u) = %s, status(%u) = %s\n", dst.bState,
+				dfu_state_to_string(dst.bState), dst.bStatus,
+				dfu_status_to_string(dst.bStatus));
+			ret = -1;
+			goto out_close;
+		}
 
 		hashes_todo = (bytes_sent / bytes_per_hash) - hashes;
 		hashes += hashes_todo;





More information about the commitlog mailing list