On Sat, Jul 7, 2012 at 12:33 PM, Peter Stuge <[email protected]> wrote:
> Tomek CEDRO wrote:
>> The design was from the begining to have standalone library that can be
>> included into any software (i.e. UrJTAG, OpenOCD, some firmware, and
>> others), this is why it it named LibSWD...
>
> Cool! For that libswd needs to have a stable API. I'm not saying that
> the current API is unstable, I'm only saying that since OpenOCD may
> be the first user of the library there's still time to adjust the
> library API. Once patches to use LibSWD go into OpenOCD then it
> becomes significantly more difficult to make any incompatible API
> changes in the library.

Yes :-) The API is AP/DP_READ/WRITE which is wrapped by some basic
transport functions on the OpenOCD side. The API should not change
except adding new functionalities and functions but the basic ones
should remain intact, only internals might change. Even if the LibSWD
API chanes the change on the OpenOCD side will be minimal. This is why
I want to divide and organize OpenOCD into a structures rather than
bunch of flat functions... but this is task for near future when SWD
is done :-)


>> There are some new functions in openocd code that will be added
>> into openocd source, the rest is done by the library.
>
> Sure thing! Those are the commits that will go to OpenOCD gerrit.
> Sounds great. Are some already there?

Everything is alread on the openocd-libswd fork, feel free to test
things out and report any problems :-) I will work on it and at the
end of the holidays it should be branched with OpenOCD Master :-)


>> Submodules are very very handful in development with dependencies,
>
> Libraries are libraries.. They have API and they get installed into
> the system independently of applications that use them.

But the submodules allow to build one OpenOCD binary from various
repositories, test OpenOCD with bleeding edge code from other
repositories etc. This is very similar to FreeBSD Port Tree, where you
only have Makefile for each project and you can build one program from
sources along with other projects dependencies... I think this works
pretty well :-)


> I would love to look at commits to enable OpenOCD to use LibSWD!

Please take a look at openocd-libswd fork at
http://repo.or.cz/w/openocd/libswd.git to see how it is implemented,
also you can try out how it works and report any issues :-)

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

Reply via email to