Fixed python scripts for programming target to work on 64-bit machines.
This commit is contained in:
parent
7b13bae8dc
commit
6a6b52bf54
|
@ -163,11 +163,11 @@ class Target:
|
||||||
data = unhexify(reply)
|
data = unhexify(reply)
|
||||||
except Excpetion:
|
except Excpetion:
|
||||||
raise Exception('Invalid response to memory read packet: %r' % reply)
|
raise Exception('Invalid response to memory read packet: %r' % reply)
|
||||||
return struct.unpack("16L", data)
|
return struct.unpack("=16L", data)
|
||||||
|
|
||||||
def write_regs(self, *regs):
|
def write_regs(self, *regs):
|
||||||
"""Write target core registers"""
|
"""Write target core registers"""
|
||||||
data = struct.pack("%dL" % len(regs), *regs)
|
data = struct.pack("=%dL" % len(regs), *regs)
|
||||||
self.putpacket("G" + hexify(data))
|
self.putpacket("G" + hexify(data))
|
||||||
if self.getpacket() != 'OK':
|
if self.getpacket() != 'OK':
|
||||||
raise Exception('Error writing to target core registers')
|
raise Exception('Error writing to target core registers')
|
||||||
|
|
|
@ -101,7 +101,13 @@ if __name__ == "__main__":
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
target = gdb.Target(Serial(dev, baud, timeout=3))
|
s = Serial(dev, baud, timeout=3)
|
||||||
|
s.setDTR(1)
|
||||||
|
while s.read(1024):
|
||||||
|
pass
|
||||||
|
|
||||||
|
target = gdb.Target(s)
|
||||||
|
|
||||||
except SerialException, e:
|
except SerialException, e:
|
||||||
print("FATAL: Failed to open serial device!\n%s\n" % e[0])
|
print("FATAL: Failed to open serial device!\n%s\n" % e[0])
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
Loading…
Reference in New Issue