bugAVR In-System Programmer - Bugs: bug #15189, uisp somtimes fails to work in Mac...

 
 

bug #15189: uisp somtimes fails to work in Mac OS X due to a small bug in PL 2303 driver

Submitter:  None
Submitted:  Sun 11 Dec 2005 08:24:42 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  * -email is unavailable- Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 11 Dec 2005 08:24:42 PM UTC, original submission:  

There seems to be a bug in the latest version of Prolific PL-2303 Mac OS X driver (V1.1.0b1), causing uisp not to be able to connect to Stk500 at first try.  Retrying helps.  This bug implements a retry around Stk500 initialisation.

--- uisp-20050207/src/Stk500.C  2004-12-28 15:54:11.000000000 +0100
+++ uisp.modified/src/Stk500.C  2005-12-11 21:20:15.000000000 +0100
@@ -625,8 +625,19 @@
 
   TByte num_ext_parms = 3;
 
+#define MAXTRY 5
   memcpy(buf, pSTK500, sizeof(pSTK500));
-  Send(buf, sizeof(pSTK500), sizeof(pSTK500_Reply));
+  for (int i = 0; i < MAXTRY; i++) {
+    try {
+      Send(buf, sizeof(pSTK500), sizeof(pSTK500_Reply));
+      break;
+    } catch (Error_Device& errDev) {
+      errDev.print();
+      if (i < MAXTRY)
+        Info(0,"Retrying %d more times.\n", MAXTRY - i - 1);
+    }
+  }
+#undef MAXTRY
   if (memcmp(buf, pSTK500_Reply, sizeof(pSTK500_Reply)) != 0) {
     throw Error_Device ("[VP 1] Device is not responding correctly."); }
 


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2005-12-11 None Carbon-Copy- Added pekka --DOT-- nikander --AT-- iki --DOT-- fi

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code