0

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

artless noise
  • 21,212
  • 6
  • 68
  • 105
Stefan Riesen
  • 101
  • 10
  • You can trace the PC connection; I assume it is a Windows PC and not a Linux PC. I guess that is CDC/ACM? There are several serial USB standards and could it be that it is not a CDC/ACM? You need the module compiled and the gadget set to CDC/ACM on the iMX6/Linux side, if you are correct. On the iMX6, there is a USB debug in the KConfig. – artless noise Jan 22 '15 at 18:18
  • It is NCM, and it has to be NCM as the automotive device (a car head unit) only supports NCM. When I'm connecting to my Linux PC, I also use NCM. As the automotive device - i.e. the USB Host - is a black box, there is no possibility to create traces on the host side. Tracing the PC connection doesn't help much (I already did that), as this connection is not failing, but I need a trace of the failed connection to find the error in the handshake/USB Init, which could be due to errors in either the iMXPlatform or in the automotive device. – Stefan Riesen Jan 22 '15 at 19:25
  • Ok, I see that driver (gadget/f_nsm.c). Can you compile the iMX kernel? There is a USB debug *menuconfig* option; I think your USB chip is CHIPIDEA_DEBUG for instance. Also need `USB_G_NCM` and it should be loaded. If you attach the iMX to a PC, you can see a `lsusb` to see that it is loading and identifying as a CDC/NSM. – artless noise Jan 22 '15 at 20:15
  • `USB_GADGET_DEBUG`, `USB_GADGET_VERBOSE`, `USB_GADGET_DEBUG_FILES` and `GADGET_DEBUG_FS` are some others. These maybe more useful than the *debugfs* entries of the `CHIPIDEA_DEBUG`. – artless noise Jan 22 '15 at 20:26

0 Answers0