jtagarm7 at91x40 ecdump updates and bugfixes
authordodge-this <dodge-this@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Fri, 25 Jan 2013 20:43:07 +0000 (20:43 +0000)
committerdodge-this <dodge-this@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Fri, 25 Jan 2013 20:43:07 +0000 (20:43 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1415 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETAT91X40.py
client/goodfet.at91x40

index c8c792c..fa4b30a 100644 (file)
@@ -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"
 
 
 
index cb45500..adb15f1 100755 (executable)
@@ -25,7 +25,7 @@ def at91x40_syntax():
     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]