Author Topic: USB Full-Speed Analyzer... Is that still a thing?  (Read 5184 times)

0 Members and 1 Guest are viewing this topic.

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: dk
USB Full-Speed Analyzer... Is that still a thing?
« on: July 13, 2022, 09:59:32 am »
Hey :)

So I'm starting to write my own USB stack and it's difficult without any debugging tool. I've been searching the net but I keep finding things that look SO OLD  :palm:

Examples:

Other options I've seen are:

Any suggestions/experiences you guys want to share? Do you think a hardware analyzer is necessary or could I get away with getting a software one?

Cheers
Simon
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: dk
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #1 on: July 13, 2022, 10:13:54 am »
And I just found some free tools (software) as well:


I might actually start with these and see if it is enough  8)
 

Offline wek

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: sk
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #2 on: July 13, 2022, 10:15:50 am »
>  I've been searching the net but I keep finding things that look SO OLD

I am 50+ and to you would look SO OLD, but don't you dare to tell me that face to face!

> Do you think a hardware analyzer is necessary or could I get away with getting a software one?

Not necessary, but very, very, very useful. It has paid itself several times over:  http://www.asix.net/dbg_sigma.htm (note that the USB analyzer plugin is paid extra). Not ideal, but workable.

I've heard praises on the Beagle one. There are "real" 'scopes/LAs, which have USB decoder built in or as an option. For fun/enlightement, if you have a LA/'scope at hand, capture a piece of stream and try to decode by hand.

Software analyzers show you things which may be beyond hw/sw layers which are of varying opacity, and usually present them in an unpalpable way (at least that was my impression). The free goto option is wireshark with some plugin (I am lazy to look it up - tried but was not impressed).

JW
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2299
  • Country: gb
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #3 on: July 13, 2022, 10:29:07 am »
sigrok PulseView has USB FS decoding, maybe you already have a supported LA.

Also, I haven't tried Alex's analyser, but I bet it works a treat...
https://www.eevblog.com/forum/projects/usb-sniffer-using-rp2040/
 
The following users thanked this post: Saimoun

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: dk
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #4 on: July 13, 2022, 11:04:46 am »
I am 50+ and to you would look SO OLD, but don't you dare to tell me that face to face!
Ha ha ha sorry - did not mean to upset anyone ;D  People can age, that's fine. But software and hardware does not age well in a world where everything changes so much in a couple of years. My main concern was whether people still use these tools since most of them do not seem like they had any update for the last few years.

The SIGMA sounds nice, but still about 300€ total so the same price as the other hardware options I've seen. Nice that it is EU-based though.

Awesome about the wireshark option, you know of any plugin?


sigrok PulseView has USB FS decoding, maybe you already have a supported LA.

Also, I haven't tried Alex's analyser, but I bet it works a treat...
https://www.eevblog.com/forum/projects/usb-sniffer-using-rp2040/
Thanks for the links. Alex's analyzer runs on a Rasperry board as I understood? I would need to get one, compile, upload the firmware, etc. - that might take a while.

My LA is an Analog Discovery (the first version, i.e. the black one). It has done the job so far. I never even thought about hooking it up to the USB lines to see - but without any plugin to sort out the data it will be a mess to look at I guess...
 

Offline zzattack

  • Regular Contributor
  • *
  • Posts: 126
  • Country: nl
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #5 on: July 13, 2022, 11:12:48 am »
I've purchased the one designed by forum member John_ITIC (http://www.internationaltestinstruments.com/products/97-1480a-usb-20-protocol-analyzer.aspx).
Comes with excellent software that's served me great in a few projects already. It's true HS compatible too, and price was pretty competitive as I recall. Maybe worth shooting him a message.

There was a 20% forum discount at the time too.
« Last Edit: July 13, 2022, 11:17:35 am by zzattack »
 

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: dk
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #6 on: July 13, 2022, 11:29:40 am »
I am sure it would do the job perfectly, it looks overkill for my needs though (and ships from the US).
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11236
  • Country: us
    • Personal site
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #7 on: July 13, 2022, 03:25:58 pm »
Thanks for the links. Alex's analyzer runs on a Rasperry board as I understood? I would need to get one, compile, upload the firmware, etc. - that might take a while.
It runs on the Pi Pico or any other RP2040 based board. They are readily available and cheap.

