On Mon, May 21, 2012 at 11:56 PM, Andreas Fritiofson wrote: >> Nah, it works like LibSWD captures calls from Target at Transport >> level, then generates/analyzes bitstream, then push it in/out using >> generic driver - these are two functions "transfer" that can send >> packed bitstream and "bitbang" to freely toggle/read any pin state of >> the connector (to drive SRST or the buffers that drive RnW). This is >> why LibSWD can be used with any other software > > But then not with any other hardware? The hardware needs to be able to > stupidly toggle pins without knowing anything about what it actually > means. That pretty much rules out all but FT2232 based interfaces (and > parport, but who cares) so why not just make the SWD driver for FT2232 > contain the functionality provided by LibSWD?
I have only implemented function for ft2232 based device, others are NULL and not accessible, but can be written to match hardware needs. The interface TCL functions also define signals and masks that can be driven with "bitbang" underlying driver from a OOCD CLI :-) > If I'm getting anything at all, LibSWD is more of an adapter driver to > OpenOCD than a framework for SWD in OpenOCD? Hierarchically it would > be a sibling to, say, the SWD driver for J-Link adapters. > > In any case, I'm more interested in "the other side" of LibSWD, namely > the one connecting to OpenOCD. Lets say Target want to read some memory, it reads the DAP and MEM-AP registers with dp_read and ap_read functions. These functions are pointers and part of Transport structure / layer. If JTAG is selected Transport structure gets jtag dp_read and ap_read functions. If SWD is selected Transport structure gets libswd dp_read and ap_read functions. Those functions are responsible for accessing DAP and any other AP for operations. These operations are different at signalling level, retry and error handling for JTAG and SWD but serve the same purpose. LibSWD for SWD is what existing JTAG infrastructure is for the OpenOCD, except libswd is alibrary. I will document more of this stuff, for now not to make offtopic I can recommend http://stm32primer2swd.sf.net and http://libswd.sf.net :-) Best regards! :-) Tomek -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info ------------------------------------------------------------------------------ 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
