Computer Access Technology Corporation 2403 Walsh Avenue, Santa Clara, CA 95051-1302 Tel: +1/408.727.6600 Fax: +1/408.727.6622 CATC™ Detective™ USB Bus & Protocol Analyzer User’s Manual Version 2.
CATC CATC Detective User’s Manual Version 2.21 TABLE OF CONTENTS 1. INTRODUCTION....................................................................................................................................................1 1.1 USB OVERVIEW .......................................................................................................................................................1 2. CATC DETECTIVE USB BUS & PROTOCOL ANALYZER ...............................................................
CATC CATC Detective User’s Manual Version 2.21 4.4.2.3 Field Formats ............................................................................................................................................................21 4.4.2.4 Hidden Elements .......................................................................................................................................................22 4.4.2.5 Field Colors ..................................................................................
CATC CATC Detective User’s Manual Version 2.21 1. INTRODUCTION The CATC DETECTIVE USB Bus & Protocol Analyzer is an invaluable development and test tool for Universal Serial Bus designers. When connected to any point in a USB network, the Detective USB analyzer, like the CATC Inspector advanced USB analyzer, continuously monitors all bus activities and alerts the user to any abnormal bus conditions in an easy to use, menu driven, Windows software environment.
CATC CATC Detective User’s Manual Version 2.21 2. CATC DETECTIVE USB BUS & PROTOCOL ANALYZER 2.1 General The CATC Detective USB Bus & Protocol Analyzer captures, analyzes, and saves USB traffic data, based on a user-specified trigger signal, which can be supplied manually, programmatically, or via external hardware. USB System Under Test USB Test Probe CATC Detective USB Analyzer System The Detective USB analyzer is designed to turn a 386/486 or Pentium class PC into a USB test station.
CATC • • • • • CATC Detective User’s Manual Version 2.
CATC CATC Detective User’s Manual Version 2.21 2.4 The Detective USB Probe The Detective USB probe is an external box, about 4.5×2.5×1.5 inches, with a female DB15 connector on one side and two USB connectors (one A-type and one B-type) on the other. The probe is designed to connect to any point in the USB system as a passive listening device, without interfering with bus traffic. See the System Setup section for details on connecting the Probe to a system.
CATC CATC Detective User’s Manual Version 2.21 “External Start” or the “External Stop” recording mode. Once one of these recording modes has begun, the analyzer waits for an external trigger signal to either start or end the recording session. Manually pushing the TRIG button will assert the external trigger signal and thus affect the operation. Note: Early versions of the Detective USB Probe have either two A-type USB connectors or two A-type USB connectors and one B-type USB connector.
CATC CATC Detective User’s Manual Version 2.21 TRIG Signal Sample software Routine case IOCTL_START_TRIGGER_RTS: switch (gTriggerDongle) { case SERIAL_PORT_TRIGGER_DONGLE: outp (0x3fc, 00); break; case PARALLEL_PORT_TRIGGER_DONGLE: outp (0x378, 00); break; }//switch break; case IOCTL_STOP_TRIGGER_RTS: switch (gTriggerDongle) { case SERIAL_PORT_TRIGGER_DONGLE: outp (0x3fc, 02); break; case PARALLEL_PORT_TRIGGER_DONGLE: outp (0x378, 0xFF); break; }//switch break; 2.
CATC • • CATC Detective User’s Manual Version 2.21 Connect the DB25 male connector on the other side of the ribbon cable to the DB25 female connector of the 25-pin cable (included with the USB Detective package). Connect the DB25 male connector on the other side of the 25-pin cable to the parallel port of the PC running the USB host software.
CATC CATC Detective User’s Manual Version 2.21 Note: The B-type USB connector on the Detective Probe is normally connected to the upstream USB port, while the A-type connector is connected to the downstream port. Note: Early versions of the USB Detective Probe do not contain the B-type USB receptacle. These Probes have only the two A-type USB connectors.. The CATC Detective Bus & Protocol Analyzer hardware is now ready for operation. 3. SOFTWARE INSTALLATION (ALL VERSIONS) 3.
CATC CATC Detective User’s Manual Version 2.21 3.1.1 Standard Version (Win 3.1 & Win 95) The installation program copies the following files to the PC’s hard drive. To the \USBDTCTV directory (or that otherwise specified by the user): • USBDTCTV.EXE executable code of the CATC Detective program • USBDTCTV.DLL DLL for the CATC Detective program • CLS_HID.DLL DLL for HID Class device decoding • USBDTCTV.HLP CATC Detective help file • DEFAULT.OPT default DISPLAY function settings • DEMO.
CATC CATC Detective User’s Manual Version 2.21 The installation program modifies the system registry to install the CATC Detective driver. 3.2 Running The Software The CATC Detective software is a Windows application, and can be run under Windows 3.1, Windows 95, and Windows NT. To start the program, double-click on the file name (located with the Explorer or equivalent service), or on the CATC Detective icon created during the software installation. The program will start with the main window active.
CATC CATC Detective User’s Manual Version 2.21 Additionally, several of the most frequently used functions can be activated by specific icons located on the toolbar immediately below the pull-down menus. Each icon’s functionality is identified in the left portion of the status bar (at the bottom of the window) when the pointing device cursor moves over the icon. Finally, several operations can be invoked by clicking directly on the affected packet fields (using pop-up menus). 4.2.
CATC CATC Detective User’s Manual Version 2.21 4.2.1.1 Device Class Status The center segment displays the currently selected USB Device Class, used when displaying decoded Device Class requests. As described under Recording Status, below, this information will be temporarily overwritten during recording activity. 4.2.1.
CATC CATC Detective User’s Manual Version 2.21 4.2.2 USB Traffic Error Displays The analyzer detects a variety of USB traffic errors, and displays them as follows: Packet #3 above has an invalid PID value; the PID value field is colored red, and the rest of the packet is marked as “Invalid Data”. Packets #4 and #5 have incorrect CRCs; the CRC value field is colored red, as are the preceding fields associated with the CRC value.
CATC CATC Detective User’s Manual Version 2.21 The File menu includes the following functions: 4.3.1 Open... Open an existing, previously recorded “*.usb” file (i.e., a CATC Bus & Protocol analyzer USB traffic file). 4.3.2 Close Close an open traffic data file. 4.3.3 Save As... Save the currently displayed USB traffic data file with a newly-specified file name (more correctly, Rename... the file).
CATC CATC Detective User’s Manual Version 2.21 4.3.6 Printer Setup... The “Printer Setup...” menu item is a standard Windows function that allows configuring of the printer (paper size, source, orientation, etc.). 4.3.7 Print... Print all or a selected range of the current USB traffic data file. Activating this function opens up the following selection box: The specified traffic information will be printed as currently displayed, in color or grayscale as supported by the destination printer.
CATC CATC Detective User’s Manual Version 2.21 4.4.1 Recording Options... The “Recording Options...” menu item enables customization of the recording criteria, using the following dialog box: This box includes controls for trigger selection, idle state recording, bus speed selection, constraining the memory buffer size, and a variety of file-related functions.
CATC CATC Detective User’s Manual Version 2.21 4.4.1.1.1 Manual Trigger In this mode, the analyzer will start to record when the user activates the “REC” icon or “Start” in the Record Menu, and stop when the CATC Detective on-board buffer memory is full or when the “STOP” icon (or menu function) is activated, whichever comes first. 4.4.1.1.2 External Start Trigger In this mode, the analyzer starts recording when an external trigger signal is detected.
CATC CATC Detective User’s Manual Version 2.21 Although this permits greatly increased recording times, there are two associated drawbacks: 1. When bus traffic is at a minimum, it can take a long time to fill the analyzer’s recording memory. Once a triggering event has been detected it may still take several minutes before recording stops, due to limited bus traffic filling the memory.
CATC CATC Detective User’s Manual Version 2.21 4.4.1.8 Buffer Size When recording without Idle, or from a low-speed branch, it is often useful to use less than the full buffer space of the Detective analyzer (to save recording time, or reduce the amount of captured data). The “Buffer Size” panel of the Data Recording Options dialog box allows selection of the desired portion (from 10% to 100%) of the buffer memory. 4.4.2 Display Options... The “Display Options...
CATC CATC Detective User’s Manual Version 2.21 4.4.2.1 View Type The user can choose whether to view recorded data in a “global” fashion (i.e., displaying all of the data) or “by device”. In the latter case, a device is specified by entering its address and, optionally, an endpoint number (if no ENDP is specified, all endpoints are included); subsequently, only SOF (start of frame) packets, and those pertaining to transactions with the specified device will be displayed.
CATC CATC Detective User’s Manual Version 2.21 4.4.2.3 Field Formats The CATC Detective software supports several different formats in which the USB traffic data can be displayed. When the ‘Field Formats’ button is selected, the following dialog box opens, enabling a choice of viewing mode (either binary or hexadecimal format) for each of the special message fields (Sync, PID, CRC, etc.). In addition, each field can be viewed with the most significant bit (MSB) positioned on its left or right side.
CATC CATC Detective User’s Manual Version 2.21 4.4.2.4 Hidden Elements It is occasionally convenient to display only some of the different USB packet fields. For example, eliminating the display of Sync and Idle state fields (in situations where they are not significant) can often simplify, and thus clarify, the traffic display. The Hidden Elements button, which brings up the following dialog box, allows customization of the message fields to be included in the display.
CATC CATC Detective User’s Manual Version 2.21 4.4.2.5 Field Colors The Field Colors button allows customization of the color associated with each field in the message, using the following dialog box: Users may choose to experiment with this option to achieve a color combination that is best suited to a particular graphic system. A brighter color might be appropriate for a specific field that should stand out in the display (e.g. the Setup PID field).
CATC CATC Detective User’s Manual Version 2.21 4.4.2.9 Display Configuration Name This field is used to enter a text string (30 characters maximum) to be associated with the current set of Display Options. This name will be saved with the option set, and appear as part of the title of the view window that is created using this set of options. 4.5 The Record Menu The Record menu has two items, “Start” and “Stop”, described below.
CATC CATC Detective User’s Manual Version 2.21 4.6 The Report Menu The Report Menu contains five items, used to generate information displays concerning the current traffic data view. 4.6.1 File Information The File Information menu item displays information about the traffic file currently being viewed, including the recording time and conditions, and any comment line that may have been added to the file.
CATC CATC Detective User’s Manual Version 2.21 4.6.2 Timing Calculations This menu item (enabled only for files recorded with Idle state) opens the following “calculator” display, permitting computation of the time difference between any two packets in the file: Entering relevant packet numbers and selecting the “Calculate” button results in a display of the packet-to-packet time (measured from start of Sync to start of Sync) in both microseconds (or milliseconds), and bit times.
CATC CATC Detective User’s Manual Version 2.21 The following example shows such a display for a data capture of USB traffic, using isochronous data transfers (the nature of the device—a camera—accounts for the high percentage of bus utilization): Selecting the “Show Formulas” button presents the following display, summarizing the formulas used to compute bandwidth utilization.
CATC CATC Detective User’s Manual Version 2.21 Note: The active file display can be scrolled, and other files opened; the calculator dialog box remains open (and frontmost) until “Cancel” is selected, or all files closed. Computations are always performed on the currently active file. 4.6.
CATC CATC Detective User’s Manual Version 2.21 Selecting “OK” in this dialog will subsequently display a listing of possible transaction errors detected in the specified range of packets, such as: When there are long lists of packets containing the same transaction error (as in the above example), only the first 20 will be shown, followed by an ellipsis (...).
CATC CATC Detective User’s Manual Version 2.21 Note that—unlike the other statistics—the packet error count is computed for the entire data file, not just for the range of packets selected in the earlier dialog box. Traffic statistics data can be saved (with the “Save As...” button) for future use. See “Saving Summaries as Text Files”, below. 4.6.
CATC CATC Detective User’s Manual Version 2.21 4.7 The View Menu 4.7.1 Add View The Add View function is used to open a new window with an additional view of the currently selected USB data file. This is useful to: • view the recorded data in a different format, or • view (in conjunction with the “Tile Windows” function) two portions of the data file simultaneously.
CATC CATC Detective User’s Manual Version 2.21 4.7.3 Hide NAKed Transactions This menu item functions identically to the Hide SOF operation, except that it is used to suppress the display of any packets pertaining to NAKed transactions. 4.7.4 Zoom In The zoom entries in the View Menu provide an ability to adjust the size of the displayed elements in a USB traffic file, in order to represent more (or less) information on the screen (or printed output). Nine levels of zoom are implemented.
CATC CATC Detective User’s Manual Version 2.21 IMPORTANT: If the appropriate Device Class is not supported by the Detective software, the user should select the Standard Request Only option. Applying an improper Device Class specification to class-specific commands will display undefined results! Note: A Device Class can also be selected by clicking with the right mouse button on the title of any SETUP field on the screen. See “The Device Decoding Pop-Up Menus”.
CATC CATC Detective User’s Manual Version 2.
CATC CATC Detective User’s Manual Version 2.21 4.8.2.1 Decoded Standard Requests If the decoded standard request is GET_DESCRIPTOR and the requested descriptor is DEVICE or CONFIGURATION, or the request is SET_DESCRIPTOR, a button called “Show Descriptor Data” appears in the USB Device Request Data dialog box (as in the above example).
CATC CATC Detective User’s Manual Version 2.21 If the decoded standard request is GET_DESCRIPTOR and the requested descriptor is STRING, the “Show Descriptor Data” button displays a form similar to the following, showing the string decoded according to USB Specification 1.
CATC CATC Detective User’s Manual Version 2.21 If a Configuration request is made, the device is expected to return a configuration descriptor and all interface and endpoint descriptors. In this case, Next and Previous buttons will appear at the bottom of the form, allowing viewing of all the returned descriptors in the order in which they were sent by the device. The scrollbar at the right side of the form permits viewing of all the entries.
CATC CATC Detective User’s Manual Version 2.21 If the decoded standard request is GET_INTERFACE (or GET_CONFIGURATION), a button called “Show Alternate Setting:” (or “Show Configuration:”) appears in the USB Device Request Data dialog box, as follows: Selecting this button displays the value that was returned by the device (on the same form, in a small window immediately below the button).
CATC CATC Detective User’s Manual Version 2.21 If the decoded standard request is GET_STATUS), a button called “Show Status” appears in the USB Device Request Data dialog box; selecting this button brings up a form similar to the following, displaying the status information returned by the device, decoded according to USB Specification 1.0: The form displays the recipient of the request (device, interface, or endpoint) as part of its title.
CATC CATC Detective User’s Manual Version 2.21 4.8.2.2 Decoded Hub Class Requests Decoded USB Hub Descriptor If the decoded standard request is GET_DESCRIPTOR, a button called “Show Descriptor Data” appears in the USB Device Request Data dialog box (as in the earlier example). Selecting this button brings up a form similar to the following, displaying the returned Hub descriptor, decoded according to USB Specification 1.0: The scrollbar at the right side of the form permits viewing of all the entries.
CATC CATC Detective User’s Manual Version 2.21 Decoded Hub Status/Change for Hub Device The following form displays the hub status information that was returned by the USB Hub on a hub-class-specific GET_STATUS (GetHubStatus) request, decoded according to USB Specification 1.0: Corresponding change information can be viewed using the Next button at the bottom of the form. The scrollbar at the right side of the form permits viewing of all the entries.
CATC CATC Detective User’s Manual Version 2.21 Decoded Port Status/Change for Hub Device The following form displays the port status information returned by the Hub on a hub-classspecific GET_STATUS (GetPortStatus) request, decoded according to USB Specification 1.0: The form displays the number of the port for which status information was requested in its title. Corresponding change information can be viewed using the Next button at the bottom of the form.
CATC CATC Detective User’s Manual Version 2.21 4.9.1 Go to Packet... When the “Go to Packet...” menu item (or the associated toolbar icon) is selected, the following dialog box opens. To move quickly to a view of a specific packet, enter the packet number and select OK; the display will be repositioned with the specified packet at the top. 4.9.
CATC CATC Detective User’s Manual Version 2.21 Selecting “Find...” (or the associated toolbar icon) brings up the following dialog box: As a rule, the general search parameters (Direction, Origin, and Scope of search) should be selected prior to the specific ones (PID, Error Condition, Frame, ADDR & ENDP, Static Bus Event, and Data String), as selecting the “OK” button in the specific event dialogs will launch the search immediately, without returning to this initial setup screen.
CATC CATC Detective User’s Manual Version 2.21 4.9.3.1 Find PID Selecting the PID button brings up the following dialog box, to allow selection of a specific PID type: Selecting the “OK” button will then launch the search for the selected PID, using the search direction, origin, and scope previously specified.
CATC CATC Detective User’s Manual Version 2.21 4.9.3.2 Find Error Condition Selecting the Error Condition button brings up the following dialog box, to allow specification of particular error conditions (or, by selecting “All”, any error condition): Selecting the “OK” button will then launch the search for the selected error condition, using the search direction, origin, and scope previously specified. 4.9.3.
CATC CATC Detective User’s Manual Version 2.21 4.9.3.4 Find ADDR and ENDP Selecting the ADDR and ENDP button brings up the following dialog box, to allow selection of a specific device address and endpoint: The search can be restricted to any combination of In, Out, and Setup packets by marking the appropriate checkboxes. Selecting the “OK” button will then launch the search for a packet with the selected device address and endpoint, using the search direction, origin, and scope previously specified.
CATC CATC Detective User’s Manual Version 2.21 4.9.3.6 Find Data String Selecting the Data String button brings up the following dialog box, to allow selection of a specific data pattern within the DATA fields of the traffic file: Up to 10 bytes of data (hexadecimal notation, MSB of each byte on the left) can be specified. Selecting the “OK” button will then launch the search for a packet with the selected data string, using the search direction, origin, and scope previously specified.
CATC CATC Detective User’s Manual Version 2.21 4.
CATC CATC Detective User’s Manual Version 2.21 Selecting the relevant menu item will then either clear the marker or relocate it to the current packet (that which spawned the pop-up menu). The remaining menu items (displayed only for files recorded with Idle state) are used to compute timing information for the associated packet. Selecting “Packet Length” will display the time taken by the packet, from start of Sync to the end of EOP signaling.
CATC CATC Detective User’s Manual Version 2.21 4.15 The I/O Operation Pop-Up Menu Clicking on the title of any IN or OUT field will bring up the following menu: The “Export Bulk/Control Data” and “Export Isochronous Data” menu items are intended for the output of data to a file.
CATC CATC Detective User’s Manual Version 2.
CATC CATC Detective User’s Manual Version 2.21 5. HOW TO CONTACT CATC Type of Service Contact Call for technical support... US and Canada: +1/ 800 909 2282 Worldwide: +1/ 408 727 6600 Fax your questions... Worldwide: +1/ 408 727 6622 Write a letter... Computer Access Technology Corp. Customer Support 2403 Walsh Avenue Santa Clara, CA 95051-1302 Send e-mail... support@catc.com Visit CATC’s Website... http://www.catc.com/ 6.