From c98b9c687e78bc3e3708074f286b481a35370a07 Mon Sep 17 00:00:00 2001 From: travisutk Date: Thu, 3 Sep 2009 06:40:53 +0000 Subject: [PATCH] goodfet.spiflash now does verification. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@111 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- client/goodfet.spiflash | 31 +++++++++++++++++++++++++++++-- firmware/apps/spi/spi.c | 17 ++++++++++++++++- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/client/goodfet.spiflash b/client/goodfet.spiflash index 571ddc4..e396f55 100755 --- a/client/goodfet.spiflash +++ b/client/goodfet.spiflash @@ -19,7 +19,7 @@ if(len(sys.argv)==1): print "%s dump $foo.hex [0x$start 0x$stop]" % sys.argv[0]; print "%s erase" % sys.argv[0]; print "%s flash $foo.hex [0x$start 0x$stop]" % sys.argv[0]; - #print "%s verify $foo.hex [0x$start 0x$stop]" % sys.argv[0]; + print "%s verify $foo.hex [0x$start 0x$stop]" % sys.argv[0]; print "%s peek 0x$start [0x$stop]" % sys.argv[0]; print "%s poke 0x$adr 0x$val" % sys.argv[0]; sys.exit(); @@ -74,7 +74,7 @@ if(sys.argv[1]=="dump"): print "Dumping code from %06x to %06x as %s." % (start,stop,f); file = open(f, mode='wb') - + i=start; while i<=stop: data=client.SPIpeekblock(i,255); @@ -84,6 +84,33 @@ if(sys.argv[1]=="dump"): if i3): + start=int(sys.argv[3],16); + if(len(sys.argv)>4): + stop=int(sys.argv[4],16); + + print "Verifying code from %06x to %06x as %s." % (start,stop,f); + file = open(f, mode='rb') + + i=start; + bits=0; + while i<=stop: + data=client.SPIpeekblock(i,255); + print "Verified %06x." % i; + for j in data: + if i