# Yes, this requires that you set the start and stop addresses
special_reg_num=int(argv[5])
special_addr=int(argv[6],16)
+ err_list = []
print "Dumping from %04x to %04x as %s." % (start,stop,f)
- #h = IntelHex16bit(None)
# FIXME: get mcu state and return it to that state
client.halt()
h = IntelHex(None)
i=start
+ err_cnt = 0
+ reset_cnt = 0
while i<=stop:
- err_cnt = 0
- #data=client.ARMreadMem(i, 48)
try:
data=client.ARMreadChunk(i, 48, verbose=0)
print "Dumped %06x."%i
else:
try:
print "Unknown error during read. Resync and retry."
+ err_list.append("0x%06x"%i)
# If we error out several times then reset the chip and restart
# This uses a special register value from a Chip Select Register
# to test that the chip is in the operation state we expect
if not ((err_cnt+1) % 2):
- reset_cnt = 0
while True:
print " Reset:",reset_cnt
check_addr = client.getChipSelectReg(special_reg_num)
client.resume()
client.halt()
- #Disable Watch Dog
- if client.checkWatchDog():
- client.disableWatchDog()
err_cnt = 0
except:
err_cnt += 1
client.resume()
h.write_hex_file(f)
+ print "Addresses that required resync:"
+ if err_list:
+ for e in err_list:
+ print " ",e
+ else:
+ print " None"
print "Usage: %s verb [objects]\n" % sys.argv[0]
print "%s info" % sys.argv[0]
print "%s dump $foo.hex [0x$start 0x$stop]" % sys.argv[0]
- print "%s ecdump $foo.hex [0x$start 0x$stop] - exception-handling dump" % sys.argv[0]
+ print "%s ecdump $foo.hex [0x$start 0x$stop] [$chipselectregnum 0x$chipselectregvalue] - exception-handling dump" % sys.argv[0]
print "%s erase" % sys.argv[0]
print "%s eraseinfo" % sys.argv[0]
print "%s flash $foo.hex [0x$start 0x$stop]" % sys.argv[0]