Hello! I’m designing a carrier board for TX2NX and I was wondering about USB ports.
I want to have a single USB port that can be used as a recovery port but when it boots up, it becomes normal USB port. I couldn’t exactly find any references to it. Is it possible to configure USB port like that?
You’re looking for the “on-the-go” (“OTG”) specification (the specification is from USB.org). Basically you need to have a connector with a “detect” pin to know if the mating connector is “type-A” (for host mode when someone plugs in a device) or if it is “type-B” (for device mode, when someone treats the Jetson as a device, e.g., a network device or mass storage).
The dev kits implement this with a micro-OTG port, and then adds software to switch port modes depending on the detect pin. Dev kit carrier boards have published schematics, and then there is some device tree content to tell the drivers which lanes go where about the detect pin.
What @WayneWWW refers to is a script for stopping or starting that service. The networking is purely software and is unrelated to the hardware design. Simply don’t run the service and the port does all you ask without complicating things. Both the bulk storage and the networking functions are basically example programs for what is known as the “gadget” framework for USB.
Example stopping if it is present: sudo systemctl disable nv-l4t-usb-device-mode.service
(or there are stop and start scripts available for manual use within /opt/nvidia/l4t-usb-device-mode, but this is not permanent)
The part which hooks in to this (and causes this to run each reboot) is at “/etc/systemd/system/nv-l4t-usb-device-mode.service”. This is a symbolic link which points to the previously mentioned “/opt” content. Removing the symbolic link in “/etc” will prevent the service from automatically running. Better yet you might want to remove the package providing the service file, but there is no harm in leaving the content there so long as it does not auto run.
Thanks for comprehensive answer! Now I understand that the Ethernet is purely software - I didn’t know that it was even possible via USB. Right now last thing I have to do is to delete all the Ethernet stuff but keep the storage thing and change storage to use a specific folder I need
Trivia: USB is just a data pipe, but the hardware used with such a “pipe” is “plug-n-play”…meaning USB can ask the hardware what it is, and then broadcast this to a set of drivers. If a driver sees hardware it can handle, then it takes ownership. The actual hardware is never part of USB, it is just hardware and some driver. The twist on the story is that because some classes of hardware are so common that USB happens to supply “generic” drivers for several classes of device, and if the manufacturer adheres to that “standard” specification, then USB itself will provide a driver…but that driver is not part of USB, it is just a companion which always ships with USB. Examples are human interface devices, the HID class, e.g., mice and keyboards. The device describing itself can be standalone hardware, or it can be the computer pretending to be hardware.