obraun-sl / usb_power_cycle

Simple tool to perform a USB power cycle on Jetson Nano/NX devkit
6 stars 0 forks source link

Follow-up regarding libusb_control_transfer error code -9 LIBUSB_ERROR_PIPE on Nvidia Jetson Orin Nx #2

Open dtkutzke opened 5 months ago

dtkutzke commented 5 months ago

Hello,

I really need this code to power cycle the USB controller on the Nvidia Jetson Orin Nx, but the output of the lsusb is

Bus 002 Device 002: ID 2109:0822 VIA Labs, Inc. USB3.1 Hub             
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 2b03:f681  
Bus 001 Device 003: ID 0d8c:0012 C-Media Electronics, Inc. USB2.0 Hub             
Bus 001 Device 002: ID 2109:2822 VIA Labs, Inc. USB2.0 Hub             
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I really need to power cycle the VIA Labs, Inc. USB3.1 Hub, but I think that the device controller doesn't support the specific bmRequestType 0x40 or the requestValue 0x20. I'm not even sure how to figure out what exactly it supports. Do you have any suggestions on what I should do here?

dtkutzke commented 5 months ago

I'm confused how to reconfigure this line

ret = libusb_control_transfer(hub_devh, 0x40, 0x02, 0x01, ((0x0B<<8)|(0xDA)), 0, 0, 100000);
        //printf("Return value from initializing control %2.2d\n",ret);
        if (ret < 0) {
                printf("[error]:ep0 vendor command enable fail.\n");
                return ret;
        }

To accommodate the Jetson Orin.