More clocking tests, getting ready for an
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 18 Sep 2010 21:22:41 +0000 (21:22 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 18 Sep 2010 21:22:41 +0000 (21:22 +0000)
info memory recovery script.

git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@725 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFET.py
client/GoodFETCC.py
client/goodfet.monitor

index b6d9033..45bd33a 100755 (executable)
@@ -378,6 +378,11 @@ class GoodFET:
         self.data=[address&0xff,address>>8,value];
         self.writecmd(0,0x03,3,self.data);
         return ord(self.data[0]);
         self.data=[address&0xff,address>>8,value];
         self.writecmd(0,0x03,3,self.data);
         return ord(self.data[0]);
+    def poke16(self,address,value):
+        """Set a word of memory by the monitor."""
+        self.pokebyte(address,value&0xFF);
+        self.pokebyte(address,(value>>8)&0xFF);
+        return value;
     def setsecret(self,value):
         """Set a secret word for later retreival.  Used by glitcher."""
         self.eeprompoke(0,value);
     def setsecret(self,value):
         """Set a secret word for later retreival.  Used by glitcher."""
         self.eeprompoke(0,value);
index e6016fc..239233e 100644 (file)
@@ -192,7 +192,10 @@ class GoodFETCC(GoodFET):
         ident=self.CCident();
         chip=self.CCversions.get(ident&0xFF00);
         pagesize=self.CCpagesizes.get(ident>0xFF);
         ident=self.CCident();
         chip=self.CCversions.get(ident&0xFF00);
         pagesize=self.CCpagesizes.get(ident>0xFF);
-        return "%s/r%0.4x/ps0x%0.4x" % (chip, ident,pagesize); 
+        try:
+            return "%s/r%0.4x/ps0x%0.4x" % (chip, ident, pagesize); 
+        except:
+            return "%04x" % ident;
     def CCident(self):
         """Get a chipcon's ID."""
         self.writecmd(self.APP,0x8B,0,None);
     def CCident(self):
         """Get a chipcon's ID."""
         self.writecmd(self.APP,0x8B,0,None);
index ea0dd68..6191335 100755 (executable)
@@ -50,7 +50,14 @@ if(sys.argv[1]=="info"):
     print "Clocked at %s" % client.monitorclocking();
 if(sys.argv[1]=="clocktest"):
     print "GoodFET with %s MCU" % client.infostring();
     print "Clocked at %s" % client.monitorclocking();
 if(sys.argv[1]=="clocktest"):
     print "GoodFET with %s MCU" % client.infostring();
-    print "Clocked at %s" % client.monitorclocking();
+    clocking=client.monitorgetclock();
+    print "Clocked at 0x%04x" % clocking;
+    for foo in range(1,50):
+        client.monitorsetclock(clocking+foo);
+        print "+0x%04x: %s" % (foo,client.infostring());
+        client.monitorsetclock(clocking-foo);
+        print "-0x%04x: %s" % (foo,client.infostring());
+        
     
 if(sys.argv[1]=="ramfill"):
     client.monitor_ram_pattern();
     
 if(sys.argv[1]=="ramfill"):
     client.monitor_ram_pattern();