Hans Nieuwenhuis writes:
> On Thu, 10 Jun 2010 11:33:42 +1200
> [email protected] wrote:
> 
> > Hans Nieuwenhuis writes:
> > > On Wed, 9 Jun 2010 14:30:29 +1200
> > > [email protected] wrote:
> > > > 
> > > > Hi Hans,
> > > > 
> > > > I (the author) would be interested in the Snoopy logs :).
> > > > 
> > > > There is a change you might like to try. I has worked for some
> > > > people but I haven't committed it yet as I'm still trying to figure
> > > > out if it's going to break things for others:
> > > > 
> > > > diff --git a/fet.c b/fet.c
> > > > index 0907f87..1c745fd 100644
> > > > --- a/fet.c
> > > > +++ b/fet.c
> > > > @@ -812,7 +812,7 @@ device_t fet_open(transport_t transport, int
> > > > proto_flags, int vcc_mv, /* configure: Spy-Bi-Wire or JTAG */
> > > >         if (xfer(dev, C_CONFIGURE, NULL, 0,
> > > >                  2, FET_CONFIG_PROTOCOL,
> > > > -                (proto_flags & FET_PROTO_SPYBIWIRE) ? 1 : 0) < 0) {
> > > > +                (proto_flags & FET_PROTO_SPYBIWIRE) ? 1 : 2) < 0) {
> > > >                 fprintf(stderr, "fet: configure failed\n");
> > > >                 goto fail;
> > > >         }
> > > > 
> > > > This appears to be a slightly different JTAG mode, and apparently
> > > > it's used by the new IAR software when querying devices on startup.
> > > 
> > > Hi Daniel,
> > > 
> > > Thanks, that one seems to do the trick for me. I briefly tested it
> > > and now it starts up and initialises correctly. Haven't been able to
> > > do any further testing due to time contraints.
> > 
> > Hi Hans,
> > 
> > That's good to know.
> > 
> > This seems to fix it for most others with an 5xxx series too, but I'm
> > a little hesitant to apply the change until I'm sure it's not going to
> > break support for other chips.
> > 
> > Perhaps the best idea for now would be to add a command-line flag to
> > select mode 2 -- perhaps "-J" as an alternative to "-j". It's a little
> > messy and possibly unnecessary but I don't have any better ideas for
> > now.
> > 
> > Any thoughts?
> 
> Maybe you can parse the option -j with an optional argument which
> specifies the method you use. -j would be the old way of doing things and
> -j2 could use the fix for newer FETs. What happens when you use this
> method on very old FET firmware? Do they understand this option?

Hi Hans,

I have an older FET here, but haven't had time yet to try it out. I'd
guess that the older FETs don't recognise this option though.

As for the flag, parsing -j/-j2 is a slight problem for getopt, so it
might have to be -j/-J. Another method that has occured to me is to try
mode 2 if identification with mode 0 fails.

- Daniel

Reply via email to