test new flash write/readback, good
authorDan White <dan@whiteaudio.com>
Sun, 3 Jun 2012 02:13:39 +0000 (21:13 -0500)
committerDan White <dan@whiteaudio.com>
Sun, 3 Jun 2012 02:13:39 +0000 (21:13 -0500)
python-lib/mpsse-test.py

index 69934ce74df0536404d13474f793ddf219fdfdc1..4fb28c7a6bdb4ac078e67eda2e308cac7a271eee 100755 (executable)
@@ -276,7 +276,7 @@ if 0:
 ##############################################################################
 # Flash testing
 #
-if 0:
+if 1:
     flash = usbio.M25PExx(spi0)
     flash.power(True)
     print flash.status()
@@ -285,6 +285,9 @@ if 0:
     print 'data:', str2hex(flash.read(0x4000, 16))
 
     flash.writeEnable(True)
+    #flash.eraseAll()
+    #while not flash.isReady():
+        #print 'waiting for eraseAll() ...'
 
     from intelhex import IntelHex
     #h = IntelHex('../msp4th/hello-world.hex')
@@ -310,7 +313,7 @@ if 0:
     while not flash.isReady():
         print 'waiting...'
 
-if 0:
+if 1:
     nread = 0
     c2 = ''
     while nread < len(code):
@@ -321,8 +324,10 @@ if 0:
         nread += nr
 
     print len(code), len(c2)
-    #for i in range(len(code)):
-        #print i, code[i] == c2[i]
+    for i in range(len(code)):
+        print i, code[i] == c2[i]
+    print len(code), len(c2)
+    print str2hex(code[-4:]), str2hex(c2[-4:])
 
 
 ##############################################################################