simonqian.openocd wrote:
> What I did is:
> 1. add SWD drivers according to the specification
> Versaloon firmware can do SWD re-transaction if SWD_ACK_OK is not
> returned, of course there is a max retry count.

What happens when the retry count expires? OpenOCD shows an error,
but what state is the target in?


> 2. didn't call JTAG specific functions in SWD mode, below is the list.
> jtag_init_inner(which will run a device detect algorithm on JTAG),
> tlr reset(because I didn't change the reset script)

How does device detect and reset work using SWD?


> 3. make adi_v5 layer transport independent
> I added queue_dp_scan in dap_ops structure.

Yes.


> 4. some minor fix, which is not vital, eg:
> I call
> swd_add_sequence((uint8_t*)jtag2swd_bitseq, sizeof(jtag2swd_bitseq) * 8);
> instead of 
> jtag_add_tms_seq(8 * sizeof(jtag2swd_bitseq), jtag2swd_bitseq, TAP_INVALID);
> because JTAG function is not available in SWD mode, of course these
> 2 functions does the same in lower level.
> 
> If you look into my patch, it only does above.

For Versaloon I think your changes make a lot of sense, because the
firmware helps a lot with supporting SWD.

Would it be quick and easy for you to split the one big patch into
multiple commits, each doing only one thing? If not so easy, I can
try to do it. I think this is important to make it easy to work with
each issue separately, such as the queue_dp_scan.

Your code is ready and as you say has been working for a long time,
and I would like to include it into OpenOCD, but it is important to
have each logical change in a separate commit, and it is important
that adding Versaloon support does not cause a lot of extra work for
later adding libswd.

When the Versaloon changes are separated it may be easy for Tomek to
point out small adjustments which he sees are neccessary for also
adding support for libswd in OpenOCD. Versaloon will maybe/maybe not
use libswd, so it is somehow important that Versaloon and libswd
have APIs which are similar at least in principle, even if not in
every single detail.


> adi_v5_swd.c maybe different, because actually it's originally
> copied from adi_v5_jtag.c, and OpenOCD has some modification in
> later commit in adi_v5_swd.c, and I didn't follow because original
> code is stable.

Can you say which commit your latest patch is based on?


> About sticky error handler, I use the same method as JTAG, the
> difference is that when clear sticky error, use SWD method.

Does this fit also SWD?


> Note that in ahbap_debugport_init, if SWD is sellected, besides
> STICKERR clear(different than JTAG procedure),
> dap_queue_idcode_read must also be called after dap_to_swd.

I guess this would go into the last commit in the series which adds
the highest level things for OpenOCD to support SWD with Versaloon.


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

Reply via email to