Kitty USB Analyzer goes wireless
Since the Kitty USB Analyzer is browser based, you can easily hook it to a cheap ethernet
to wireless bridge such as the Linksys WET11b shown here. You can also attach
the Kitty USB Analyzer to a wireless router access point. Ethernet and a web interface
sets you free to use any machine with a browser.
H/W description
The Kitty USB Analyzer is a complete embedded computer based on the Ubicom IP2022 processor.
The computer contains 4 connections to the outside world. A power connection
(AC 100-240volts and 50Hz to 60Hz power universal wall-wart), a 10-base-t
ethernet connection and both A and B USB connectors. The H/W also contains
4Mbit (or 512k bytes) of off chip flash, 256K bytes of external Ram. The
H/W functions as a web server with various CGI functions to handle dynamic
data.
How does it work?
The Kitty USB Analyzer functions by being a wiretap on a USB line. It sits between a
device or devices under test and either a computer usb port or a hub port.
All bus transactions between the host and the device are sampled and stored
in on board memory. When a trigger event occurs, the Kitty USB Analyzer will fill the
remaining memory with samples. You use the web interface to look through
the samples and see exactly what went on on the USB bus as well as the timings
involved.
Triggering and Tracing
Tracing is data put in the trace buffer. If the memory is not full, the analyzer
is always tracing. If a trigger has not occurred, tracing will continue even
when memory fills up, by writing over the oldest traces. Everything that
happens on the USB plus timing information is put in the trace buffer. This
can be a huge amount of data, but display controls allow you to access just
the data you want.
Triggering is when the trigger condition applies and post trigger traces
are put in the trace buffer. Pre-Trigger is the maximum number of traces
put into the trace buffer before the trigger is encountered. Pre-trigger
will range from 0 to the selected maximum number of traces depending on when
the trigger condition is encountered. What the pre-trigger does is protect
a maximum number of traces before the trigger from being over written by
later traces. Post-trigger is the number of traces put into the trace buffer
after the trigger event.
Triggering criteria and trace display options are controlled from the configure
web page. When encountered, the trigger will start the post-trigger tracing
in the memory buffer. In addition you can trigger on any one or more of the
10 PIDs (SETUP SOF IN OUT DATA0 DATA1 ACK NAK STALL PRE). Triggering on nothing
can be disappointing and glacially slow.
See the Kitty USB Analyzer Triggering and Tracing page
The Filter Trace Display
The Filter Trace Display section allows you to control what gets displayed
to you after you have captured data in the trace buffer. The trace buffer
is not altered, so you can look at the same data with different filter options.
You can hide two of the data fields if you wish to reduce the amount of
information displayed - the sync and sync timing field can be surpressed,
and the byte offset in the trace buffer can also be suppressed.
You can also hide some kinds of packets that may clutter up your trace. You
can hide: SOF PRE packets. You can also hide all FULL_speed or LOW_speed
transactions. And finally you can hide NAKed transactions, so you can easily
find the transactions handling data.
Select all the configure information you want and then press "configure trigger".
This will present you with a display of what you selected as well as a URL
you can add to your favorites to always configure a display this way.
See the Kitty USB Analyzer Triggering and Tracing page
Searching
A second configuration html page is to search for interesting items in the
captured trace memory. Searches start at the beginning of the traces, at
the last place searched to, or at the end of the trace buffer (for backward
searches).
Searches can be run forward from the currently selected spot, or backward.
There are two things that can be searched for:
-
One or more PIDs (USB speak for packet IDs, which start every packet)
-
A specific bus condition, ie SE0, SE1, Full speed or Low speed
Some of the PID searches can contain additional search items: SETUP, IN,
OUT all can also require a specific address or endpoint.
See the Kitty USB Analyzer search page
FORMAT of trace display description
frame # 456 |
f=11999 sync 2684 SOF(xa5) frame 456 crc5
0x14 f=0
f=00039 sync 2692 SETUP(x2d) addr 2 endp 0
crc5 0x15
f=00076 sync 2692 DATA0(xc3) 0x80 0x06 0x00
0x01 0x00 0x00 0x12 0x00 crc=0xf4e0
f=00178 sync 2692 ACK(xd2)
|
The first field in the table gives you the USB frame number where the bus
activity took place. The field is also a link:
frame # 456 Click on the frame
number link to start the browser display with this frame. The
"f=11999_sync" gives the number of
USB full speed bit times since the preceding SOF. It is accurate to +-3 bit
times. It includes the data transfer which has no gaps, the EOP time and
in between packet idle times. The counter is reset every SOF (see the f=0
at the end of the SOF line?). So to calculate the timing of the above
SETUP packet, the time from it's sync to the DATA0 line is 76-39=37 bit times.
We know from the USB spec that a SETUP packet is 4 bytes long, including
8 bits of sync, 8 bits of PID 11 bits of addr/endp and 5 bits of crc5. This
totals 32 bit times. Then an EOP takes about 2 bit times and must be followed
by 1 or more idle times. In this case there were 3 idle usb clocks between
packets. There is some jitter in the timing being done on the Kitty USB Analyzer, so
some sync timings are +-3 bit times. See the Kitty USB Analyzer
Triggering and Tracing page to see how to remove the "sync" field from
the display if you choose.
The decimal number between sync and the PID name is an index into the Kitty USB Analyzer
sample buffer. The Kitty USB Analyzer cgi routines use this offset to start at specific
places in the trace memory. See the Kitty USB Analyzer Triggering
and Tracing page to see how to remove the "byte offset" field from the
display if you choose.
The next field is the text name of the PID and the hex number for that PID
(ie. SOF(xa5) or
SETUP(x2d) etc.)
The data field is presented as defined by the packet PID. If the packet contains
data, the crc captured is printed. If the crc or crc5 is bad, the crc field
is printed in RED (ie
CRC_ERROR!_crc=0xf4e1)
If a frame of data takes more than one tcp packet, another table entry is
created for more data and that new table entry will have the same frame #
xxx.
Field upgrade the Kitty USB Analyzer
There are two ways to upgrade the Kitty USB Analyzer in the field. First there is a
web upload capability found on the ipOS Status web
page. Second the Kitty USB Analyzer supports tftp as an upgrade method, where a
tftp client running on your PC sends an upgrade image file to the Kitty USB Analyzer
via ethernet. When enhancements and bug fixes are done for the Kitty USB Analyzer, the
new upgrade image will be posted here on the website so you can always have
the latest and greatest software.
Future Kitty USB Analyzer add-ons: Little-Woolly-Lamb Serial Data Analyzer
Someday, I will have a "pod" add-on that will plug into the Kitty USB Analyzer "B" USB
socket, called the Little-Woolly-Lamb Serial Data Analyzer. This pod will contain clips that will allow you
to connect up to a non-USB serial bus for capture. The current plan
is to support I2c, SMB, SPI, 1wire and rs232 sampling serial data at rates
up to 1 Mhz. If the protocol supports framing and addressing, acks and naks
that will be also displayed. Let me know if you think one of these non-USB
serial busses are of interest to you.
Installing and configuring Kitty USB Analyzer
The Kitty USB Analyzer is a server that needs to be configured to your network/ethernet
situation.
-
You need to give your Kitty USB Analyzer a fixed IP address and subnet mask compatible
with your internal network (or just your PC network adapter). You need to
connect either a CAT-5 crossover cable (not supplied) to directly connect
to your PC network adapter card, or a regular CAT-5 cable (not supplied)
to connect to your hub/switch/router/WAP.
-
Power up Kitty USB Analyzer. Then you need to configure your PC so it can talk to the
Kitty USB Analyzer, WRITE DOWN YOUR CURRENT SETTINGS so that later in step 4 you can
reset your PC to the real IP settings for your network. The settings
your Kitty USB Analyzer was shipped with are: Kitty USB Analyzer Network
Configuration. Your Kitty USB Analyzer MAC address will be different! To configure
the Kitty USB Analyzer, change your PC's IP address to somewhere on the 192.168.0.x
subnet where x is not 192 (default Kitty USB Analyzer address), not 255 and not 1. Do
not use an IP address that conflicts with another PC or TCP/IP device on
your network during configuration. Once you have changed your client PC IP
address and the subnetwork mask (255.255.255.0) to match the Kitty USB Analyzer, you
should be able to connect using any browser to the default address by typing
the following into the browsers URL window: "http://192.168.0.192/".
If you get the Kitty USB Analyzer home page, which is very similar to the top of this
page, you are nearly done!
-
In your browser, follow the links from the Kitty USB Analyzer home page ->ipOS
status->Network Configuration. Now you can set a new IP and subnetwork
mask to match your network. If you have multiple subnets in your location,
you can set the GatewayIP to your subnet router's IP address. Then anything
on the local net can access Kitty USB Analyzer, even if it is not on the same subnet.
When you click the "write" button, you will notice the link light goes out
on the Kitty USB Analyzer and then quickly comes back on. At this point the new Kitty USB Analyzer
IP address is active.
-
Restore your PC to your own network configuration. You can now access the
Kitty USB Analyzer by sending your browser to http:xxx.xxx.xxx.xxx (which you just set
the Kitty USB Analyzer too)!
-
If you forgot what address you gave the Kitty USB Analyzer, you can reset it to its
defaults as described: Kitty USB Analyzer Network
Configuration.
More info about Kitty USB Analyzer
Kitty USB Analyzer international power supply
The Kitty USB Analyzer power supply accepts most international voltages (100VAC-240VAC)
and 50Hz-60Hz.Picture of Kitty USB Analyzer power
supply. It is a "powerstrip" sized plugin that takes the same space as
one normal plug. For outside USA use, you may need to obtain a converter
for the plug that goes into the wall. The Kitty USB Analyzer uses AC power rather than
using the USB bus power so it does not affect the system under test (USB
bus supplied power consumption is strictly limited by the USB 2.0 standard).
FAQ
What is the impact (from a practical point of view) of the lack of support
for high speed in your analyzer? |
Well, you can't use it for high speed. If your host controller does not support
high speed then this does not matter at all. If you are bringing up a new
hardware core for high speed USB you probably need a much more expensive
high speed USB analyzer.If you are trying to tie a high speed device to a
high speed host and want to use a low cost analyzer like the Kitty USB Analyzer, you
will need to put a full speed (only) hub between your host and the device.
All high speed devices are supposed to fall back to full speed in this kind
of topology. |
Initially we need to support flash memory devices and usb floppy drives.
is your analyzer appropriate? |
Sure, it traces all full speed and low speed bus transactions. |
Do you know of any books or docs that are written for real engineers and
deal with the real world issues (timing and compatibility, for example) that
are encountered when adding a usb host controller to an embedded system? |
There is lots of stuff on the web about USB see:
http://www.lvr.com/usb.htm
Jan's books have a good reputation.There are lots of books on USB, but most
of them seem to just restate the spec, and sometimes add errors. The spec
is a free download from www.usb.org - it
is accurate and readable. |
USB is new to us (I did a simple usb device a couple of years ago (using
a ti chip) but nobody has done any host work). we have many electrical and
software engineers, many of them with, literally, decades of experience.
we are looking for real world circuits and code type advice, not something
like "an idiots guide to usb". |
Personally, I would not bother with a book. Just get the spec and use the
web. The Linux usb mailing list is very active: List-Archive:
linux-usb-devel. |
What is the deal with USB traffic when I am downstream of a hub? |
Well that is complicated.
If you have a full/low speed device on a port of a usb 2.0 high speed hub
you will see only full or low speed traffic. This is very convenient for
using a Kitty USB Analyzer. In general, connect your device on the bus so that only
traffic to your device under test will arrive. That way you can see everything
that is going on with your device, not other transfers on the bus. The Kitty USB Analyzer
will work with any full/low speed traffic but it may be confusing for debugging.
Many root hubs (the USB connectors directly on your computer) switch to a
companion full speed root hub and may send other USB traffic on the downstream
leg where you have your Kitty USB Analyzer connected. If you have a high speed host
on your computer you can connect your device through a high speed hub and
you will only see traffic to your device.
If you are connected to a high speed root hub you may see the same traffic
as downstream on a full speed hub. That is, you will see all downstream traffic.
But the USB spec says that you will not see upstream traffic unless you are
between the device and the hub port. So traffic going out from a port will
be seen, but traffic going upstream is not visible. Mainly you should avoid
this topology. |
| How can I look at enumeration descriptors other than decoding them myself
with the usb spec. |
One advantage of a text based output such as HTML is that you can use
text programs to process data. This is normal in the Unix/Linux world, but
rarer in Windows. So until the decode is contained in the Kitty USB Analyzer itself,
you can do a trace, save the capture to a file - all browsers support this.
Download a recent gawk version for your OS from
gawk download or
http://gnuwin32.sourceforge.net/packages/gawk.htm.
After you get gawk and put it in your systems "path" - download this
zip file which contains 4 small files.
It contains a windows .bat file that will given a basefilename -that does
not include an extension (but the file must have the extension .html on any
OS) will generate a couple of temporary files and finally a
"basefilename_decode.txt" filename. So then you can look at the enumeration
decoding evaluation. Feel free to enhance the decoder, it is all available
as AWK source. As you can tell by examining the AWK source programs high
level protocols are complicated - the early SETUP protocols are documented
in the USB spec - but the later ones are complicated and full of bugs. One
thing that greatly complicates decoding of much later setup transactions
in some protocols is the requirement to know what went earlier - during
enumeration. |
What are those big slide switches on the Kitty USB Analyzer pcb? |
They allow future capabilities. The pcb can have new software downloaded
into it at any time to reconfigure the software, but to reconfigure the hardware
I added the switches. For use as a Kitty USB Analyzer, the switches should be set to
"analyzer", "device", "full". They will never be changed while it
is in use as a USB bus analyzer, regardless of the speeds (FULL or LOW) of
the devices on the USB bus.
The switches might have to be switched when the Kitty USB Analyzer is used as Little-Woolly-Lamb Serial Data Analyzer.
Someday, if I was to do a host or device emulator for USB testing, the switches
would have to be switched to new configurations. |
| Is it possible to have Kitty USB Analyzer stream data to a socket to be recorded
instead of being displayed on a web page. |
Well, sort of. It is possible to communicate via wget and wget/post to
get data into and out of the kitty. So it is possible to use in a script
rather than a browser.
However, the current device has no pure socket interface for a tcp client/server
connection other than via http.
Even if there was a socket interface, the 10-baseT 10Mbit connection via
ethernet cannot in the worst case keep up with a busy 12Mbit USB full speed
bus. The kitty uses a 128K byte circular buffer to hold sampled USB data.
A trigger happens for a bus event you choose, and then the ram buffer is
frozen for display via http.
Think of the Kitty as a digital camera that takes large snapshots of the
USB bus data. It is not a "movie" camera. |
| When I go to the "status" pages, it displays whatever I asked and then
quickly "refreshes" with a page containing only the USB "buttons". It looks
like this is "almost intentional". |
Yes, it is intentional. It was dealing with the browser based interface
having a problem waiting for a trigger. A web server cannot send something
to a browser without the browser asking first. Say you wanted to trigger
on an "ACK" pid on the USB bus. Then watching some device, say a mouse it
would not trigger until the mouse moved or was clicked. However the browser
could time out after a while waiting for the trigger.
So after a "trace again" request, the "standard header" is displayed showing
one of the 8 links as "force trigger". This standard header uses the HTML
auto update tag for 5 seconds. This causes the browser to poll the Kitty
for this same page, which is cgi generated. When a trigger does occur (and
most of the time it is before the first display of this header), "force trigger"
is changed to "View Trigger". "View Trigger" is the indication that a trigger
has occurred.
If the trigger has not occurred, this page will auto update every 5 seconds
until it does occur. You can always press "force trigger" to stop the auto
update, the trace buffer will just show the static bus state usually SE0
or floating or USB bus transactions that did not satisfy the trigger condition. |
| Which browser works best with Kitty USB Analyzer? |
It is supposed to work with all browsers. If you find one that does not
work, please let me know. As a side note on Winxp, Internet Explorer seems
to run much slower than Opera or Firefox because it waits until an entire
page is downloaded before displaying anything. The other browsers seem much
faster because the immediately make the start of a trace visible. This is
usually only visible if you are requesting all 128K of traces to be displayed
on one page (which translate to about 2+ Megabytes of html) selected on the
"Set Trace Colors" page. |
Kitty USB Analyzer latest version: Version 1.2
Updates are here for the Kitty USB Analyzer. You can download to your PC any of the
following versions, a new version should not change the network settings
you have set into your Kitty USB Analyzer, it should just change how the Kitty USB Analyzer functions.
If you do not like an upgrade, you can always reload an earlier version.
To upload a new version from your PC to a Kitty USB Analyzer you can use tftp to
upload a file to the Kitty USB Analyzer. Most people will use the web interface
to upload the new version to the Kitty USB Analyzer. From the Kitty USB Analyzer "home" page, go
to "ipOS Status" and then go to "File System Upload" where you can "browse"
your way to the new upgrade file.
Version 1.2:
-
Fixes a bug where the Kitty USB Analyzer would hang when selecting a frame #xxx link
and the only traces were bus state info such as " BUS timeout 100ms idle
FS " . Introduced in version 1.1 and the only solution was to power off.
-
Kitty USB Analyzer version 1.2
Version 1.1:
-
Fixes a displayed only problem where after resetting to the default IP it
also reset the display to the default MAC address. It did not change the
MAC address, but the display was incorrect.
-
Fixes a bug where the bus state during inactivity is not correctly
reported/displayed.
-
fixes the display so that a reset bus is reported as "bus reset" and other
possible bus states "full speed idle", "low speed idle" and SE1 are correctly
reported.
-
Fixes a problem where if data being transferred contained the flag fields
that indicated a new packet, the display would be garbled. Now I think it
shows all possible packets correctly.
-
Fixes a bug where if NAKs are suppressed from trace memory (to save memory)
IN/NAK sequences are properly suppressed but OUT/DATA/NAK suppressed only
the DATA/NAK, not the OUT PID. NAK suppression is selected in the "triggering
and tracing" page.
-
Fixes "View Prev Page" to properly find a real PID to start the trace display.
-
Kitty USB Analyzer version 1.1
Original version: Kitty USB Analyzer version 1.0
Sample Traces
These show the enumeration of the same device by two windows operating systems.
Note that SEO means the bus is in reset, counted in 10ms time frames. The
complete enumeration for winxp for this device is much larger due to the
huge number of NAKs issued by the hardware while the very slow device does
something. Note that filtering both the display and the trace can make this
huge amount of information much more usable.
win98_enum_of_zoom_full_speed_modem.html
winxp_enum_of_zoom_full_speed_modem.html
|