I have gone through several driver codes(mainly jlink.c, ulink.c, and bitbang.c) to understand how the drivers are defined. As far as the .execute queue is concerned, I understand there is a TAP state machine which needs to be queried at the beginning, updated at the end of each of the JTAG commands(JTAG_SCAN, JTAG_RUNTEST, etc).
I was able to implement JTAG_RUNTEST, JTAG_TLR_RESET and JTAG_PATHMOVE without much hassle, by following the jlink.c file. I am currently trying to implement the JTAG_SCAN command. For this I need to understand what exactly is TDI and TMS data. I am guessing these are basics of JTAG, and something I should be aware of. Sorry about that. Since I am an amateur, I have a hard time in figuring out if the TMS and TDI is being set by the individual driver files of each adapter(like in jlink.c, ulink.c, and bitbang.c) or it being handled by the TAP state machine of OpenOCD?? Is there an easier way to understand how these drivers are written and how they work? As in is it possible to step through a jlink.c, or maybe even put a breakpoints at JTAG_SCAN command and understand how OpenOCD runs through it, what is the value of TDI and TMS when it is a JTAG_IN, JTAG_OUT or JTAGIO?? If that is not feasible, would you suggest using a signal analyzer to look at the TDI and TMS values, with a working driver code, connected to the target board? Thanks, Vinay -----Original Message----- From: Spencer Oliver [mailto:[email protected]] Sent: Friday, August 03, 2012 2:43 AM To: Vinay Vijendra Kumar Lakshmi Cc: Andrew Leech; [email protected] Subject: Re: [OpenOCD-devel] Steps for adding a new Adapter/Interface ? On 2 August 2012 23:39, Vinay Vijendra Kumar Lakshmi <[email protected]> wrote: > I have started writing the host CMSIS-DAP driver for OpenOCD. > > At this point I have to define the .execute_queue of the jtag_interface > structure. To implement the execute_queue commands, like JTAG_RUNTEST or > JTAG_SCAN, I will have to use the CMSIS-DAP command, format is as follows: > > BYTE | BYTE **********| BYTE *********| BYTE ****| >> 0x14 | Sequence Count | Sequence Info | TDI Data | > ******|****************|///////////////|//////////| > Sequence Count: Number of Sequences > Sequence Info: Contains number of TDI bits and fixed TMS value > Bit 5 .. 0: Number of TCK cycles: 1 .. 64 (64 encoded as 0) > Bit 6: TMS value > Bit 7: TDO Capture > TDI Data: Data generated on TDI > One bit for each TCK cycle > LSB transmitted first, padded to BYTE boundary > > The response to the above command can be used to calculate the number of JTAG > devices and the JTAG IR register length. Using this data it will be possible > to configure the target devices for communication. > > My question is does OpenOCD provide the JTAG Sequence TDI? > > I am not sure if it is a generic to few/all the JTAG drivers. If it is > generic, is there some kind of protocol existing on OpenOCD to encode the TDI > data/decode the TDO data got from the response? I found a similar > encode/decode process involving TDI, TDO and TMS in > $INSTALL_DIR/src/jtag/drivers/OpenULINK/src/jtag.c. Does that mean it is > generic to Keil based interface? > I would have a look at the src/drivers/jlink.c driver, as this looks similar. Spen ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
