Weird coincidence... I was just looking at implementing JTAG support in the
OpenOCD CMSIS-DAP driver last night.  You want to look at the code in
interface/Common/src/DAP.c and interface/Common/inc/DAP.h in the CMSIS-DAP
code on https://github.com/mbedmicro/CMSIS-DAP -- there's a whole lot of
high level JTAG stuff that's specific to ARM processors, but if you want
low level JTAG access, there's these two:

The DAP_SWJ_Sequence function (DAP command id 0x12, CMD_DAP_SWJ_SEQ in
cmsis_dap_usb.c) will clock a sequence of bits out TMS (=SWDIO) so you can
change TAP states.

The DAP_JTAG_Sequence function (DAP command id 0x14, CMD_DAP_SWJ_SEQ in
cmsis_dap_usb.c) will clock a sequence of bits out TDI and collect the
response from TDO, while holding TMS high or low as specified in the info
argument.

Then in cmsis_dap_execute_command you'll need to implement the missing JTAG
commands.  I've done JTAG_TLR_RESET, and JTAG_PATHMOVE is pretty easy, so
if you want to avoid duplicating effort you could start on JTAG_SCAN, which
is the most complex one.  If you look at the other JTAG interfaces
(ulink.c, usbprog.c etc) there'll be a ton of code to work from.

You should be able to get it working without changing anything in the
jtag_interface struct... just change the cmsis_dap_transport line to
include jtag and it'll become user selectable from config using 'transport
select jtag'.

static const char * const cmsis_dap_transport[] = { "swd", "jtag", NULL };

Cheers,
Phil



On Wed, Feb 24, 2016 at 8:20 AM, Martin Pruscha <pruscha.mar...@gmail.com>
wrote:

> Hello Openocd devs!
>
> I would like to be able to use cmsis-dap with jtag transport.
> However, only swd transport seems to be implemented.
>
> At what level should I implement the "choose jtag or swd" option?
> The best place for that seems to be the tcl/target .cfg files, but there
> seems to be no good way to choose the transport for a certain
> adapter/interface yet.
>
> There also seems to be a lot of mixing of swd and jtag, for example the
> ".swd" field in the "jtag_interface" struct. I am trying to clean this
> up/remove this field and instead choose the driver/transport at a later
> stage by user input from the cfg files.
>
> Regards
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> OpenOCD-devel mailing list
> OpenOCD-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openocd-devel
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to