JTAGARM7 is back up and running, folks! Tested Halt/Release, Get/Set Registers,...
[goodfet] / client / goodfet.msp430
index 23f4d1e..b606edc 100755 (executable)
@@ -10,6 +10,7 @@ from intelhex import IntelHex16bit, IntelHex;
 if(len(sys.argv)==1):
     print "Usage: %s verb [objects]\n" % sys.argv[0];
     print "%s test" % sys.argv[0];
+    print "%s selftest" % sys.argv[0];
     print "%s dump $foo.hex [0x$start 0x$stop]" % sys.argv[0];
     print "%s erase" % sys.argv[0];
     print "%s eraseinfo" % sys.argv[0];
@@ -25,13 +26,12 @@ if(len(sys.argv)==1):
 client=GoodFETMSP430();
 client.serInit()
 
-#Connect to target
 client.setup();
-#print "setup"
-
-#Identify model number.
 client.start();
 
+if(sys.argv[1]=="starttest"):
+    for foo in range(1,10):
+        client.start();
 if(sys.argv[1]=="info"):
     #print "Model    %08x " % client.MSP430deviceid();
     #print "Core     %04x " % client.MSP430coreid();
@@ -72,14 +72,34 @@ if(sys.argv[1]=="eraseinfo"):
     client.MSP430infoerase();
 
 if(sys.argv[1]=="selftest"):
+    import time;
+    
     entry=client.peek16(0xFFC0);
     print "Calling self-test at 0x%04x." %entry;
+    print "Memory from 0x3020 to 0x3030 should be zeroed.";
+    
+    for i in range(0x3020,0x3030):
+        client.MSP430poke(i,0xFFFF);
     client.MSP430setPC(entry);
-    #client.MSP430releasecpu();
+    time.sleep(5);
+    errors=0;
+    
+    if(client.peek8(0x302F)==0xFF):
+        print "Test not run.  Try again.";
+        exit(0);
+    
+    for i in range(0x3020,0x3030,2):
+        ret=client.peek16(i);
+        if ret!=0:
+            errors=errors+1;
+            print "Failure at 0x%04x, returned %02xh." % (i,ret);
+        
+    if errors==0:
+        print "Test succeeded.  Board is ready to ship."
+    else:
+        print "Test failed.  Is it soldered correctly?"
+    #client.MSP430dumpmem(0x3020,0x3030);
     
-    import time;
-    time.sleep(30)
-
 if(sys.argv[1]=="ivt"):
     client.MSP430dumpmem(0xFFC0,0xFFFF);
 if(sys.argv[1]=="regs"):