X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Fadi_v5_swd.c;h=6e322fb411503cda45048afa3152b523c94408ed;hp=31c219e59643d002ed575716233d9bd42729d985;hb=f8318d1b0d873ea4b4b78d2d5a71cf52932e4762;hpb=d2bb14e36a03cc187ca090a0da418acccb4098b4 diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c index 31c219e596..6e322fb411 100644 --- a/src/target/adi_v5_swd.c +++ b/src/target/adi_v5_swd.c @@ -253,6 +253,11 @@ int dap_to_swd(struct target *target) struct arm *arm = target_to_arm(target); int retval; + if (!arm->dap) { + LOG_ERROR("SWD mode is not available"); + return ERROR_FAIL; + } + LOG_DEBUG("Enter SWD mode"); /* REVISIT it's ugly to need to make calls to a "jtag" @@ -380,7 +385,7 @@ static int swd_select(struct command_context *ctx) return ERROR_FAIL; } - retval = swd->init(1); + retval = swd->init(); if (retval != ERROR_OK) { LOG_DEBUG("can't init SWD driver"); return retval; @@ -429,9 +434,6 @@ static int swd_init(struct command_context *ctx) if (status == ERROR_OK) LOG_INFO("SWD IDCODE %#8.8" PRIx32, idcode); - /* this is a workaround to get polling working */ - jtag_add_reset(0, 0); - return status; }