projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2274 #ifndef screwed things up.
[goodfet]
/
client
/
goodfet.spiflash
diff --git
a/client/goodfet.spiflash
b/client/goodfet.spiflash
index
a04ed19
..
10750ff
100755
(executable)
--- a/
client/goodfet.spiflash
+++ b/
client/goodfet.spiflash
@@
-26,10
+26,15
@@
if(len(sys.argv)==1):
#Initailize FET and set baud rate
client=GoodFET();
#Initailize FET and set baud rate
client=GoodFET();
-client.serInit("/dev/ttyUSB0")
+client.serInit()
+
client.SPIsetup();
client.SPIsetup();
+#Dummy read.
+#Might read as all ones if chip has a startup delay.
+client.SPIjedec();
+
if(sys.argv[1]=="test"):
result="";
dropped=0;
if(sys.argv[1]=="test"):
result="";
dropped=0;
@@
-72,9
+77,7
@@
if(sys.argv[1]=="dump"):
i=start;
while i<=stop:
data=client.SPIpeekblock(i);
i=start;
while i<=stop:
data=client.SPIpeekblock(i);
-
-
- if(i%0x100==0):
+ if(i%0x1000==0):
print "Dumped %06x."%i;
for j in data:
file.write(j);
print "Dumped %06x."%i;
for j in data:
file.write(j);
@@
-93,11
+96,17
@@
if(sys.argv[1]=="flash"):
file = open(f, mode='rb')
i=start;
file = open(f, mode='rb')
i=start;
- bytes=file.read();
+ chars=list(file.read());
+ chunksize=0x80;
+
while i<=stop:
while i<=stop:
- client.SPIpokebyte(i,ord(bytes[i]));
+ bytes=range(0,chunksize);
+ for j in range(0,chunksize):
+ bytes[j]=ord(chars[i+j]);
+ #client.SPIpokebyte(i,ord(chars[i]));
+ client.SPIpokebytes(i,bytes);
- i+=
1
;
+ i+=
chunksize
;
if(i%0x100==0):
print "Flashed %06x."%i;
file.close()
if(i%0x100==0):
print "Flashed %06x."%i;
file.close()