X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FGoodFETAT91X40.py;h=fa4b30ad333ae9ed707e9082f8e4b99a9d9ed44b;hp=c8c792c86a82ca66202db41a60914a802378cf5a;hb=665d6fc98e8567d92ef6d5e351730f115a45ec08;hpb=8691ee02d0b0d75d4a44a9deadf14f394cd57740 diff --git a/client/GoodFETAT91X40.py b/client/GoodFETAT91X40.py index c8c792c..fa4b30a 100644 --- a/client/GoodFETAT91X40.py +++ b/client/GoodFETAT91X40.py @@ -579,17 +579,17 @@ def at91x40_cli_handler(client, argv): # 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 @@ -612,12 +612,12 @@ def at91x40_cli_handler(client, argv): 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) @@ -637,9 +637,6 @@ def at91x40_cli_handler(client, argv): client.resume() client.halt() - #Disable Watch Dog - if client.checkWatchDog(): - client.disableWatchDog() err_cnt = 0 except: err_cnt += 1 @@ -649,6 +646,12 @@ def at91x40_cli_handler(client, argv): 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"