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

0 Members and 1 Guest are viewing this topic.

Offline Titan 4380Topic starter

  • Contributor
  • Posts: 14
  • 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?
 

Offline BravoV

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

Offline Titan 4380Topic starter

  • Contributor
  • Posts: 14
  • 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: 1672
  • 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: 922
  • 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 Titan 4380Topic starter

  • Contributor
  • Posts: 14
  • Country: au
Re: Scope that can decode USB
« Reply #5 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: 377
  • Country: de
  • Sigrok associate
Re: Scope that can decode USB
« Reply #6 on: August 24, 2017, 08:20:41 am »
Which USB speed are you looking at? 1.1? 2.0? 3.0?
 

Offline Titan 4380Topic starter

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

Offline darkstar49

  • Frequent Contributor
  • **
  • Posts: 309
Re: Scope that can decode USB
« Reply #8 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

  • Frequent Contributor
  • **
  • Posts: 250
Re: Scope that can decode USB
« Reply #9 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: 783
  • Country: us
Re: Scope that can decode USB
« Reply #10 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: 510
  • Country: us
  • ITIC Protocol Analyzers
    • International Test Instruments Corporation
Re: Scope that can decode USB
« Reply #11 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 »
Pocket-Sized USB 2.0 LS/FS/HS Protocol Analyzer Model 1480A with OTG decoding.
Pocket-sized PCI Express 1.1 Protocol Analyzer Model 2500A. 2.5 Gbps with x1, x2 and x4 lane widths.
https://www.internationaltestinstruments.com
 
The following users thanked this post: electrolust

Offline Titan 4380Topic starter

  • Contributor
  • Posts: 14
  • Country: au
Re: Scope that can decode USB
« Reply #12 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?
 

Online TK

  • Super Contributor
  • ***
  • Posts: 1722
  • Country: us
  • I am a Systems Analyst who plays with Electronics
Re: Scope that can decode USB
« Reply #13 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 4380Topic starter

  • Contributor
  • Posts: 14
  • Country: au
Re: Scope that can decode USB
« Reply #14 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: 2106
  • Country: au
Re: Scope that can decode USB
« Reply #15 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 Titan 4380Topic starter

  • Contributor
  • Posts: 14
  • Country: au
Re: Scope that can decode USB
« Reply #16 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: 1115
  • Country: nz
Re: Scope that can decode USB
« Reply #17 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 jjoonathan

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

Offline exe

  • Supporter
  • ****
  • Posts: 2562
  • Country: nl
  • self-educated hobbyist
Re: Scope that can decode USB
« Reply #19 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

  • Frequent Contributor
  • **
  • Posts: 250
Re: Scope that can decode USB
« Reply #20 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.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9007
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Scope that can decode USB
« Reply #21 on: August 26, 2017, 07:19:53 am »
I remember reading that you could use a Beaglebone - which can do USB 2.0 host and USB 2.0 gadget at the same time - as a USB sniffer.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline Titan 4380Topic starter

  • Contributor
  • Posts: 14
  • Country: au
Re: Scope that can decode USB
« Reply #22 on: August 26, 2017, 11:12:05 am »
Wanting to read USB2.0 traffic is like a trip down the rabbit hole and gets more complex after each post. I jumped from an early 90's CRO to a DS2000 scope thinking that these new wonder devices would enable me to decode and freeze the data coming from a USB stepper driver. I wasn't so interested in the waveforms, but more the ASCII data being transmitted. I did considerable research (i.e.:looked at this forum) to understand that I could purchase a DS2070 scope and end up with a 300mhz unit with all triggers at no cost . I should have done more research to find out what is involved in monitoring USB transmissions.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26878
  • Country: nl
    • NCT Developments
Re: Scope that can decode USB
« Reply #23 on: August 26, 2017, 11:39:19 am »
When dealing with USB (or any serial interface like ethernet, PCI express) the electrical interface is the least interesting part. What you need is a USB protocol analyser!
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Leo Bodnar

  • Frequent Contributor
  • **
  • Posts: 803
  • Country: gb
Re: Scope that can decode USB
« Reply #24 on: August 26, 2017, 02:59:22 pm »
If you want to decode USB in hardware your best solution is USB protocol analyser with its associated software package.
The device class communications are quite complex and make almost no sense as just hex dumps.  You will drown in raw data.

