]> git.sur5r.net Git - openocd/commit
jtag/drivers/cmsis-dap: fix connect under reset
authorTomas Vanek <vanekt@fbl.cz>
Sun, 9 Apr 2017 08:59:57 +0000 (10:59 +0200)
committerPaul Fertser <fercerpav@gmail.com>
Wed, 3 Jan 2018 10:56:32 +0000 (10:56 +0000)
commitbb976e3c387bc82e20ab7304f0cfac3e5eede3a1
treece1fddfeee5bfa2a44b720e72f435aede83b4b8f
parent1c2e3d41de30c5e47d3fc8eda3de0a0a8229895a
jtag/drivers/cmsis-dap: fix connect under reset

Commit ef02b69b14d133b061217a91add5a028a77e86bc included
a call to cmsis_dap_cmd_DAP_Connect() before calling
cmsis_dap_cmd_DAP_SWJ_Sequence(). According to comment
it is necessary for at least Keil ULINK-ME.

Commit 72c3464be42088dc75245cf2fcc8f5c6e6959b4b added
a cmsis_dap_cmd_DAP_Disconnect() before connect call to pair
connection/disconnection. It solves some problems on Atmel EDBG.

Unfortunately calling either of cmsis_dap_cmd_DAP_Connect()
or cmsis_dap_cmd_DAP_Disconnect() deasserts reset signal.
So these workarounds break ability to connect under reset.

Use cmsis_dap_cmd_DAP_Disconnect() and cmsis_dap_cmd_DAP_Connect()
pair only if both SRST and TRST are deasserted.

Change-Id: I0914dae0a1360b8c7fe48231ff3867caedfb2dbe
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reported-by: Leonardo Sabino dos Santos <leonardo.sabino@gmail.com>
Reviewed-on: http://openocd.zylin.com/4100
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
src/jtag/drivers/cmsis_dap_usb.c