How to enable usb3.0 slave mode on Tx2 4G module

I executed the command: service nv-l4t-usb-device-mode start
But it didn’t work
[ 1456.660328] usb usb2: usb_suspend_both: status -16
[ 1456.676013] usb usb2: usb_suspend_both: status -16
[ 1456.691999] usb usb2: usb_suspend_both: status -16

Are you using the “/opt/nvidia/l4t-usb-device-mode/” content? If so, this is for USB2 on the micro-OTG connector, and is not capable of USB3.

Also consider that switching back and forth between device mode and host mode is a function of the ID pin. If the port is already in host mode perhaps there is a conflict.

Autosuspend might be involved as well, and the error makes it look like something in USB is suspended or failing to deal with suspended mode. Is there anything attached to the micro-OTG port during the command?

As linuxdev mentions, the default board only supports USB2. You may design your own board to enable USB3 device mode.

Okay, I get it, thank you @linuxdev
There is another question. If I connect usb0 according to device mode and use the “/ opt / nvidia / l4t-usb-device-mode /” content, can I map all 16GB emmc and mounted SSD of Tx2 4G module to the host

I don’t know off the top of my head if usb0 is the micro-OTG port, but the scripts in “/opt/nvidia/l4t-usb-device-mode/” are meant as a demonstration of how to set up the Linux “gadget” framework (a framework which takes care of some of the low level USB details when using device mode, but which requires you to complete certain details). It is just a case of editing the correct script details.

Note that this script also sets up the virtual wired ethernet over the micro-OTG port. You wouldn’t need to edit that part.

In this particular demo a loopback mounted ext4 file ("/opt/nvidia/l4t-usb-device-mode/filesystem.img") is there just as a demo. You could edit this to instead be a non-loopback mounted actual filesystem (check the internet for details of doing this with the Linux gadget framework). I will caution you to be careful though, as permissions/security and sometimes update of the wrong content (which would cause system failure) might mean you should not make 100% of all files available.

Okay, usb0 is a micro-OTG port, I got the idea, thank you!