Author Topic: Scope that can decode USB  (Read 4790 times)

0 Members and 1 Guest are viewing this topic.

Offline Titan 4380

  • Contributor
  • Posts: 14
  • Country: au
  • Country: au
Scope that can decode USB
« on: August 24, 2017, 06:38:40 am »
Can anybody suggest a modestly priced scope that can decode USB?
 

Online BravoV

  • Super Contributor
  • ***
  • Posts: 5946
  • Country: 00
  • Country: 00
Re: Scope that can decode USB
« Reply #1 on: August 24, 2017, 06:49:54 am »
Define "modestly priced" in number.

Offline Titan 4380

  • Contributor
  • Posts: 14
  • Country: au
  • Country: au
Re: Scope that can decode USB
« Reply #2 on: August 24, 2017, 06:55:20 am »
Sub$3500 AUD
 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1539
  • Country: pl
  • Country: pl
  • Troll Cave Electronics!
Re: Scope that can decode USB
« Reply #3 on: August 24, 2017, 07:02:06 am »
Not gonna happen.

Even very expensive scopes can only analyze USB from signal integrity standpoint. For analyzing logic issues you need a protocol analyzer.
I love the smell of FR4 in the morning!
 

Offline MrW0lf

  • Frequent Contributor
  • **
  • Posts: 921
  • Country: ee
  • Country: ee
    • lab!fyi
Re: Scope that can decode USB
« Reply #4 on: August 24, 2017, 07:04:52 am »
Define "USB"? All you can have a go at with basic gear is USB 1.1 "Full speed" 12Mbps. PicoScope 2408B  Arduino<=>PC USB 1.1 traffic decoded:



Simplest model I'd recommend is 2206B.

Now if need "High speed" 480Mbps then suggest some "modestly priced" 1GHz gear :P Some old thread about this:
https://www.eevblog.com/forum/testgear/mdo3024-vs-msox3024t-usb-2-0-(lsfs)/
« Last Edit: August 24, 2017, 07:06:27 am by MrW0lf »
 

Offline blueskull

  • Supporter
  • ****
  • Posts: 12048
  • Country: cn
  • Country: cn
  • Power Electronics Guy
Re: Scope that can decode USB
« Reply #5 on: August 24, 2017, 07:07:46 am »
At least 1.5GHz analog BW is required to do proper USB2.0 signal inspection.
For just decoding, consider a USB protocol analyzer, which can be bought for less than $700 (ITIC analyzer). I have a LeCroy analyzer, the cheapest one, for $875.
 

Offline Titan 4380

  • Contributor
  • Posts: 14
  • Country: au
  • Country: au
Re: Scope that can decode USB
« Reply #6 on: August 24, 2017, 07:10:41 am »
Now its all starting to make sense. I have a DS2302A and I am at a loss to understand why Rigol will option a scope with USB triggers, but no decoders. :wtf:
 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 362
  • Country: de
  • Country: de
  • Sigrok associate
Re: Scope that can decode USB
« Reply #7 on: August 24, 2017, 08:20:41 am »
Which USB speed are you looking at? 1.1? 2.0? 3.0?
 

Offline Titan 4380

  • Contributor
  • Posts: 14
  • Country: au
  • Country: au
Re: Scope that can decode USB
« Reply #8 on: August 24, 2017, 10:40:21 am »
2.0
 

Offline darkstar49

  • Regular Contributor
  • *
  • Posts: 145
Re: Scope that can decode USB
« Reply #9 on: August 24, 2017, 12:28:42 pm »

Indeed... a scope that can decode USB 2.0 high-speed, i.e. at 480Mbps, requires min 5GS/s sampling rate and typically 1GHz or more bandwidth, something you're not likely to get for under 3500 AUD...
You'll get off far cheaper with a USB analyser ! but won't have a scope... obviously !

And to put it simply, if your budget is tight... you'll be in trouble anyway... afaik, there are 4 scope makers who offer USB decoding, i.e. R&S, Tek, Lecroy and Keysight... and known 'bypasses' (not) to pay for the decoder licences exist for only 2 of the 4...

