On 10/20/2013 11:18 PM, Paul Sokolovsky wrote: > It is the same with a serial port: no such implementation exists now. > The detour may be a bit shorter, but not by much. > Well, I have that covered, I really didn't want to start > completely theoretical discussion. But I just didn't want to overload > initial mail with pointing to specific prototype, because I first > wanted to make sure that overall approach is OK. > > So, I have a prototype which works and written in (completely) > MCU-independent manner: > https://github.com/pfalcon/simplejtag/blob/master/simplejtag_l0.cpp > As soon as support for GPIO of new MCU is added, it can just work. To > achieve that (efficiently), C++ metaprogramming techniques are used. > Now you see why I started with talking about defining protocol first - > that's all what's needed on OpenOCD side. But on firmware side, I > actually strive for the same generality, and single source (but > multiple configs of course) covers MSP430, AVR, STM32, EFM32, LM4 so > far - with the price of C++. Of course, that's just one possible > implementation of protocol, someone can write Arduino-specific "sketch" > for that, use TI's CCS bloat for MSP430, churn STM32 Peripheral Library > etc., etc. I just don't really see the huge implementation benefit of UART vs. USB here.
Any USB stack should provide some means of calling a user function for read/write of a packet to a defined endpoint - just like UART, only you read/write packets instead of bytes, and you get them via some callback instead of interrupt. Encapsulation and device-independentness can be handled just like in the UART case - you just treat the USB stack as a device-specific external, just like the UART driver in your case. Even with UART, you need device-specific startup code, UART driver, timer driver and GPIO driver, so adding in a device-specific USB stack does not make much difference if the design is done right. cu Michael ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