You don't need to compile anything, the UF2 binary is provided. You would need to make a pass-through cable and connect it to the pins.

This is not a perfect solution, but definitely the cheapest as far as hardware sniffers go.

Alex
 
The following users thanked this post: Saimoun

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: dk
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #8 on: July 13, 2022, 09:58:48 pm »
Thanks Alex for the reply and for making this!! I'll definitely give it a go  ;D
 

Offline TimCambridge

  • Regular Contributor
  • *
  • Posts: 98
  • Country: gb
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #9 on: July 14, 2022, 12:43:38 am »
We make one (www.bugblat.com/products/minisniff2/index.html) and getting the parts to built it is every bit as purgatorial as readers of this site would expect.

For instance, Digikey offer 2,842 non-obsolete Xilinx FPGAs. Of these 112 are in stock and only a few (all designed by Noah and his dad) are available in quantities of a few hundred.

Pricing? The scalpers offer one $4 part for $80, not a good fit for a sub-$100 product.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #10 on: July 14, 2022, 06:44:39 pm »
We make one (www.bugblat.com/products/minisniff2/index.html) and getting the parts to built it is every bit as purgatorial as readers of this site would expect.

Does your sniffer handle HS devices, and does it have Device Class decoding?

 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11236
  • Country: us
    • Personal site
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #11 on: July 14, 2022, 07:05:25 pm »
Does your sniffer handle HS devices, and does it have Device Class decoding?
It says on the page that it prevents HS devices from going into HS mode. So, it technically works, but some HS devices will not do much in FS mode. I think all cameras will pretty much just have a dummy descriptor for the FS mode.
Alex
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #12 on: July 14, 2022, 07:23:27 pm »
I'm guessing that's not what Bassman59 necessarily had in mind as far as supporting HS meant. But that's interesting that you at least managed to prevent a device from going into HS. (For those that don't know the details of USB, an enumeration first starts in FS mode and only after a proper transaction, both the host and device switch to HS if they both support it.) How did you do it, as the sniffer is just "sniffing", isn't it? Or did you make it act as some kind of "bridge"?

Anyway technically, handling HS mode with a RP2040 (I think you use the PIO for sampling?) would be absolutely impossible.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11236
  • Country: us
    • Personal site
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #13 on: July 14, 2022, 08:01:59 pm »
It was not me, it was for the TimCambridge product. My sniffer only supports FS mode. But the only way I see to prevent it is to disturb the HS chirp somehow, so it would not be a fully passive sniffer.

I'm about to publish a design for a cheap sniffer that supports all modes. It is based on an FPGA and I was going to wait until FPGAs are actually available, but I guess that's not happening any time soon. It still may be useful to some.
Alex
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #14 on: July 14, 2022, 09:38:06 pm »
I'm guessing that's not what Bassman59 necessarily had in mind as far as supporting HS meant. But that's interesting that you at least managed to prevent a device from going into HS.

If the thing only support HS devices by preventing them from actually running at HS, then it's not very useful. I keep putting off the purchase of a Total Phase analyzer, which actually does HS devices at HS.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #15 on: July 14, 2022, 10:05:37 pm »
It was not me, it was for the TimCambridge product. My sniffer only supports FS mode. But the only way I see to prevent it is to disturb the HS chirp somehow, so it would not be a fully passive sniffer.

OK, thought that was your own design ! So yeah, it must not be fully passive. I'm wondering how they do it. They must take control of the data pins in order to achieve this.

I'm about to publish a design for a cheap sniffer that supports all modes. It is based on an FPGA and I was going to wait until FPGAs are actually available, but I guess that's not happening any time soon. It still may be useful to some.

