diff options
-rw-r--r-- | src/jtag/drivers/ftdi.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index 9d1c85c..9e47d3c 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -524,17 +524,19 @@ static int ftdi_reset(int trst, int srst) LOG_DEBUG_IO("reset trst: %i srst %i", trst, srst); - if (trst == 1) { - if (sig_ntrst) - ftdi_set_signal(sig_ntrst, '0'); - else - LOG_ERROR("Can't assert TRST: nTRST signal is not defined"); - } else if (sig_ntrst && jtag_get_reset_config() & RESET_HAS_TRST && - trst == 0) { - if (jtag_get_reset_config() & RESET_TRST_OPEN_DRAIN) - ftdi_set_signal(sig_ntrst, 'z'); - else - ftdi_set_signal(sig_ntrst, '1'); + if (!swd_mode) { + if (trst == 1) { + if (sig_ntrst) + ftdi_set_signal(sig_ntrst, '0'); + else + LOG_ERROR("Can't assert TRST: nTRST signal is not defined"); + } else if (sig_ntrst && jtag_get_reset_config() & RESET_HAS_TRST && + trst == 0) { + if (jtag_get_reset_config() & RESET_TRST_OPEN_DRAIN) + ftdi_set_signal(sig_ntrst, 'z'); + else + ftdi_set_signal(sig_ntrst, '1'); + } } if (srst == 1) { |