I am using:
https://www.totalphase.com/products/beagle-usb480/
http://teledynelecroy.com/protocolanalyzer/protocoloverview.aspx?seriesid=414&capid=103&mid=511
There are also
https://www.ellisys.com/products/usbex200/index.php (industry standard)
and few others... http://janaxelson.com/development_tools.htm#analyzers

Before you make a jump make sure you are getting the right device class decoders in your software.
Otherwise you'll be looking at expensive and nicely formatted hex packets of raw data.  Often extra class decoders are extra, e.g. look at Ellisys pricing structure.

Teledyne Lecroy software is free, has lots of decoders and allows you to write your own decoding add-ons so if you are working with some proprietary data you can present it in a sensible way as [huge amounts of] data is streaming past.

Hardware analysers allow capturing sub-microsecond hardware timestamps so you can fix all the subtle problems in your MCU.
I wouldn't use scope unless you:
are syncing or analysing USB traffic interaction with external events on ~microsecond level
are designing low level stuff (PHYs, converters, isolators, etc)
have signal integrity or EMC problems

By the way Mercury T2 has input for external trigger.  It is my favourite analyser to date.

Total Phase software is simple, easy to use and also works on Mac and Linux.

Cheers
Leo
« Last Edit: August 27, 2017, 12:03:02 am by Leo Bodnar »
 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: de
  • Sigrok associate
Re: Scope that can decode USB
« Reply #25 on: August 26, 2017, 08:38:04 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?

If you just want to sniff the data, you could also use https://wiki.wireshark.org/CaptureSetup/USB to do this on the PC side.
 

Offline Titan 4380Topic starter

  • Contributor
  • Posts: 14
  • Country: au
Re: Scope that can decode USB
« Reply #26 on: August 26, 2017, 11:16:25 pm »
Thanks for your suggestions Leo. Its ironic that you should jump in on this thread, because it is one of your devices that I am also interested in monitoring to see how it can be implemented in other ways.Specifically, the BU0836X turned out to be an extremely reliable and robust unit, but I am convinced that its full potential has yet to be unlocked.
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5317
  • Country: gb
Re: Scope that can decode USB
« Reply #27 on: August 29, 2017, 03:10:07 pm »
 

Offline Leo Bodnar

  • Frequent Contributor
  • **
  • Posts: 803
  • Country: gb
Re: Scope that can decode USB
« Reply #28 on: August 29, 2017, 03:29:57 pm »
Which ones offer external trigger (either in or out, but preferably both)?
http://teledynelecroy.com/protocolanalyzer/protocoloverview.aspx?seriesid=414&capid=103&mid=511
They sell a cable for it but it's just a standard DIN connector on the back. It is both IN and OUT.
https://store.teledynelecroy.com/products/ac032xxa-x-mercury-external-trigger-cable

Leo

« Last Edit: August 29, 2017, 03:37:04 pm by Leo Bodnar »
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5317
  • Country: gb
Re: Scope that can decode USB
« Reply #29 on: August 29, 2017, 07:31:04 pm »
Which ones offer external trigger (either in or out, but preferably both)?
http://teledynelecroy.com/protocolanalyzer/protocoloverview.aspx?seriesid=414&capid=103&mid=511
They sell a cable for it but it's just a standard DIN connector on the back. It is both IN and OUT.
https://store.teledynelecroy.com/products/ac032xxa-x-mercury-external-trigger-cable

Leo



OK, thanks, very useful. I went for the LeCroy Mercury T2C standard, I may well need to do power delivery protocols later, but unlikely to need the advanced option's facilities. Either of those options can be purchased separately.

The ITIC solution is reasonably priced but seems to lack an external trigger: my current use case is figuring out what is happening in an MCU based HS device when performance inexplicably drops, so I need to time correlate MCU telemetry on the scope with the bus analyser. The signal integrity looks fine, it's a firmware problem in a vendor provided USB library under load.

The Ellisys stuff seems to be priced stratospherically as soon as you want external triggers.

The Beagle options appeared about 50% more expensive than the LeCroy T2C.
 

Offline bill@geektrap.com

  • Newbie
  • Posts: 1
  • Country: us
Re: Scope that can decode USB
« Reply #30 on: April 01, 2019, 02:27:58 pm »
WireShark software is free and open-source and works quite well.  Just add the USB decoders.  I've used it and a LeCroy Catalyst together and have no complaints about it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf