USB gadget driver with super speed data tranfer to the host pc

Hi all,

Jetpack 5.1.3 with Jeston Linux 35.5.0.

I’m working with the Nvidia Orin Nano developer kit to create a USB custom gadget driver to transfer the data from the device to the Ubuntu host computer. The USB IN/OUT endpoints are configured with bulk transfer type, and the data rate is set to USB super speed. When the driver is probed, the USB device is registered and listed on the Ubuntu host. The 10 bytes of test data are transferred from the USB gadget driver to the host. Using the Wireshark application, the USB data packets are monitored, and it didn’t receive on the host PC.

  1. Can you please confirm the Nvidia system supports both USB SuperSpeed (5 Gbps) and Plus (10 Gbps) for the USB gadget driver?

  2. From the USB custom gadget driver, it queues the data to the function tegra_xudc_ep_queue of “drivers/usb/gadget/udc/tegra-xudc.c.” The kernel crashed after the consecutive times it tried to send the data. Please check the driver source file and kernel crashing dmesg logs.

usb_custom_gadget.txt (14.0 KB)
dmesg_log_1_nvidia_orin_nano_usb_3.0_super_speed_gadget_driver_17DEC24.txt (12.4 KB)

Thanks

Hi,
We don’t have much experience in the use-case. Would need other users to share experience.

It looks like Jetson Nano runs in device mode in the use-case. Maximum speed is USB3.0 5Gbps for device mode.

Hi @DaneLLL,

For the question 2, the kernel crashes from the UDC controller driver tegra-xudc.c
. Can you please look at the dmesg logs and your help is much appreciated.

Thanks

Hi,
We would like to replicate it and check. Please share how to set it up on Orin Nano developer kit to reproduce the issue.

Hi @DaneLLL ,

The zip contains the readme, kernel driver source and ko file. Please follow the steps mentioned in the readme file to reproduce the issue on your side

USB_bulk_gadget_testing_19DEC24.zip (137.3 KB)

Thanks

Hi @DaneLLL,

Are you able to reproduce the issue on your setup.

Thanks

Hi,
We will need some time to set up to replicate the issue. Will update once there is further finding. We will set up latest Jetpack 6.1. It would be great if you can also try the version.

Hi,
On Jetpack 61 we will hit the error:

$ sudo insmod /usr/lib/modules/5.15.148-tegra/kernel/drivers/usb/gadget/usb_bulk_gadget.ko
insmod: ERROR: could not insert module /usr/lib/modules/5.15.148-tegra/kernel/drivers/usb/gadget/usb_bulk_gadget.ko: Unknown symbol in module
[dmesg]
[  563.063511] usb_bulk_gadget: Unknown symbol usb_get_function_instance (err -2)
[  563.063553] usb_bulk_gadget: Unknown symbol usb_add_config_only (err -2)
[  563.063574] usb_bulk_gadget: Unknown symbol usb_string_ids_tab (err -2)
[  563.063607] usb_bulk_gadget: Unknown symbol usb_get_function (err -2)
[  563.063630] usb_bulk_gadget: Unknown symbol usb_composite_unregister (err -2)
[  563.063649] usb_bulk_gadget: Unknown symbol usb_put_function (err -2)
[  563.063673] usb_bulk_gadget: Unknown symbol usb_add_function (err -2)
[  563.063688] usb_bulk_gadget: Unknown symbol usb_composite_probe (err -2)
[  563.063710] usb_bulk_gadget: Unknown symbol usb_composite_overwrite_options (err -2)
[  563.063732] usb_bulk_gadget: Unknown symbol usb_otg_descriptor_alloc (err -2)
[  563.063755] usb_bulk_gadget: Unknown symbol usb_put_function_instance (err -2)
[  563.063776] usb_bulk_gadget: Unknown symbol usb_otg_descriptor_init (err -2)
[  563.063808] usb_bulk_gadget: Unknown symbol usb_ep_autoconfig_ss (err -2)

Do you have idea how to fix it? We can successfully buid usb_bulk_gadget.c but hit the error while inserting the module.

Hi @DaneLLL ,

The unknown error symbol functions are called from the below listed driver files.

vim drivers/usb/gadget/Makefile

Can you please check the kernel defconfig file (arch/arm64/configs/defconfig) to include the built-in driver support for the USB gadget configuration.

image

Thanks

Hi,
We are still hitting error:

$ sudo insmod /usr/lib/modules/5.15.148-tegra/kernel/drivers/usb/gadget/usb_bulk_gadget.ko
insmod: ERROR: could not insert module /usr/lib/modules/5.15.148-tegra/kernel/drivers/usb/gadget/usb_bulk_gadget.ko: Unknown symbol in module
[dmesg]
[   96.933888] bulk_bind: Entered
[   96.933900] bulk_bind: Max Packet size: 1024
[   96.933902] bulk_bind: bulk in and out endpoints configured
[   96.937299] udc 3550000.usb: failed to start bulk_driver: -2

Is there a chance you can set up Jetpack 6.1 and check? To help replicate the issue on Jetpack 6.1.

Is this still an issue to support? Any result can be shared?

Hi @DaneLLL,

I’m able to reproduce the kernle module insertion error on the jetpack 6.1 and working on to resolve it.