I’m trying to setup my AGX Orin to be a USB Gadget connected to an iPad, however when I plug in the iPad, it always ends up being the host and not the device. If I put a USB hub in the middle, it works as it forces the iPad into the device mode, but I’d prefer to just have the USB-C connector between the two.
It seems to me the interface in Linux for this is the /sys/class/typec/<port>/data_role
, but whenever I do echo device > data_role
(as root) I get permission denied errors. It seems <port>
is port1, as when I have it connected in a configuration that forces it to be device role then data_role
reads [device]
Is this usecase supported? How do I request the USB bus to swap roles from Linux?
I’m on Jetpack 5.1.1
Hi,
Please confirm which Jetson device you are using. It mentions AGX Orin in title but AGX Xavier in the comment. Not sure which one you use. And the latest Jetpack release is 5.1.1. Please use the latest release.
Description updated. Sorry for the omissions
Hi,
J40 is an OTG port by default. If the status of VBUS and ID pins are correct, Orin will switch to device mode automatically. This may be an issue in signal quality. Do you have other type-C to type-A cables for a try? May try other cables and see if the issue occurs.
I did a little more digging here. After setting the w
bit on data_role, I get
$ echo device | sudo tee data_role
device
tee: data_role: Operation not supported
meaning we hit
// drivers/usb/typec/class.c:1023
if (port->cap->data != TYPEC_PORT_DRD) {
ret = -EOPNOTSUPP;
goto unlock_and_ret;
}
this cap
seems to come from
// drivers/usb/typec/ucsi/ucsi.c:1040
command = UCSI_GET_CONNECTOR_CAPABILITY;
command |= UCSI_CONNECTOR_NUMBER(con->num);
ret = ucsi_send_command(ucsi, command, &con->cap, sizeof(con->cap));
so it does appear to be actually querying the device for the capabilities but it’s coming up without DRD?
Hi,
This use-case is not supported in current release. We will check if we can support it in the future.
1 Like