On Wednesday 11 November 2009, Andrew Rogers wrote:
> Hi All,
> 
> I am working a few hours a week trying to get SWD working for the STM32
> Primer2 (R-Link interface). I am happy making changes to the source code
> to accomplish this. The problem is that my changes span many files
> because OpenOCD is pretty well married up to JTAG.

Yes ... please discuss this with Simon, who's got some of this
going on his hardware (FT2232-based) and has posted a few patches
to this list.  (He calls it SWJ, but I believe we should refer to
it as SWD to match more common usage.)


> I am taking the 
> opportunity to create an interface struct that can be type-cast to JTAG
> or SWD struct and later extended to UART.

UART ... why?  To get that single wire trace mode working?

Yes, I think we'll want that.  But I don't think we have any
of the necessary infrastructure in place yet...


> The problem I've got is that I 
> know nothing about git and get problems trying to pull the latest
> revisions and merging them with my working copy. I try
> 
> $ git pull
> Updating e901cee..2821115
> error: Entry 'src/jtag/core.c' not uptodate. Cannot merge.

"git status" will tell you some things.  It's not clear from that
message alone what your problem is.  (At least, not to me...)

As a rule, if your workspace is "clean" (everything committed) I
think you shouldn't see such messages.

 
> and it tells me it can't merge. I suspect that I will run into further
> problems as my working copy continues to drift away from the master so I
> would like to resolve this soon. I know the problem lies with me not
> understanding git, so help is appreciated. The tutorial didn't help me
> resolve the above.
> 
> The patch that I will eventually post will be quite big, is this going
> to be a problem for the person who merges the patch into the master?

Yes.  You need to plan on a series of small *reviewable* patches.

As an example ... maybe

 - add SWD support to interface level
 - add interface subcommands so "SWD-only" boards can be described
 - similarly, "no-SWD" (probably a target-level default)
 - implement it for FT2232
 - implement it for R-Link
 - add commands for switching between SWD and JTAG
 - SWD for scanchain detection/validation/autoprobing
 - Cortex-M3 using SWD
 - ... surely more ...

Tools like "quilt" and "stg" may be useful for your particular
workflow.  Regardless, the result *MUST NOT BE* One Huge Patch.

Again, if you and Simon work on this together, the result will
be more viable.  Be sure to propose interface changes while they
can still be changed easily.

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to