How to disable USB gadget mass storage, rndis and ncm in jetson TX2

how to disable USB gadget mass storage, rndis and ncm in TX2 with SDK32.4.3

For reference, this is all from a sample of how to use the USB “gadget” API, and is located here on the Jetson:
/opt/nvidia/l4t-usb-device-mode

To examine the status as a service:
sudo systemctl status nv-l4t-usb-device-mode.service
(note that all of the USB device mode is consolidated into a single service)

To non-destructively disable this until rebooted:
sudo systemctl stop nv-l4t-usb-device-mode.service

To non-destructively disable this long term, even after reboots:

sudo systemctl stop nv-l4t-usb-device-mode.service
sudo systemctl disable nv-l4t-usb-device-mode.service

(this keeps the service off, but it can be later reenabled)

To reenable this:
sudo systemctl enable nv-l4t-usb-device-mode.service

Note that within the directory containing the content there is a configuration file which can be edited to change individual parts of the service (versus enabling or disabling everything):
nv-l4t-usb-device-mode-config.sh

EDIT: Note that this is provided by a package which has a lot of other functions, “nvidia-l4t-init”. Bad things would happen if you removed the whole package. If this updates I could see a possibility that this might re-enable the service, not sure.

1 Like