Don't know what you need... but scope, cheap and USB decoding somehow do not fit very well together...   :-P



 
 

Offline tmbinc

  • Regular Contributor
  • *
  • Posts: 174
Re: Scope that can decode USB
« Reply #10 on: August 24, 2017, 03:13:55 pm »
It _really_ depends on what you want to do with it. USB, by design, is a high-latency protocol. That means that with a scope, unless you use very fancy triggers with segmented capture and a _lot_ of sample memory, you will likely not capture enough time to decode to a higher protocol level.

USB, without higher-level decodes, is a lot of data to look at (and ignore), especially when there are multiple devices on the bus.

If you're after USB2.0 electrical compliance, a scope is probably the right tool, but a simple edge trigger will likely already do enough good.

If you're after USB "issues", and you can rule out electrical/PHY problems, then you don't need a scope and a USB protocol analyzer will do a far better job. I have used a few, but I liked the LeCroy the most (probably because I paid the most for them - sigh). YMMV, most of the others are also very good.

If you're after the combination, like "My device is randomly crashing after receiving a write command from host", your best bet is to augment your device with trigger outputs (for example, toggle a GPIO in the "write" command handler), and then you don't need USB decoding. If you can't (or don't want to) modify your DUT, use a USB protocol analyzer with trigger output to trigger a scope - most of the USB PAs can have really complex triggers that for most scenarios are flexible enough to trigger at a useful point.

The one thing where a USB decoder in the scope is really nice is when you want to learn about USB, which I feel works best by looking at the raw USB packets on the wire at least once. But that you can equally do with USB1.1.

 
 

Offline jjoonathan

  • Frequent Contributor
  • **
  • Posts: 323
  • Country: us
  • Country: us
Re: Scope that can decode USB
« Reply #11 on: August 24, 2017, 03:29:54 pm »
> a scope that can decode USB 2.0 high-speed, i.e. at 480Mbps, requires min 5GS/s sampling rate and typically 1GHz or more bandwidth

Why 2x bitrate of BW? Is it something physical or just price grading?

I remember making a notebook in signals class that put square-ish pseudorandom bits through a variable lowpass filter and then plotted an eye diagram. The eye was fully open at BW = bitrate (albeit with completely rounded edges) and smoothly transitioned to fully closed at BW = 1/2 bitrate. Since that factor of 2 translates to many $$$ of scope, I'd like to understand the discrepancy.
 

Offline John_ITIC

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: us
  • Country: us
  • ITIC Protocol Analyzers
    • International Test Instruments Corporation
Re: Scope that can decode USB
« Reply #12 on: August 24, 2017, 08:49:52 pm »
Like others have stated: there are two aspects to analyzing USB signalling:

1) Analog: You'll need an oscilloscope with capabilities to create eye diagrams. Since there is no separate clock signal in USB 2.0 that can be used to trigger an Equivalent-time oscilloscope, you need to buy a real-time DSO scope that has built-in eye-diagram software for USB 2.0 (HS). The eye diagram will tell you whether the signal has sufficient amplitude and correct bit width at the receiver side but will not tell you whether the actual packets are correct or whether the higher-level protocol makes sense (for that, go to step 2 below).

2) Digital: USB Protocol Analyzers contain analog to digital PHY chips that allows the packets exchanged to be stored in memory, uploaded to a PC and displayed in rather complex software. Some USB protocol analyzers simply decode and display packet content in a flat list (makes it very hard to understand the higher-level protocol) while others re-create the actual protocol hierarchy (packets, transactions etc) based in in-depth knowledge of the USB protocol.

So, the question is whether you have any reason to doubt the signal integrity on the link under test or whether you need to decode the packet data. The tools are different. Luckily, USB 2.0 protocol analysis is much cheaper these days than scope decoders...
« Last Edit: June 25, 2019, 02:51:21 am by John_ITIC »
International Test Instruments Corporation
https://www.internationaltestinstruments.com
 
