According to my test in vsprog, it's OK to switch between SWD and JTAG without power cycle. Actually, it's not vital, because if people want to use JTAG after using SWD, simply give a power cycle, and the control is under JTAG.
I have provided 2 patches for SWD of Versaloon in OpenOCD, one is based on transport the other is not. I'll come back to work after Chinese New Year, hope it will be stable before that. I have attached the patch for OpenOCD (For your reference only), without SWD driver for Versaloon. Changes are listed below: 1. in jtag/core.c Do not call jtag_add_tlr and jtag_init_inner in SWD mode. 2. in jtag/tcl.c Do not call jtag_init_inner in SWD mode. 3. in target/arm_adi_v5.h Add queue_dp_scan to struct dap_ops. Implement dap_queue_dp_scan 4. in target/arm_adi_v5.c Do not call adi_jtag_dp_scan, call dap_queue_dp_scan instead. Luckly, most code is compatible in both JTAG and SWD mode. 2011/1/22 Tomek CEDRO <tomek.ce...@gmail.com> > On Sat, Jan 22, 2011 at 2:03 PM, simon qian <simonqian.open...@gmail.com> > wrote: > > According to the feedback of my patch for SWD. I was busy fixing these > > feedback these days. > > I found that dap_to_jtag is not called. So it will be problem to operate > > JTAG after operating SWD. > > In my opinion, dap_to_jtag should be not be called in jtag_init, > > because dap_to_jtag is defined ONLY in adiv5 specification. > > But if I call dap_to_jtag in arm_adi_v5.c or adi_v5_jtag.c, it will fail > > because jtag_id is read before calling dap_to_jtag. > > So I think the initialization sequence should be from upper layer to > lower > > layer, which means initialize adiv5 and then initialize jtag. > > Hello Simon! As stated on the ARM Infocenter [1]: > -one mode of operation should be selected after target power up, and > this mode should not be changed > -jtag is the default working mode after power-up > -swd-to-jtag and jtag-to-swd should not impact device after power up, > because sequences are designed not to interfere with dap-specific > operations > > Therefore I think we should test how select-jtag works on targets > other than ARM. According to the documentation it should be > transparent and ensure target is in JTAG mode. If there are no > problems with non-ARM targets having this sequence applied at > initialization, we should put this into jtag_init procedure..? On the > other hand even ARM states that target should not be switched between > SWD and JTAG modes multiple times with no powerdown/powerup... but if > we have more than one target on the line, one is JTAG and one is SWD, > then we could ensure working state for them. > > Best regards, > Tomek > > > [1] > http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0316d/Chdhfbhc.html > -- > CeDeROM, SQ7MHZ, http://www.tomek.cedro.info > -- Best Regards, SimonQian http://www.SimonQian.com
openocd_swd.patch
Description: Binary data
_______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development