HLA USB Traffic Decoding

The USB analyser (https://github.com/saleae/usb-analyzer) is very useful when debugging USB communication. Unfortunately even the most coarse view shows a large amount of traffic that it can be difficult to figure out what communication is going on. I have attached a picture with an example. Depending on what you are debugging you might not be interested in all the Sync and PID IN data.

I looked at writing a HLA in Python to process the data more to remove the communication that isn’t PID_DATA0/PID_DATA1 (the interesting communication) but the HLA shows a warning that the USB input isn’t supported.

Can the USB analyser be updated to support a HLA? It would also be great if Saleae could write an example USB decoder in Python as a starting point. Then people can use this to filter out the background communication and just focus on requests and responses. This would then allow the LA to be very similar to the expensive USB sniffers which offer similar features.

2 Likes

I do and have done similar stuff. For example for a Teeny 3.6 and now T4.x that have the ability for USB Host setup, I often try to capture the USB data transfers and try to get the data into a format maybe more similar to what WireShark or Beagle USB 12 might output. (Wish we could do the 480, but that is probably wishing for too much).

I have mentioned it in a few of the different threads, including: Logic 2.1.5 (Alpha 17) - #17 by Emmanuel

And I know that one of the Saleae developers was working on being able to do an HLA doing something similar:

One of the threads:

And another:

I don’t remember if this was ever added to the feature requests and/or if any progress has been made since then.

It sounds like you are looking for the same sort of features. The posts you link to are what I’m looking for as well. I never had a lot of luck analysing the exported the data as it was difficult to get a good idea what is going on.

It would be great if this could be added to the roadmap at: https://saleae.upvoty.com/

It does sound like huffman was working on it, at least at one point.

I just added an idea post below to begin officially tracking this feature request. I also linked it to this discuss post to add more context.

Feel free to add your votes and comments to it. It’s not on the roadmap yet, but we’d like to track user interest in it to help with prioritization. Right now, our HLAs support the following analyzers. Adding HLA support for a single analyzer is quite involved.

@alistair As for your comment below:

Depending on what you are debugging you might not be interested in all the Sync and PID IN data.

Would a simple Data Table filter (in this case for “VALUE”) help in your case? We’re in the process of evaluating how to improve our Data Table. if so, would you mind posting that idea below with that information? Feel free to link this discuss post to your idea post as well.
https://ideas.saleae.com/

1 Like

@timreyes - Thanks,

Yes having versions of the filtering might help. There was some discussion about some of it I think back in the thread:

As I mentioned back then, when I receive packets with data, I need the previous packet as well. That will give you context of if it is a Setup or an IN or an OUT packet, with the context.

But at a minimum it would help if one could filter out, all of the other stuff, like SOF, ACK, NAK, … type messages.

1 Like

Thanks @KurtE! Noted.

Thanks for adding that to the feature request @timreyes.

I can imagine that porting the USB analyser to the new HLA setup would be a lot of work. Hopefully others are interested in it and can up vote the feature request.

I included an example of what some interesting traffic looks like in USB. As you can see there are multiple transactions, so a simple value filter wouldn’t be enough. In this case it might be easier to do an inverse filter (as in ignore values that match a pattern).

Hi all!

Sorry for cross-posting from ideas.saleae.com… but I think I might reach more people here. This thread already has 4k views up to this day. I wrote a Python high level decoder for traces exported from Saleae Logic USB LS/FS.

It’s open source and you can find it on GitHub. It’s not a modified Saleae Logic analyzer but it’s a tool to process CSV files exported with Saleae Logic using Python.

Happy to hear any feedback and receive pull requests:
github.com/maehw/UsbInsight

UsbInsight - a high-level USB decoder to export USB transactions or packets from Saleae Logic traces - maehw/UsbInsight

Please note that this is an external tool and not a HLA extension. If people are interested, we could make this a binary to run on Windows or MacOS so that you don’t need a Python environment.

I haven’t checked your solution @KurtE - so I cannot tell the differences. But if I understand correctly, you’ve modified the existing USB analyzer Saleae originally provided.

2 Likes

Yes - I made a version of their LLA that outputs the new format, which allows you to then
use it as an input for an HLA. I also have an HLA that outputs the data that I am interested in.

Will have to try yours, next time I setup to do USB Host stuff. To see how well it works.

Kurt

Short update on this little side-project in case you are still interested: today, I recorded and analyzed a USB full-speed capture with my Saleae Logic analyzer. This made me add support for start-of-frame (SOF) packets as I had placed some assertions in the code that would fail when somebody tried to process USB full-speed (FS) instead of low-speed (LS) captures – because I had not yet recorded (and hence tested) my own ones. This is fixed… or at least works for me™ (YMMV). As my capture was very long… or my machine was very slow in processing, I’ve also added a progress bar (using Python module tqdm). Happy hacking!

And another short update: you can now export binary data of control transfers (on endpoints 0) and also the binary data of all other endpoints (Windows seems to call this “R/W pipes”). The R/W pipe data can be split by EP0 control transfers or dumped as a whole. Feel free to test it out and make additional suggestions. Or ask when there’s a lack of documentation.