The following users thanked this post: electrolust

Offline Titan 4380

  • Contributor
  • Posts: 14
  • Country: au
  • Country: au
Re: Scope that can decode USB
« Reply #13 on: August 25, 2017, 12:44:12 am »
Thanks for all replies and suggestions. Let me reframe my original question;

What would I need to read or decode ASCII traffic coming from a USB 2.0 device. If for example, If I wanted to read XYZ data from a USB stepper driver, what would I need to do that?
 

Offline blueskull

  • Supporter
  • ****
  • Posts: 12048
  • Country: cn
  • Country: cn
  • Power Electronics Guy
Re: Scope that can decode USB
« Reply #14 on: August 25, 2017, 12:52:12 am »
Thanks for all replies and suggestions. Let me reframe my original question;

What would I need to read or decode ASCII traffic coming from a USB 2.0 device. If for example, If I wanted to read XYZ data from a USB stepper driver, what would I need to do that?

Is the USB2.0 device full speed or high speed? For a high speed device, you will at least have to pay $700 for a USB2.0 protocol analyzer.
For USB2.0 full speed, there are a lot of cheap 12Mbps decoders around.

BTW, USB serial port itself isn't a simple protocol. You will need to have quite some fun before getting the raw serial port data.
If possible, I think a better way is to tap into the serial port after USB-serial converter chip, that's much easier.
 

Online TK

  • Super Contributor
  • ***
  • Posts: 1090
  • Country: us
  • Country: us
  • I am a Systems Analyst who plays with Electronics
Re: Scope that can decode USB
« Reply #15 on: August 25, 2017, 01:55:28 am »
Is the data coming from a native USB device or a "serial UART" device through a USB bridge?  Maybe you just need a serial decoder (UART).
 

Offline Titan 4380

  • Contributor
  • Posts: 14
  • Country: au
  • Country: au
Re: Scope that can decode USB
« Reply #16 on: August 25, 2017, 02:29:19 am »
I have several FTDI based converters that I could use in conjunction with my scope, but I would like to understand if I will see anything meaningful on the screen. What I am not understanding is that if I use a USB to RS232 converter, how does the data go from 480MBPS to a crawl of 9600 bps or even 115200bps without a giant buffer
 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 1596
  • Country: au
  • Country: au
Re: Scope that can decode USB
« Reply #17 on: August 25, 2017, 02:38:53 am »
I have several FTDI based converters that I could use in conjunction with my scope, but I would like to understand if I will see anything meaningful on the screen.

No you won't.

What I am not understanding is that if I use a USB to RS232 converter, how does the data go from 480MBPS to a crawl of 9600 bps or even 115200bps without a giant buffer

Because it uses a very small buffer and a lot of handshaking. The driver sends a packet, the device clocks it out. While it's clocking it out it's responding to driver polls with "don't send me anything else, I'm not ready". As soon as it has enough buffer space it responds with "ok, thanks I'll take that data now".

Grab a copy of the USB 2.0 standards and have a read on bulk transfers. It's relatively simple and easy to understand.
 

Offline blueskull

  • Supporter
  • ****
  • Posts: 12048
  • Country: cn
  • Country: cn
  • Power Electronics Guy
Re: Scope that can decode USB
« Reply #18 on: August 25, 2017, 02:42:10 am »
I have several FTDI based converters that I could use in conjunction with my scope, but I would like to understand if I will see anything meaningful on the screen. What I am not understanding is that if I use a USB to RS232 converter, how does the data go from 480MBPS to a crawl of 9600 bps or even 115200bps without a giant buffer

