From bc50663c307b7b8b132a783169af665da8b32cd1 Mon Sep 17 00:00:00 2001 From: travisutk Date: Thu, 20 May 2010 14:33:26 +0000 Subject: [PATCH] New clocking routines. Still better for 2xx chips. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@542 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- client/GoodFET.py | 10 ++++++---- client/goodfet.monitor | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/GoodFET.py b/client/GoodFET.py index 1ef6171..777fff7 100755 --- a/client/GoodFET.py +++ b/client/GoodFET.py @@ -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): diff --git a/client/goodfet.monitor b/client/goodfet.monitor index 92aada8..bbed793 100755 --- a/client/goodfet.monitor +++ b/client/goodfet.monitor @@ -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); -- 2.20.1