Hi Simon, simonqian.openocd wrote: > I have recently read libswd code
Thank you very much for looking into this! > and want to somewhat push the SWD progress. > First modification should be to arm_adi_v5.c and/or adi_v5_jtag/swd.c, > so that arm_adi_v5.c could be transport independent. > > I found both libswd and my SWD patch modify 2 main functions in > arm_adi_v5.c, which are ahbap_debugport_init and mem_ap_read_buf_u32. Where can your most recent SWD patch be found? http://www.versaloon.com/doc/versaloon/doc_versaloon_openocd_urjtag.html has a patch from 2010-11-04, and unfortunately the versaloon.com Forum seems to be unavailable since some time. > ahbap_debugport_init should obviously be modified to initialize SWD > if SWD transport is sellected. > And mem_ap_read_buf_u32 should not call adi_jtag_dp_scan, or > implement mem_ap_read_buf_u32_jtag and mem_ap_read_buf_u32_swd. > > 2 solutions: > 1. In my SWD patch, I add queue_dp_scan to dap->op, and implement > dap_queue_dp_scan to call dap->op->queue_dp_scan instead of JTAG ones. > And queue_dp_scan is implemented in both jtag_dp_ops and swd_dp_ops. > 2. In libswd code, 2 functions are implemented for mem_ap_read_buf_u32, > which are mem_ap_read_buf_u32_jtag and mem_ap_read_buf_u32_swd. > And they are called in mem_ap_read_buf_u32 according to the transport > sellected. > > So the result is simple, choose one of the 2 methods above. I can't make a useful comment at this point, but I would like to look at the code and make a suggestion. > Both are OK for me if we can make progress. > And I can prepare the patch if any one want to try. Thank you for this effort. I will be very happy to test patches. //Peter ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel