Using "http://www.linux-usb.org/gadget/usb.c" program try to set up gadgetfs on Jetson TX2.
Update VID PID for Nvidia:
#define DRIVER_VENDOR_NUM 0x0955
#define DRIVER_PRODUCT_NUM 0x7020
Also update autoconfig function for Nvidia :
*/* Nvidia processors, high/full speed */
else if (stat (DEVNAME = "tegra-xudc", &statb) == 0) {
HIGHSPEED = 1;
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0001);
fs_source_desc.bEndpointAddress
= hs_source_desc.bEndpointAddress
= USB_DIR_IN | 1;
EP_IN_NAME = "ep1in-bulk";
fs_sink_desc.bEndpointAddress
= hs_sink_desc.bEndpointAddress
= USB_DIR_OUT | 2;
EP_OUT_NAME = "ep2out-bulk";
source_sink_intf.bNumEndpoints = 3;
fs_status_desc.bEndpointAddress
= hs_status_desc.bEndpointAddress
= USB_DIR_IN | 3;
EP_STATUS_NAME = "ep3in-int";
}*
After run program get output at Jetson TX2 terminal:
/dev/gadget/musb_hdrc ep0 configured
serial="1.3"
** Thu Jan 1 05:19:27
CONNECT high speed
DISCONNECT
CONNECT high speed
SETUP 80.06 v0300 i0000 255
Output log At Linux host PC is:
usb 3-2: new high-speed USB device number 48 using xhci_hcd
usb 3-2: string descriptor 0 read error: -110
usb 3-2: New USB device found, idVendor=0955, idProduct=7020
usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-2: can't set config #2, error -110
After debugging usb.c step by step find that program is stuck into function "handle_control". Get event of USB_REQ_GET_DESCRIPTOR then USB_DT_STRING is called but after "status = write (fd, buf, tmp);" Jetson TX2 is stuck and reboot.
What is the reason of Jetson TX2 stuck & getting error -110 response on host PC?
After searching related to error -110, we got two different errno.h.
One indicate 110 as :
#define ESHUTDOWN 110 /* Can't send after socket shutdown */
Second file indicate 110 as :
#define ETIMEDOUT 110 /* Connection timed out */
In both case there is common outcome which is communication between host and device is break because of some reason. So what can be issue for this connection is break?