First, most FTDI converters are using 12Mbps USB, not 480Mbps. Only very high speed ones, such as FT2232H and FT4232H are using USB2.0 high speed.
Second, there is something called synchronization. A local baud generator on chip generates Tx clock, and it reads data from USB SIE on a specific endpoint (behaved like a FIFO). When the FIFO is half empty, the USB SIE requests a new set of data from host. This way, the data rate can be controlled from UART converter chip.
When you initiates a write syscall, the kernel tries to access the VFS corresponds to USBttySx, then the TTY driver passes this to USB serial port driver, then to USB core, then to USB controller, eventually to USB chip. The sync is chained in the entire system, so your write will either timeout or be blocked until the chip spits all its data at UART speed (for sync write only. For async write, the sync chain for USB is still the same, but the OS provides the buffer).
 

Offline Titan 4380

  • Contributor
  • Posts: 14
  • Country: au
  • Country: au
Re: Scope that can decode USB
« Reply #19 on: August 25, 2017, 03:06:02 am »
Thanks to all for some very informative, but ultimately disappointing answers. I am digressing here, but why does my scope have a selectable USB trigger, but no decoder?
 

Offline Dubbie

  • Supporter
  • ****
  • Posts: 981
Re: Scope that can decode USB
« Reply #20 on: August 25, 2017, 04:07:49 am »
John's answer explains this.

USB is a complicated multilevel protocol that is far beyond a normal scope to decode.

Triggering is much much simpler.
 

Offline blueskull

  • Supporter
  • ****
  • Posts: 12048
  • Country: cn
  • Country: cn
  • Power Electronics Guy
Re: Scope that can decode USB
« Reply #21 on: August 25, 2017, 04:11:07 am »
I remember making a notebook in signals class that put square-ish pseudorandom bits through a variable lowpass filter and then plotted an eye diagram. The eye was fully open at BW = bitrate (albeit with completely rounded edges) and smoothly transitioned to fully closed at BW = 1/2 bitrate.

You only get this if your sample frequency is in sync with bit clock. In real life, scopes sample from internal clock, which is not syncced with USB PHY clock.
 
The following users thanked this post: jjoonathan, Titan 4380

Offline jjoonathan

  • Frequent Contributor
  • **
  • Posts: 323
  • Country: us
  • Country: us
Re: Scope that can decode USB
« Reply #22 on: August 25, 2017, 04:54:03 am »
Makes sense, thanks.
 
The following users thanked this post: Titan 4380

Offline exe

  • Supporter
  • ****
  • Posts: 1261
  • Country: nl
  • Country: nl
  • self-educated hobbyist
Re: Scope that can decode USB
« Reply #23 on: August 25, 2017, 01:59:58 pm »
Just in case, if signal integrity is fine, then you can lower communication speed to, e.g., 12Mbps and use a cheap scope to troubleshoot. But it looks like your problem is purely software and doesn't even need any hardware. I think there should be a way to sniff USB bus from OS.
 

Offline tmbinc

  • Regular Contributor
  • *
  • Posts: 174
Re: Scope that can decode USB
« Reply #24 on: August 25, 2017, 11:42:26 pm »
Thanks for all replies and suggestions. Let me reframe my original question;

What would I need to read or decode ASCII traffic coming from a USB 2.0 device. If for example, If I wanted to read XYZ data from a USB stepper driver, what would I need to do that?
The most obvious answer - that unfortunately doesn't include a scope or analyzer - is: Use a software tracer.

The issue with software is that a.) you need to run the code instrumented (i.e. if the USB host is locked down, or doesn't run on a PC / Linux board, you're out of luck), and b.) software trace suck. (The reason is that the interface to the USB host controller is very different from what happens on the bus: you enqueue packets, and the USB controller takes care of it, and gives you a result. Hence what you see in the trace is only what happened on the bus in a _successful_ case. This makes USB debugging slightly painful if you can't see what's happening on the bus. But not your issue here as you appear to have a working setup.)

There are also solutions for virtualization software, so you can run an unmodified OS/Software in a VM, and expose the host's USB device into it, and then log the data.

Or you could LD_PRELOAD/Detour calls into the USB library (libusb if you're lucky) and trace the messages this way. Involves a bit of coding but you can get much better results because you have more context.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf