This is an automated email from Gerrit.

Paul Fertser (fercer...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/2582

-- gerrit

commit beeeedb848a3e90fae2097d251c726fea5cccece
Author: Paul Fertser <fercer...@gmail.com>
Date:   Sat Mar 7 11:05:03 2015 +0300

    adi_v5_swd: test commit to workaround EDBG issues
    
    Based on ccf4d6d64844410483d2d2513c2c4ed173604649 by Andrey Smirnov.
    
    Change-Id: I73629955503515587b47606e2bce5d332e7c989f
    Signed-off-by: Paul Fertser <fercer...@gmail.com>

diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c
index 1827c59..5733080 100644
--- a/src/target/adi_v5_swd.c
+++ b/src/target/adi_v5_swd.c
@@ -92,6 +92,32 @@ static int swd_run_inner(struct adiv5_dap *dap)
        if (retval != ERROR_OK) {
                /* fault response */
                dap->do_reconnect = true;
+       } else {
+               /*
+                 From ccf4d6d64844410483d2d2513c2c4ed173604649 by
+                 Andrey Smirnov:
+
+                 Some debug dongles do more than asked for (e.g. EDBG
+                 from Atmel) behind the scenes and issuing an AP
+                 write may result in more than just an APACC SWD
+                 transaction, which in turn can possibly set sticky
+                 error bit in CTRL/STAT register of the DP (an
+                 example would be writing SYSRESETREQ to AIRCR). Such
+                 adapters may interpret CMSIS-DAP specification
+                 differently and not guarantee to report those
+                 failures via status byte of the return USB packet
+                 from CMSIS-DAP, so we need to check CTRL/STAT and if
+                 that happens clear it.
+
+                 The question if the clear sticky errors operation
+                 can always be added to the end (or to the beginning)
+                 of the queue or if it needs its own transaction is
+                 still open. Better solution would be to investigate
+                 when exactly this weird thing happens to avoid
+                 performance penalties.
+               */
+               swd_clear_sticky_errors(dap);
+               retval = swd->run(dap);
        }
 
        return retval;

-- 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to