Nordic RF client, more thorough monitor test.
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Tue, 18 May 2010 19:33:42 +0000 (19:33 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Tue, 18 May 2010 19:33:42 +0000 (19:33 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@524 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFET.py
client/goodfet.nrf [new file with mode: 0755]

index 2ee654e..5a0f78b 100755 (executable)
@@ -315,12 +315,13 @@ class GoodFET:
         """Self-test several functions through the monitor."""
         print "Performing monitor self-test.";
         
-        if self.peekword(0x0c00)!=0x0c04 and self.peekword(0x0c00)!=0x0c06:
-            print "ERROR Fetched wrong value from 0x0c04.";
-        self.pokebyte(0x0021,0); #Drop LED
-        if self.peekbyte(0x0021)!=0:
-            print "ERROR, P1OUT not cleared.";
-        self.pokebyte(0x0021,1); #Light LED
+        for f in range(0,30):
+            if self.peekword(0x0c00)!=0x0c04 and self.peekword(0x0c00)!=0x0c06:
+                print "ERROR Fetched wrong value from 0x0c04.";
+            self.pokebyte(0x0021,0); #Drop LED
+            if self.peekbyte(0x0021)!=0:
+                print "ERROR, P1OUT not cleared.";
+            self.pokebyte(0x0021,1); #Light LED
         
         print "Self-test complete.";
     
diff --git a/client/goodfet.nrf b/client/goodfet.nrf
new file mode 100755 (executable)
index 0000000..96c40a4
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+#GoodFET SPI Flash Client
+#by Travis Goodspeed
+
+import sys;
+import binascii;
+import array;
+
+from GoodFETNRF import GoodFETNRF;
+from intelhex import IntelHex;
+
+if(len(sys.argv)==1):
+    print "Usage: %s verb [objects]\n" % sys.argv[0];
+    print "%s info" % sys.argv[0];
+    sys.exit();
+
+#Initialize FET and set baud rate
+client=GoodFETNRF();
+print "Connecting."
+client.serInit()
+
+print "Connected."
+client.NRFsetup();
+print "Setup."
+client.status();
+
+if(sys.argv[1]=="regs"):
+    for r in range(0,30):
+        print "r[0x%02x]=0x%02x" % (r,client.peek(r));