diff options
author | Tomek CEDRO <cederom@tlen.pl> | 2011-11-15 02:11:59 +0000 |
---|---|---|
committer | Tomek CEDRO <cederom@tlen.pl> | 2011-11-15 02:11:59 +0000 |
commit | 918cd082ec8ca955358286a558b7f5ee99f9c257 (patch) | |
tree | f2a72cd21838178ccfe85f67c6d5bde48c9acd8c | |
parent | 68703e4a6b8891d93b0381031161abd10ca1e7a0 (diff) | |
download | openocd_libswd-918cd082ec8ca955358286a558b7f5ee99f9c257.tar.gz openocd_libswd-918cd082ec8ca955358286a558b7f5ee99f9c257.tar.bz2 openocd_libswd-918cd082ec8ca955358286a558b7f5ee99f9c257.tar.xz openocd_libswd-918cd082ec8ca955358286a558b7f5ee99f9c257.zip |
transport/swd_core: Implemented oocd_swd_queue_ap_abort() that sets DAPABORT and all sticky error flags (do we need to clear them anyway even after ABORT?).
-rw-r--r-- | src/transport/swd_core.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/transport/swd_core.c b/src/transport/swd_core.c index c18c111a..7617d3db 100644 --- a/src/transport/swd_core.c +++ b/src/transport/swd_core.c @@ -103,10 +103,15 @@ int oocd_swd_queue_ap_write(struct adiv5_dap *dap, unsigned reg, uint32_t data){ } int oocd_swd_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack){ - //int retval; - //char reg=SWD_DP_ABORT_ADDR; - LOG_ERROR("oocd_swd_queue_ap_abort() not yet implemented"); - return ERROR_FAIL; + int retval; + int abort_flags = SWD_DP_ABORT_ORUNERRCLR | SWD_DP_ABORT_WDERRCLR | SWD_DP_ABORT_STKERRCLR \ + | SWD_DP_ABORT_STKCMPCLR | SWD_DP_ABORT_DAPABORT; + retval=swd_dp_write((swd_ctx_t *)dap->ctx, SWD_OPERATION_EXECUTE, SWD_DP_ABORT_ADDR, &abort_flags); + if (retval<0){ + LOG_ERROR("swd_dp_write(ABORT) error: %s ", swd_error_string(retval)); + return ERROR_FAIL; + } + return ERROR_OK; } int oocd_swd_run(struct adiv5_dap *dap){ |