##############################################################################
# Flash testing
#
-if 0:
+if 1:
flash = usbio.M25PExx(spi0)
flash.power(True)
print flash.status()
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')
while not flash.isReady():
print 'waiting...'
-if 0:
+if 1:
nread = 0
c2 = ''
while nread < len(code):
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:])
##############################################################################