jtag/drivers/cmsis_dap: prevent conn/discon workaround before line reset

The line reset SWD sequence is used quite often in SWD multidrop mode.
Prevent the ugly connect/disconnect adapter firmware bug workaround
to be called before each line reset.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Id85bff075dba9077e4e501e2cdcfd64d5d9d0531
Reviewed-on: https://review.openocd.org/c/openocd/+/7381
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Tomas Vanek 2022-11-24 14:21:59 +01:00 committed by Antonio Borneo
parent 630cb5ea4d
commit 5292c7eae9
1 changed files with 3 additions and 1 deletions

View File

@ -1158,7 +1158,9 @@ static int cmsis_dap_swd_switch_seq(enum swd_special_seq seq)
unsigned int s_len; unsigned int s_len;
int retval; int retval;
if ((output_pins & (SWJ_PIN_SRST | SWJ_PIN_TRST)) == (SWJ_PIN_SRST | SWJ_PIN_TRST)) { if (seq != LINE_RESET &&
(output_pins & (SWJ_PIN_SRST | SWJ_PIN_TRST))
== (SWJ_PIN_SRST | SWJ_PIN_TRST)) {
/* Following workaround deasserts reset on most adapters. /* Following workaround deasserts reset on most adapters.
* Do not reconnect if a reset line is active! * Do not reconnect if a reset line is active!
* Reconnecting would break connecting under reset. */ * Reconnecting would break connecting under reset. */