NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

USB Debug Techniques

From Texas Instruments Wiki
Jump to: navigation, search

This page outlines the common techniques to debug USB. Each section includes a link to the details.

sysfs[edit]

The sysfs entry for enumerated USB devices is /sys/bus/usb/devices/.

root@am335x-evm:~# ls /sys/bus/usb/devices/
1-0:1.0  1-1      1-1:1.0  2-0:1.0  usb1     usb2

Each entry includes all the information about its USB device. The names that begins with usb refer to the USB controllers.

x-0:1.0 is a special case, which refers to the root hub's interface. The devices are named as

bus-port.port.port

The interfaces follow in the form of

:config.interface

Details:

http://www.linux-usb.org/FAQ.html#i6

debugfs[edit]

/sys/kernel/debug/usb/
|-- devices
`-- usbmon
  • devices: List of the devices enumerated on the bus with topology information.
Details:
<kernel source>/Documentation/us/proc_usb_info.txt
  • usbmon: to capture USB traces on the BUS.
Details:
<kernel source>/Documentation/us/usbmon.txt
/sys/kernel/debug/<controller>/
|-- regdump
|-- testmode
|-- mode*: host, device, or otg
`-- link_state*: speed
*: only available in DWC3, not in MUSB.

Dymanic Debug Interface[edit]

Runtime turning on/off the kernel debug statements of dev_dbg() or dev_vdbg(). This interface is not limited to USB, it can be used to debug any driver which is ported to dev_dbg() framework.

Details:

<kernel source>/Documentation/dynamic-debug-howto.txt

Ftrace[edit]

Ftrace is part of kernel tracing infrastructure which has zero overhead when disabled and minimal overhead when enabled. It is a very useful tool to debug USB issues.

Details:

<kernel source>/Documentation/trace/ftrace.txt

Tracepints[edit]

Another tool in kernel tracing infrastructure for kernel debugging and performance diagnosis.

Details:

<kernel source>/Documentation/trace/tracepoints.txt

USB protocol analyzer[edit]

A USB protocol analyzer is a USB bus sniffer which captures, decodes, filters and display USB bus activities.

Gadget Zero[edit]

Gadget Zero is a simple USB gadget driver that is useful for testing controller drivers. It implements two configurations, one for source/sink, the other for loopback. As of in 3.12 kernel, gadget Zero supports Control, Bulk and Isochronous transfers. The kernel community is working on implementing Interrupt transfer support.

Details:

http://www.linux-usb.org/usbtest/

Archived[edit]

Sitara Linux SDK 08.00.00.00

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article USB Debug Techniques here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article USB Debug Techniques here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article USB Debug Techniques here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article USB Debug Techniques here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article USB Debug Techniques here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article USB Debug Techniques here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article USB Debug Techniques here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article USB Debug Techniques here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article USB Debug Techniques here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity