Author Topic: Debugging USB  (Read 9751 times)

mikyak

  • Member
  • ***
  • Posts: 9
Debugging USB
« on: November 07, 2011, 05:41:36 am »
How do you debug USB, do you use a serial connection to the PC ?

I tried the serial connection, and stepping the program with break points.
However, all these change the timing behavior of program, so that the windows driver
resets the usb line.

In the usb code examples and in the book there are no debugging constructs viz. printf or send_over_uart () .
Does that mean that they were not used during development ?

Kind regards!

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Debugging USB
« Reply #1 on: November 07, 2011, 09:50:49 am »
The tool I use most for USB debugging is a hardware protocol analyzer, which shows all of the traffic on the bus. See:

http://www.lvr.com/development_tools.htm#analyzers

If you don't have an analyzer, you'll need to use the debugging tools you have to obtain information. These can include print statements and sending serial data. Even when a breakpoint prevents restarting communications, you can often obtain useful information by viewing the contents of variables, registers, etc. at the breakpoint.

Jan

GCoelho

  • Member
  • ***
  • Posts: 2
Re: Debugging USB
« Reply #2 on: November 08, 2011, 01:18:40 am »
If you have Tek scope such as TDS7000B series or DPO7000, then you can use USB2.0 Protocol Analyzer software from www.prodigytechno.com. You can send email to contact@prodigytechno.com to get info on this s/w

Ray

  • Member
  • ***
  • Posts: 13
Re: Debugging USB
« Reply #3 on: December 01, 2011, 04:05:22 pm »
For what it is worth...

I tried to use the software only tools but they weren't quite enough for me. If I had a better understanding of the way the drivers worked and more experience with debugging USB this might be different. After a lot of looking around I went with a Mixed Signal Oscilloscope - USBee AX http://www.usbee.com/ax.html. This will do most of the things I need for a while. There are different versions available from USBee to suit different needs and budgets. I initially had issues with triggering and there are still the occasional errors, but I have worked out ways around this. The free interface seems to be a little buggy at times but nothing I can't live with for the moment. You can also write your own code with their api to trigger and capture from within your own programs. I intend to do this to capture data for transactions based on calls to functions rather than trying to switch between programs to manually initiate triggering.

Ray

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Debugging USB
« Reply #4 on: December 01, 2011, 04:55:54 pm »
Yes, the USBee AX is a very good deal if you need only low and full speed.

Jan