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?

Thanks,
Vinay 



-----Original Message-----
From: Spencer Oliver [mailto:[email protected]] 
Sent: Friday, July 27, 2012 3:38 AM
To: Andrew Leech
Cc: [email protected]
Subject: Re: [OpenOCD-devel] Steps for adding a new Adapter/Interface ?

On 27/07/2012 02:17, Andrew Leech wrote:
> On 27/07/12 10:55 AM, Vinay Vijendra Kumar Lakshmi wrote:
>>
>> Hi,
>>
>> I am new to OpenOCD. I got a rough idea of how OpenOCD works by
>> downloading the latest version from the GIT repository, building
>> OpenOCD on a Linux machine, used a J-Link interface to debug a
>> Phytec-LPC3250 board.
>>
>> I want to add a new adapter/interface. The JTAG debug adapter has a
>> LPC4320 on it and can be connected to the PC through MiniUSB.
>>
>> As far as I could figure out from the directory structure of OpenOCD,
>> I see the files in $INSTALL_DIR/src/jtag contain the required files
>> for all the JTAG debug adapters that OpenOCD currectly supports.
>>
>> So, to add a new adapter, should I be writing a driver(say
>> LPC_Link2.c) in $INSTALL_DIR/src/jtag/drivers/ and write a
>> configuration file(say LPC_Link2.cfg)  in $INSTALL_DIR/tcl/interface ?
>>
>> So my two specific questions are:
>>
>> 1.What are the steps to add a new JTAG adapter?
>>
>> 2.If I am right about the driver to be written in
>> $INSTALL_DIR/src/jtag/drivers/, please let me know if there is any
>> document which I can follow to write a new JTAG driver for the OpenOCD?
>>
>> I look forward to hearing from you.
>>
>> Thanks and Regards,
>>
>> Vinay
>>
>>
> So there's a new lpc-link based on LPC4320? I thought they originally
> used LPC3154.
> Are you comfortable with sniffing the usb to determine the protocol? If
> you've got this figured out then the hardest part is done.
>
> If you don't have a protocol worked out you may have more luck writing
> your own firmware instead that emulates the protocol of an adapter
> already supported. I've done a bit of work porting opendous/estick
> firmware to lpc3131, by memory I got it to a working stage but it was
> pretty slow, and then I abandoned it for an alternative method of
> production programming altogether.
>
> But if you go the stock firmware route, basically yes, there will be the
> driver source file, and the config file for runtime.
>
> I doubt there will be any docs to help you as such, but if you examine
> the parallel port driver that's probably the simplest one, you could
> replicate that and use it as your base point to write your own driver.
> Later down the track once the driver's written and working I think
> you'll need to look at the autoconf files and such to add configure
> entries to allow your driver to be compiled as an option.
>
> If your end goal is simply to use the lpclink in eclipse or similar, I
> have seen reference to using code-red's host app from lpcxpresso to talk
> to the adapter, and then connect a regular gdb to it. I don't have a
> lpc-link to try this out though.
> http://www.coocox.org/forum/topic.php?id=1387
>
> Andrew
>

I mentioned a few days ago about the new CMSIS-DAP:
http://www.keil.com/support/man/docs/dapdebug/dapdebug_introduction.htm

Included in the src archive are two example CMSIS-DAP firmwares, one for 
the OpenSDA (freescale) and the other for LPC-LINK-II (using LPC43x)

As soon as this CMSIS-DAP is released to the public (very soon) all that 
would need writing is a host CMSIS-DAP driver for OpenOCD.

If anyone has ARM Silver access they can get the src now.

Cheers
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

------------------------------------------------------------------------------
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

Reply via email to