|
From: <ge...@op...> - 2018-04-16 09:27:53
|
This is an automated email from Gerrit. Antonio Borneo (bor...@gm...) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/4493 -- gerrit commit 3381e6877eceb5ccd5a8fd15c1cd33f77b018f34 Author: Antonio Borneo <bor...@gm...> Date: Fri Mar 30 10:09:38 2018 +0200 jtag: force JTAG mode on JTAG/SWD interfaces Arm DP could have been left in SWD mode by a previous execution of OpenOCD. Also the interface could have been left in SWD mode. Since current code is unable to switch back from SWD to JTAG, a power cycle of both target and interface is required in order to use JTAG mode again. While initializing JTAG, if the interface supports also SWD and JTAG<=>SWD switch, put back DP and interface in JTAG mode. Change-Id: I55d3faebe60d6402037ec39dd9700dc5f17c53b0 Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/jtag/core.c b/src/jtag/core.c index 5d9b810..a914fba 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -1596,6 +1596,13 @@ int jtag_init(struct command_context *cmd_ctx) if (retval != ERROR_OK) return retval; + /* For interfaces supporting also SWD mode, be sure we are in JTAG mode */ + if (jtag->swd && jtag->swd->switch_seq) { + retval = jtag->swd->switch_seq(SWD_TO_JTAG); + if (retval != ERROR_OK) + return retval; + } + if (Jim_Eval_Named(cmd_ctx->interp, "jtag_init", __FILE__, __LINE__) != JIM_OK) return ERROR_FAIL; -- |