New clocking routines. Still better for 2xx chips.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 20 May 2010 14:33:26 +0000 (14:33 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Thu, 20 May 2010 14:33:26 +0000 (14:33 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@542 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFET.py
client/goodfet.monitor

index 1ef6171..777fff7 100755 (executable)
@@ -103,6 +103,7 @@ class GoodFET:
         connected=0;
         while connected==0:
             while self.verb!=0x7F or self.data!="http://goodfet.sf.net/":
+                #print "Resyncing.";
                 self.serialport.flushInput()
                 self.serialport.flushOutput()
                 #Explicitly set RTS and DTR to halt board.
@@ -112,16 +113,17 @@ class GoodFET:
                 self.serialport.setDTR(0);
                 self.serialport.flushInput()
                 self.serialport.flushOutput()
-                #time.sleep(.1);
+                #time.sleep(60);
                 attempts=attempts+1;
                 self.readcmd(); #Read the first command.
             #Here we have a connection, but maybe not a good one.
             connected=1;
             olds=self.infostring();
-            self.monitorclocking();
+            clocking=self.monitorclocking();
             for foo in range(1,30):
                 if not self.monitorecho():
-                    print "Comm error, resyncing.";
+                    if verbose: print "Comm error on %i try, resyncing out of %s." % (foo,
+                                                  clocking);
                     connected=0;
                     break;
         if self.verbose: print "Connected after %02i attempts." % attempts;
@@ -347,7 +349,7 @@ class GoodFET:
         data="The quick brown fox jumped over the lazy dog.";
         self.writecmd(self.MONITORAPP,0x81,len(data),data);
         if self.data!=data:
-            if verbose: print "Comm error recognized.";
+            if self.verbose: print "Comm error recognized by monitorecho().";
             return 0;
         return 1;
     def monitorclocking(self):
index 92aada8..bbed793 100755 (executable)
@@ -23,6 +23,7 @@ if(len(sys.argv)==1):
 #Initialize FET and set baud rate
 client=GoodFET();
 client.serInit()
+#client.verbose=1;
 
 if(sys.argv[1]=="on"):
     client.dir(0xFF);