Default JEDEC entry for M25P80 on Telos B.
[goodfet] / client / goodfet.monitor
index f5eb1ca..8e90c59 100755 (executable)
@@ -16,14 +16,15 @@ if(len(sys.argv)==1):
     print "%s ramfill" % sys.argv[0];
     print "%s ramdepth" % sys.argv[0];
     print "%s info" % sys.argv[0];
-    print "%s info" % sys.argv[0];
     print "%s call 0x$start" % sys.argv[0];
     print "%s exec '0x35 0x00 0x..'" % sys.argv[0];
+    print "%s listapps [full]" % sys.argv[0]
     sys.exit();
 
-#Initailize FET and set baud rate
+#Initialize FET and set baud rate
 client=GoodFET();
 client.serInit()
+#client.verbose=1;
 
 if(sys.argv[1]=="on"):
     client.dir(0xFF);
@@ -31,15 +32,36 @@ if(sys.argv[1]=="on"):
 if(sys.argv[1]=="off"):
     client.out(0x00);
 
+if(sys.argv[1]=="glitchtest"):
+    client.writecmd(client.GLITCHAPP,0x20,0,None);
+
 if(sys.argv[1]=="call"):
     adr=int(sys.argv[2],16);
     print "Calling %04x" % adr;
     client.call(adr);
-    client.monitortest();
+if(sys.argv[1]=="exec"):
+    code="";
+    for foo in sys.argv[2].split(" "):
+        code+=chr(int(foo,16));
+    code+="\x30\x41";
+    client.execute(code);
+    
 if(sys.argv[1]=="info"):
-    a=client.peekbyte(0xff0);
-    b=client.peekbyte(0xff1);
-    print "GoodFET with %02x%02x MCU" % (a,b);
+    client.monitor_info()
+if(sys.argv[1]=="clocktest"):
+    print "GoodFET with %s MCU" % client.infostring();
+    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]=="listapps"):
+    full = (len(sys.argv) > 2) and (sys.argv[2]=="full")
+    client.monitor_list_apps(full);
+    
 if(sys.argv[1]=="ramfill"):
     client.monitor_ram_pattern();
 if(sys.argv[1]=="ramdepth"):
@@ -61,7 +83,7 @@ if(sys.argv[1]=="dump"):
     h = IntelHex16bit(None);
     i=start;
     while i<stop:
-        h[i>>1]=client.peekword(i);
+        h[i>>1]=client.peek16(i);
         if(i%0x100==0):
             print "Dumped %04x."%i;
         i+=2;
@@ -99,7 +121,4 @@ if(sys.argv[1]=="verify"):
             if(i%0x100==0):
                 print "%04x" % i;
 
-if(sys.argv[1]=="whatever"):
-    for i in [0x24FF, 0x2500, 0x2502, 0x2504]:
-        print "%04x" % client.peekword(i);