From 41092636d1a10d7fe55a986f0d5556a4c34b58d2 Mon Sep 17 00:00:00 2001 From: Jonas Norling Date: Wed, 25 Oct 2017 11:33:06 +0200 Subject: [PATCH] ftdi: Enable SWDIO output before sending data on it The SWDIO buffer has to be enabled, by setting SWDIO_OE, for data on SWDIO to reach the target. Explicitly do this before sending the switch sequences for JTAG-to-SWD, etc. This makes the code insensitive to the state of SWDIO_OE specified in ftdi_layout_init. It used to work only on adapters with a non-inverted SWDIO_OE inited to 1, or inverted SWDIO_OE inited to 0. Change-Id: I4b9e520ac1c7ce2a437251a05fc036bc68de718e Signed-off-by: Jonas Norling Reviewed-on: http://openocd.zylin.com/4270 Tested-by: jenkins Reviewed-by: Tomas Vanek Reviewed-by: Andreas Fritiofson --- src/jtag/drivers/ftdi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index 75a3ce43ed..32876bac59 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -1218,14 +1218,17 @@ static int ftdi_swd_switch_seq(enum swd_special_seq seq) switch (seq) { case LINE_RESET: LOG_DEBUG("SWD line reset"); + ftdi_swd_swdio_en(true); mpsse_clock_data_out(mpsse_ctx, swd_seq_line_reset, 0, swd_seq_line_reset_len, SWD_MODE); break; case JTAG_TO_SWD: LOG_DEBUG("JTAG-to-SWD"); + ftdi_swd_swdio_en(true); mpsse_clock_data_out(mpsse_ctx, swd_seq_jtag_to_swd, 0, swd_seq_jtag_to_swd_len, SWD_MODE); break; case SWD_TO_JTAG: LOG_DEBUG("SWD-to-JTAG"); + ftdi_swd_swdio_en(true); mpsse_clock_data_out(mpsse_ctx, swd_seq_swd_to_jtag, 0, swd_seq_swd_to_jtag_len, SWD_MODE); break; default: -- 2.30.2