projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewriting the glitching code for the GoodFET24.
[goodfet]
/
client
/
GoodFET.py
diff --git
a/client/GoodFET.py
b/client/GoodFET.py
index
d8e4ac5
..
353d937
100755
(executable)
--- a/
client/GoodFET.py
+++ b/
client/GoodFET.py
@@
-72,7
+72,7
@@
class GoodFET:
return self.symbols.get(name);
def timeout(self):
print "timeout\n";
return self.symbols.get(name);
def timeout(self):
print "timeout\n";
- def serInit(self, port=None, timeout=2):
+ def serInit(self, port=None, timeout=2
, attemptlimit=None
):
"""Open the serial port"""
# Make timeout None to wait forever, 0 for non-blocking mode.
"""Open the serial port"""
# Make timeout None to wait forever, 0 for non-blocking mode.
@@
-119,7
+119,9
@@
class GoodFET:
connected=0;
while connected==0:
while self.verb!=0x7F or self.data!="http://goodfet.sf.net/":
connected=0;
while connected==0:
while self.verb!=0x7F or self.data!="http://goodfet.sf.net/":
- if attempts>2:
+ if attemptlimit is not None and attempts >= attemptlimit:
+ return
+ elif attempts>2:
print "Resyncing.";
self.serialport.flushInput()
self.serialport.flushOutput()
print "Resyncing.";
self.serialport.flushInput()
self.serialport.flushOutput()
@@
-380,7
+382,8
@@
class GoodFET:
return self.MONpeek8(address)+(self.MONpeek8(address+1)<<8);
def eeprompeek(self,address):
"""Read a word of memory from the monitor."""
return self.MONpeek8(address)+(self.MONpeek8(address+1)<<8);
def eeprompeek(self,address):
"""Read a word of memory from the monitor."""
- return self.MONpeek8(address)+(self.MONpeek8(address+1)<<8);
+ print "EEPROM peeking not supported for the monitor.";
+ #return self.MONpeek8(address)+(self.MONpeek8(address+1)<<8);
def peekbysym(self,name):
"""Read a value by its symbol name."""
#TODO include memory in symbol.
def peekbysym(self,name):
"""Read a value by its symbol name."""
#TODO include memory in symbol.
@@
-403,11
+406,17
@@
class GoodFET:
return value;
def setsecret(self,value):
"""Set a secret word for later retreival. Used by glitcher."""
return value;
def setsecret(self,value):
"""Set a secret word for later retreival. Used by glitcher."""
- self.eeprompoke(0,value);
- self.eeprompoke(1,value);
+ #self.eeprompoke(0,value);
+ #self.eeprompoke(1,value);
+ print "Secret setting is not yet suppored for this target.";
+ print "Aborting.";
+
def getsecret(self):
"""Get a secret word. Used by glitcher."""
def getsecret(self):
"""Get a secret word. Used by glitcher."""
- self.eeprompeek(0);
+ #self.eeprompeek(0);
+ print "Secret setting is not yet suppored for this target.";
+ print "Aborting.";
+ sys.exit();
def dumpmem(self,begin,end):
i=begin;
def dumpmem(self,begin,end):
i=begin;