Jetson xavier NX doesn't get detected in device mode after bootup unless unplug and plug it back

Are you sure this one has usb host connected and your “/sys/kernel/config/usb_gadget/l4t/UDC” exist? And UDC value is “xudc.3550000”?

Yes, UDC exist and UDC value is xudc.3550000.
This been configured in DTSI

tegra_xudc: xudc@3550000 {
extcon-cables = <&vbus_id_extcon 0>;
extcon-cable-names = “vbus”;
#extcon-cells = <1>;
phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-2}>;
phy-names = “usb2-2”;
phy-names = “usb2”;
nvidia,xusb-padctl = <&xusb_padctl>;
nvidia,boost_cpu_freq = <1200>;
status = “okay”;


Please share the dmesg with below steps.

dmesg -n 8
dmesg -c
cat UDC
dmesg -c
echo “” > UDC
dmesg -c
echo “3550000.xudc” > UDC
dmesg -c

I need to know if yoru dmesg got print anything new after you toggle the UDC.

I am able to capture log upto.
dmesg -n 8
dmesg -c
cat UDC
Please find the attached log.
dmesg_log_18072023.txt (74.4 KB)

I am not able to execute echo “” > UDC at my end getting to following error even with root access.

nx@dhcp-10-164-9-21:/sys/kernel/config/usb_gadget/l4t$ sudo echo “” > UDC
-bash: UDC: Permission denied
nx@dhcp-10-164-9-21:/sys/kernel/config/usb_gadget/l4t$ su
root@dhcp-10-164-9-21:/sys/kernel/config/usb_gadget/l4t# sudo echo “” > UDC
echo: write error: Device or resource busy


It looks like ep0 is enabled this time. Did you change anything on your side?

[ 14.069730] tegra-xudc 3550000.xudc: EP 0 (type: ctrl, dir: out) enabled

Nothing changed at my end just booted device with cable connected. At host end(ubuntu running on laptop) when I do lsusb Jetson xavier nx is not detected.

so sometimes this EP 0 (type: ctrl, dir: out) enabled can got printed but sometimes it cannot?

I didn’t get your message. Could you elaborate it?

This log was not present in the log you shared yesterday. My point here is to clarify what is the difference between today and yesterday dmesg.

You told there is no difference. So I asked if this message just came out from time to time.

please use the uart log to capture all the logs together in case previous case happened.

I mean it sounds like you only check one item at a time and dump dmesg separately.

For example, when you see “ep0 enabled” log shown in uart log, please also check the data role is correctly be “device” or not. Capture them in the same log so that we can make sure they are dumped at same time.

The “dmesg_log.txt” I captured might not be proper. I tried to recall, I was doing some experiment and in-between I captured log. Probably that xavier nx was not in device mode.
Yesterday log “dmesg_log_18072023.txt”, I made sure things are proper.

sure, I’ll captured UART log.


Sure, I’ll capture the UART log and share it.

1 Like

Please find the latest log captured via uart.
dmesg_log_19072023.txt (72.2 KB)
After boot-up with usb cable connected, I can see data role in device mode.

nx@dhcp-10-164-9-21:~$ cat /sys/class/usb_role/usb2-2-role-switch/role

Sorry for some earlier confusion from my side.


I feel you are still not in the situation. Your EP0 is not enable again. What is the difference now and then? How about echo to UDC node in this situation? Would it enable the ep0 in dmesg?

And I expect you just put all the things in the same log file.

For example, I don’t need you to share a log without data role dump. I just need them in the same file…

If you still have problem, ask it before doing anything…

If I execute dmesg manually in putty, I can see EP0 enabled, but not in UART log. Is I am missing anything?

nx@dhcp-10-164-9-21:~$ sudo dmesg | grep EP
[sudo] password for nx:
[ 14.092545] tegra-xudc 3550000.xudc: EP 0 (type: ctrl, dir: out) enabled

How to dump everything to same/one file? Currently I am getting log from uart debug port(captured using minicom) and commands are executed from the putty (like cat etc.) connected via ethernet ip address.


You can just use minicom to enter the commands… no need to putty from ethernet IP…
You can also google search about how to use minicom to save log.

If I execute dmesg manually in putty, I can see EP0 enabled, but not in UART log. Is I am missing anything?

Could you compare your UART log and dmesg at that timestamp and see if that is true… or just dmesg again in your uart console…

This does not really matter. We just need to confirm the data role and dmesg are matched.

If we are sure data role is “device” and “ep0 is enabled” at same time, then we need to check your host PC side log then.

It is not allowing to enter commands. In our custom board UART2_TXD(pin 236) and UART2_RXD(pin238) is available to capture UART log.

Yes sure. data role is “device” and “ep0 is enabled” at same time.
After boot-up, I am just doing dmesg after login through putty which shows “ep0 is enabled” and cat the data role which says “device” role.

please also dump the register in this situation.