Home:ALL Converter>Tracing traffic in Linux-based usb gadget (CDC/NCM)

Tracing traffic in Linux-based usb gadget (CDC/NCM)

Ask Time:2015-01-21T16:37:47         Author:Stefan Riesen

Json Formatter

I have a linux platform* that is connected as a usb device to an automotive device which acts as the USB host. The two devices should communicate over CDC/NCM, but the linux platform is not recognised by the automotive device and therefore the connection is not established. Surprisingly a connection to my computer is established correctly.

I now need to create a trace of that USB connection in order to check if there is an error in the USB handshake that can't be handled by the automotive device. As I cannot access the USB host, I need to create the trace from the gadget side.

I tried using usbmon and tcpdump, but this seems to work only for USB controllers configured as hosts on the tracing platform, not for ones configured as devices.

  • How can I configure usbmon to work also on devices?
  • If that is not possible are there any other possibilities to achieve this? (preferrably without hacking any drivers...)
  • Or do I have to use a Hardware USB sniffer?

BTW, all required modules (esp. g_ncm) are correctly loaded.

Thank you for your help!

stefan

*custom distribution on a freescale iMX6 processor (ARM), Kernel Version 3.0.35

Author:Stefan Riesen,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/28062773/tracing-traffic-in-linux-based-usb-gadget-cdc-ncm
yy