I'm sure that would be. Well, such sniffers do exist as commercial products, but they tend to be expensive.
As a quick note, using an ULPI transceiver (only a couple bucks) and an FPGA would be the fastest way of implementing this. I'm sure there are projects out there already, I haven't checked. You can definitely use a ULPI transceiver for USB sniffing.
« Last Edit: July 14, 2022, 10:08:35 pm by SiliconWizard »
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11236
  • Country: us
    • Personal site
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #16 on: July 14, 2022, 10:16:54 pm »
My design is based on CY7C68013A + LCMXO2-2000HC (1200 works too) + USB3343. I have a design based on MAX10 and just two USB transceivers for the capture and device side, but price-wise CY7 + cheap FPGA are much better. Plus this reduces system complexity, since there is no need to run the MCU inside the FPGA. User experience is also much better since CY7 can be updated remotely and I have FPGA programmer, so you don't need any programming tools even if you just built the board from blank parts.

I also have dedicated 3-level comparators on the DP/DM lines, which lets you see when HS termination was enabled. This is pretty useful when debugging HS devices, especially if you are making your own controller.

I was sitting on the design, since I did not have motivation to complete it, but I recently needed to use it for work and it was very useful, so I decided to focus on it and make it public finally.
Alex
 
The following users thanked this post: PCB.Wiz, 2N3055, Jacon, tellurium

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #17 on: July 14, 2022, 10:52:02 pm »
My design is based on CY7C68013A + LCMXO2-2000HC (1200 works too) + USB3343.

Oh OK, so that's basically what I suggested. ;D

I also have dedicated 3-level comparators on the DP/DM lines, which lets you see when HS termination was enabled. This is pretty useful when debugging HS devices, especially if you are making your own controller.

Doesn't the USB3343 already have means of detecting this internally, accessible via some register?
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11236
  • Country: us
    • Personal site
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #18 on: July 14, 2022, 10:57:24 pm »
Doesn't the USB3343 already have means of detecting this internally, accessible via some register?
FS and HS modes are very different in a way they work. FS uses voltage signaling and HS is current driven and the typical voltage levels for the HS are much lover than 3.3 V.

The switch to HS mode starts with a number of state toggles (chirp). After 10 toggles are detected, HS capable device enables the termination resistors, which drops the voltage level. FS devices ignore those toggles.

This is impossible to detect with USB3343, since you need to tell it in what mode to receive and it uses completely separate analog paths for FS and HS.
Alex
 

Offline bson

  • Supporter
  • ****
  • Posts: 2269
  • Country: us
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #19 on: July 16, 2022, 08:15:51 pm »
If you're going to implement USB stacks, devices classes, that sort of thing then a USB protocol analyzer is an essential investment IMO.  I've been very happy with my LeCroy Mercury T2, but these days I'd get one with USB PD capability.  (I will probably upgrade the T2 for this reason, unfortunately it's not just a license code.  It requires the T2C with USB-C connectors and hence CC pins.)
« Last Edit: July 16, 2022, 08:24:37 pm by bson »
 
The following users thanked this post: Saimoun

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2299
  • Country: gb
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #20 on: July 16, 2022, 08:40:21 pm »
Even a software only analyser is somewhat useful, maybe all you need if you are using a proven usb stack in your firmware. I've reverse eng'd and re-implemented proprietary usb device protocols using just Wireshark as the analyser tool. But yeh, for low-level stuff its no help at all.
 
The following users thanked this post: Saimoun

Offline prosper

  • Regular Contributor
  • *
  • Posts: 78
  • Country: ca
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #21 on: July 26, 2022, 08:34:29 pm »
I use a DSLogic Pro analyzer. Their software is good. Also works with PulseView from Sigrok. Both can decode USB. USB FS (12MBps) is no problem. High speed - not so much
 
The following users thanked this post: Saimoun

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #22 on: July 26, 2022, 08:47:14 pm »
I use a DSLogic Pro analyzer. Their software is good. Also works with PulseView from Sigrok. Both can decode USB. USB FS (12MBps) is no problem. High speed - not so much

