can tx2 work as usb slave mode?

Can tx2 work as usb slave mode? If so,I can directly copy file from tx2 using a usb cable connected to my computer.

Hi chay1991,

Please check
https://devtalk.nvidia.com/default/topic/1014096/jetson-tx2/how-to-set-tx2-otg-usb-as-device-mode-/post/5205500/#5205500

Thanks

Hi,I have checked the link you offered me.But I also have two questions:

  1. Apply the patches and rebuild/apply new dtb
  2. Run “configfs_msc_l4t.sh” script to enable device mode
    How can I apply these two steps?
    Thanks!

The steps depend in part on what release you use. What release? See:

head -n 1 /etc/nv_tegra_release

Hi,linuxdev
My Release is R28.1.

Be sure to have a backup or clone before you start if your Jetson has anything on it you don’t want to lose (some of these steps could replace the rootfs depending on what goes wrong). For cloning see this:
http://elinux.org/Jetson/TX2_Cloning

Note that this would create both “backup.img” and “backup.img.raw”. Either of those files, when placed in the “Linux_for_Tegra/bootloader/system.img” location, and when using the “-r” option to flash.sh, will replace the rootfs…but it’ll replace it with itself. There are some “-r” option combinations which will not touch the rootfs, but if you have a clone in place, then even if it does replace it then essentially nothing happened other than the part you wanted to happen.

The “backup.img” file is smaller and faster to flash, but can be used for no other purpose. The larger “backup.img.raw” file is quite useful, e.g., it can be loopback mounted and examined or updated via rsync. I throw away my “backup.img” and keep a protected copy of “backup.img.raw” somewhere safe…as needed I place a copy in the right place. This file will be about 28GB in size, so you need some spare disk space.

Hint: Do any kind of system update you want to do prior to clone, and from then on your clone will also be updated to that point in time.


Device tree layout (and install instructions) changed in R28.1, but the kernel itself remained simple to update (you can ask about kernel installs if you want, but it is just adding a new “Image” with a new name to “/boot/” of the Jetson, and then editing the entry in “/boot/extlinux/extlinux.conf”…or modules in “/lib/modules/$(uname -r)/”). For device tree, expect to set up your device tree in the right location, and then, with the Jetson in recovery mode:

sudo ./flash -k -r kernel-dtb jetson-tx2 mmcblk0p1

The dtb file (the one to edit) for a TX2 would normally be this:

Linux_for_Tegra_64_tx2/kernel/dtb/<b>tegra186-quill-p3310-1000-c03-00-base.dtb</b>

If you edit this, then flash the kernel-dtb partition as shown above, this should do the trick. You might find it useful to know how to use the “dtc” tool to convert back and forth between dtb (binary) form and dts (source form…human readable plain text):
https://devtalk.nvidia.com/default/topic/1037131/jetson-tx1/does-anybody-know-how-to-enable-and-program-an-spi-protocol-on-the-tx1-/post/5269528/#5269528

Hi,
After reading that,I feel more confused.
The link you offered me:
https://devtalk.nvidia.com/default/topic/1014096/jetson-tx2/how-to-set-tx2-otg-usb-as-device-mode-/post/5205500/#5205500
has only five steps.
What should I do by your latest instructions.Must I backup my image?

You don’t have to back up an image unless the rootfs is flashed and you don’t want a pristine start image. Some flash commands, although intended to flash only a device tree or something else, can sometimes end up flashing the rootfs anyway. It is up to you to back up or not via clone (I gave those instructions because I didn’t want you to risk losing something without first knowing there is a way to avoid the risk).

Really, only the information on how to flash device tree is mandatory if you are doing something needing a device tree change. It used to be that device tree changes were just a file edit, but when the TX1 and TX2 merged to use the same rootfs this changed and the device tree is actually part of a partition (thus simple file copies are no longer possible as an update mechanism). The part where you mentioned needing to rebuild/apply a new dtb are covered by my instructions.

I do not have knowledge of the “configfs_msc_l4t.sh” script, so I can’t comment on that.