Hi Xiaofan,

The session transcript that you provided below seems to indicate a different
problem then my patch would fix in your case.  Was this for the Arch Linux
or all host systems?  One of your earlier messages indicated success, so
knowing that helps.

Judging from your log, you seem to be getting outright write errors out of
the USB port to the dongle.

I obviously don't have your dongle, target, and computer in front of me or
know your technical background, but here are some starting suggestions of
things I would try to narrow the problem:

1) If you have a DSO with a differential probe you may want to look at the
data signals emitted onto the USB link.  Are they reasonably clean at the
dongle?

2) As part of the previous suggestion, if you write a simple test loop and
emit one test command to the dongle at each startup, do you see signal
transitions at all or does the port seem to be dead during the failures?  If
you send one command at a time and everything works normally every time,
what happens if you modify the test loop to send the same command in rapid
succession instead?  Does the link then break?

3) If you have a good USB sniffer, have you done a closer inspection of what
is actually crossing the link?  The simple test loop helps here so that you
are not overwhelmed by data.

4) Verify that your board is actually being reset during initialization by
monitoring the reset line into the processor using the DSO or reset LED (if
your board has one).  Over 20 years of working on multitudes of different
processors and emulators I can't think of all the times that I nearly pulled
out my hair tracing odd problems only to find out that the board was not
reset like it should have been.  If your link is working at all, the very
first thing you should see is the board tossed into reset by the dongle if
the first few USB writes are interpreted correctly.

5) What version of libusb do you have on your system(s)?  If you are using
an older version, you may be running into bugs that have since been
corrected in the USB support library.

6) What hardware version of USB does your host system have (USB 1.0 or USB
2.0)?



Anyway some things to think about.

Gary


Gary Carlson

Gary Carlson, MSEE
Principal Engineer
Carlson-Minot Inc.






On 7/5/09 3:46 PM, "Xiaofan Chen" <[email protected]> wrote:

> On Mon, Jul 6, 2009 at 6:16 AM, Xiaofan Chen<[email protected]> wrote:
>> 
>> Thanks a lot. Right now I have zero failure rate during startup under
>> Ubuntu 9.04 for the LPC-P2148 and STM3210E-Eval, with both V3 and
>> V7 J-Link. Often I would have about 20-25% startup failure for
>> EMU_CMD_VERSION before your patch. Now it is zero percent.
>> Great job.
>> 
>> I will try out Arch Linux.
>> 
> 
> With your first patch, it does not work at all. With your new patch, it
> seems to work better but still failed. The initialization error is
> gone at least.
> 
> In any case, your patch makes things better and should be commited.
> 
> 1) V3/V7 J-Link and STM3210E-EVAL.
> [mc...@myhost jlinkv7]$ openocd -f stm3210e.cfg
> Open On-Chip Debugger 0.2.0-in-development (2009-07-06-06:37) svn:2462M
> $URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
> For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
> 1000 kHz
> jtag_nsrst_delay: 100
> jtag_ntrst_delay: 100
> Info : J-Link initialization started / target CPU reset initiated
> Error: J-Link command 0xde failed (-1)
> Error: J-Link command 0xdc failed (-1)
> Error: J-Link command 0x01 failed (-1)
> Error: J-Link command EMU_CMD_VERSION failed (-1)
> 
> Info : J-Link JTAG Interface ready
> Error: J-Link command 0xdd failed (-1)
> Error: J-Link command 0xdf failed (-1)
> Error: J-Link setting speed failed (-1)
> Error: usb_bulk_write failed (requested=6, result=-1)
> Error: jlink_tap_execute, wrong result -107 (expected 1)
> Error: usb_bulk_write failed (requested=6, result=-1)
> Error: jlink_tap_execute, wrong result -107 (expected 1)
> Error: J-Link command 0xdd failed (-1)
> Error: J-Link command 0xde failed (-1)
> Error: J-Link command 0xdc failed (-1)
> Error: J-Link command 0xde failed (-1)
> Error: J-Link command 0xdc failed (-1)
> Error: J-Link command 0xdf failed (-1)
> Error: usb_bulk_write failed (requested=6, result=-1)
> Error: jlink_tap_execute, wrong result -107 (expected 1)
> Error: J-Link command 0xdd failed (-1)
> Error: J-Link command 0xdf failed (-1)
> Error: usb_bulk_write failed (requested=6, result=-1)
> Error: jlink_tap_execute, wrong result -107 (expected 1)
> Error: usb_bulk_write failed (requested=6, result=-1)
> Error: jlink_tap_execute, wrong result -107 (expected 1)
> ^C
> 
> 2) V3/V7 J-Link and LPC-P2148
> [mc...@myhost jlinkv7]$ openocd -f lpc-p2148.cfg
> Open On-Chip Debugger 0.2.0-in-development (2009-07-06-06:37) svn:2462M
> $URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
> For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
> RCLK - adaptive
> jtag_nsrst_delay: 200
> jtag_ntrst_delay: 200
> Info : J-Link initialization started / target CPU reset initiated
> Error: J-Link command 0xde failed (-1)
> Error: J-Link command 0xdc failed (-1)
> Error: J-Link command 0x01 failed (-1)
> Error: J-Link command EMU_CMD_VERSION failed (-1)
> 
> Info : J-Link JTAG Interface ready
> Error: J-Link command 0xdd failed (-1)
> Error: J-Link command 0xdf failed (-1)
> Error: J-Link setting speed failed (-1)
> Error: usb_bulk_write failed (requested=6, result=-1)
> Error: jlink_tap_execute, wrong result -107 (expected 1)
> Error: usb_bulk_write failed (requested=6, result=-1)
> Error: jlink_tap_execute, wrong result -107 (expected 1)
> Error: J-Link command 0xdd failed (-1)
> Error: J-Link command 0xde failed (-1)
> Error: J-Link command 0xdc failed (-1)
> Error: J-Link command 0xde failed (-1)
> Error: J-Link command 0xdd failed (-1)
> Error: J-Link command 0xdf failed (-1)
> Error: usb_bulk_write failed (requested=6, result=-1)
> Error: jlink_tap_execute, wrong result -107 (expected 1)
> Error: usb_bulk_write failed (requested=6, result=-1)
> Error: jlink_tap_execute, wrong result -107 (expected 1)
> ^C
> 





_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to