changes to a bug on the spit method
[goodfet] / client / goodfet.monitor
index 991c53e..b530a4b 100755 (executable)
@@ -16,11 +16,16 @@ 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 call 0x$start" % sys.argv[0];
+    print "%s exec '0x35 0x00 0x..'" % sys.argv[0];
+    print "%s listapps [full]" % sys.argv[0]
+    print "%s testleds" % 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);
@@ -28,10 +33,40 @@ 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);
+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]=="infotest"):
+    for foo in range(0,100):
+        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" or sys.argv[1]=="apps"):
+    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"):
@@ -53,7 +88,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;
@@ -91,7 +126,5 @@ 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);
-
+if(sys.argv[1]=="testleds"):
+    client.testleds();