Jetson Nano as USB Mouse

Is there an example of the changes needed to make Jetson Nano emulate a USB mouse in addition to USB Mass Storage and Network device?

Hi,

Your question should be posted in the Jetson Nano category. I will move it over for you so support staff will have visibility.

Best,
Tom K

In general, this is part of the Linux kernel’s “gadget” API. What it comes down to is that there are some “standard” drivers for certain devices (e.g., mouse is HID, and mass storage is another example), and if the manufacturer of the device follows that interface, then a custom USB driver is not required. The gadget API is a skeleton whereby the programmer can fill in some details of the skeleton, and then the software can pretend to be that device when the “standard” driver is used with it. This is not specific to a Jetson, and is documented with the Linux kernel source. See:

The virtual network provided over USB and the “README” mass storage functions are good examples and everything there is at:
/opt/nvidia/l4t-usb-device-mode/
(this can start or stop those virtual devices, and has a systemd service wrapper)

Thanks. Where is the “README”? I assumed it is under the referenced folder but its not there. It seems that I need to rebuild the kernel first since CONFIG_USB_CONFIGFS_F_HID which is the module for USB HID support in Gadget API is not enabled in the default kernel config.

The file is indirectly in that folder. There is a file there which is a binary image, and by using loopback, the file can be treated as a hard disk partition. If you plug in the micro-B USB at the Jetson, monitor “dmesg --follow” on a host PC, then as you plug in the USB to the PC you will see log messages. One is for the virtual network, another will be mounting the virtual filesystem. Within that mount point is the README.

One alternative is to set up a non-loopback version which points at an actual hard drive partition. This is just a mass storage version of the Gadget API, the network 192.168.55.1 and 192.168.55.100 are virtual network examples. You need to understand a mouse (HID class) to do what you want.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.