From: Dan White Date: Mon, 4 Jun 2012 16:54:25 +0000 (-0500) Subject: flash wip X-Git-Tag: calibrations~56 X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=c0eeb5e0e557e481dbc49c9b8473b2e7b05afd74;p=430.git flash wip --- diff --git a/python-lib/mpsse-test.py b/python-lib/mpsse-test.py index 4fb28c7..c66acdc 100755 --- a/python-lib/mpsse-test.py +++ b/python-lib/mpsse-test.py @@ -276,7 +276,7 @@ if 0: ############################################################################## # Flash testing # -if 1: +if 0: flash = usbio.M25PExx(spi0) flash.power(True) print flash.status() @@ -313,21 +313,21 @@ if 1: while not flash.isReady(): print 'waiting...' -if 1: - nread = 0 - c2 = '' - while nread < len(code): - nr = min(256, len(code)-nread) - c = flash.read(0x4000 + nread, nr) - c2 += c - print 'read: %06x %s' % (0x4000+nread, str2hex(c)) - nread += nr - - print len(code), len(c2) - for i in range(len(code)): - print i, code[i] == c2[i] - print len(code), len(c2) - print str2hex(code[-4:]), str2hex(c2[-4:]) + if 1: + nread = 0 + c2 = '' + while nread < len(code): + nr = min(256, len(code)-nread) + c = flash.read(0x4000 + nread, nr) + c2 += c + print 'read: %06x %s' % (0x4000+nread, str2hex(c)) + nread += nr + + print len(code), len(c2) + for i in range(len(code)): + print i, code[i] == c2[i] + print len(code), len(c2) + print str2hex(code[-4:]), str2hex(c2[-4:]) ##############################################################################