Good tip. I do have a DSLogic Pro as well and it's a very useful tool for a reasonable price.
Never used it for USB decoding, but it does support USB protocols including USB PD.

Of course it won't work with USB HS due to the bandwidth of this device, but the OP only asked for FS.

 
The following users thanked this post: Saimoun

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9007
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #23 on: July 27, 2022, 01:05:17 am »
Wouldn't it be possible to use a Raspberry Pi 4 since it supports device mode and host mode simultaneously? Back in the day, something similar could be done with the Beaglebone.
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 SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: dk
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #24 on: August 01, 2022, 10:33:37 am »
Thank you all for the replies!


I've just ordered a R PI Pico, that's by far the cheapest and simplest option and I'm pretty sure it will be enough - all I need is to sort out the enumeration, once this is running my usage of USB is super basic.
So thanks Alex for the awesome free software - I'll update here how it goes :)

Also - I had a quick look at DSLogic Products which look pretty good!! Love the company, the vibe, and funded with a Kickstarter :D
So I'll definitely consider that for the future, especially since it's a nice upgrade to my current Logic analyzer (analog discovery 1).
Do you guys know if the DSLogic Plus support USB debugging? I could not find that info anywhere...
 


Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: dk
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #26 on: August 01, 2022, 11:32:44 am »
Maybe this can be of interest for your task.

https://github.com/sekigon-gonnoc/Pico-PIO-USB

Has been discussed on the forum too: https://www.eevblog.com/forum/microcontrollers/amazing-project-usb-fshostdevice-implementation-using-pio-of-rp2040/msg4180372/#msg4180372
Thanks but I think you missed the point :) I'm doing USB device only on a GD32 MCU, I just needed a USB HW debugger and plan on using the one Alex made running on a Raspberry Pi Pico ;)
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #27 on: August 01, 2022, 07:09:20 pm »
Thanks but I think you missed the point :) I'm doing USB device only on a GD32 MCU, I just needed a USB HW debugger and plan on using the one Alex made running on a Raspberry Pi Pico ;)

That you did not write in your posts here, at least I did not see it. Just that you needed a way to debug USB on a hardware level because you are writing your own stack.

For this the code for the pico might be useful as a guideline.

But with a device only USB implementation you don't need a separate hardware USB debugger per se. I did my own bare metal CH340 implementation on a STM32F103. During the development I used wireshark on my linux mint machine. There is USB support in it with some additional setup and it was helpful in solving some problems.

I can dig up the steps I took to get wireshark up and running if you like.

The code I wrote is a bit crude but it works. Code is here: https://github.com/pecostm32/STM32F103C8_USB_CH340

Offline SaimounTopic starter

  • Frequent Contributor
  • **
  • Posts: 548
  • Country: dk
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #28 on: August 05, 2022, 08:45:35 am »
Sorry did not mean to pry :D

Thanks for the code - that's awesome!

And yes I think with wireshark and Alex's USB debugger (I mean I bought the Pico now :D ) I should be fine.

Thank you all for the help ;)
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2299
  • Country: gb
Re: USB Full-Speed Analyzer... Is that still a thing?
« Reply #29 on: August 05, 2022, 09:31:02 am »
Also - I had a quick look at DSLogic Products which look pretty good!! Love the company, the vibe, and funded with a Kickstarter :D

Hmm, except that they are a bunch of thieving knobs who merely used the Kickstarter and open source vibe for their own benefit.

When they started up, they stole the open source GPL licensed PulseView GUI from the sigrok project. Made their own changes to it as needed for their analyser and declined to openly publish their source code as required by the license. They made some token gesture to publish on github but AFAIK there were significant disparities between that repo and their shipped binary. The github repo still exists but I would still be extremely suspicious that it reflects the current binary.

The original PulseView developer discusses this situation at the link below (I'm avoiding youtube inlining).
Code: [Select]
https://youtu.be/xZ5wKYnCNcs?t=1622

I use the Kingst analysers which are also good value and are supported in sigrok / PulseView. IIRC the specs are better than the non-pro DSLogic analysers.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf