I am trying to control the USB_VBUS_EN1 pin to switch the USB1 VBUS Power on and off.
The main problem we have is that a ZED-Mini camera will not work on boot up and requires to actually disconnect and re connect the USB cable (Issue https://github.com/stereolabs/zed-ros-wrapper/issues/249), the issue itself seems to be a long time to fix so in the mean time we are trying to find a good workaround.
I am able to control the pin on and off for the USB port like follow
sudo su
cd /sys/class/gpio
echo 349 > export
cd gpio349
echo out > direction && echo 0 > value # Will turn off the port
echo out > direction && echo 1 > value # Will turn on the port
But if I connect the camera I will get an error message on dmesg regarding over current condition as follow
[ 5126.689254] usb usb1-port2: over-current condition
[ 5126.696185] tegra186-padctl 3520000.pinctrl: tegra18x_phy_xusb_handle_overcurrent: clear port 1 pin 1 OC
[ 5126.729264] xhci-tegra 3530000.xhci: port 1 over-current detected
[ 5126.735379] tegra186-padctl 3520000.pinctrl: tegra18x_phy_xusb_handle_overcurrent: clear port 1 pin 1 OC
[ 5126.765267] xhci-tegra 3530000.xhci: port 1 over-current detected
[ 5126.771394] tegra186-padctl 3520000.pinctrl: tegra18x_phy_xusb_handle_overcurrent: clear port 1 pin 1 OC
[ 5126.801267] xhci-tegra 3530000.xhci: port 1 over-current detected
[ 5126.807383] tegra186-padctl 3520000.pinctrl: tegra18x_phy_xusb_handle_overcurrent: clear port 1 pin 1 OC
[ 5126.837263] xhci-tegra 3530000.xhci: port 1 over-current detected
[ 5126.843382] tegra186-padctl 3520000.pinctrl: tegra18x_phy_xusb_handle_overcurrent: clear port 1 pin 1 OC
and after that the whole USB will freeze, I understand the message is due to the DTB not having the regulator description but I really don’t know what to do o avoid it.
Thank you very much for your response, I am trying to follow the logic on the other topic but I still get the same over current error when I enable the regulator again.
The result of running “sudo cat /sys/kernel/debug/gpio” is the follow:
GPIOs 216-223, platform/max77620-gpio, max77620-gpio, can sleep:
gpio-216 ( |external-connection:) in hi
gpio-221 ( |spmic_gpio_input_5 ) in lo
gpio-222 ( |spmic_gpio_input_6 ) in hi
GPIOs 224-239, i2c/0-0077, tca9539, can sleep:
gpio-227 ( |en-vdd-sys ) out lo
gpio-228 ( |lcd-bias-en-rail ) out hi
gpio-233 ( |en-vdd-cam ) out lo
gpio-234 ( |en-vdd-cam-1v2 ) out lo
GPIOs 240-255, i2c/0-0074, tca9539, can sleep:
gpio-240 ( |vdd-usb2-5v ) out lo
gpio-241 ( |en-vdd-ts-1v8 ) out hi
gpio-242 ( |en-vdd-ts-hv-3v3 ) out hi
gpio-243 ( |en-vdd-disp-3v3 ) out lo
gpio-244 ( |vdd-fan ) out lo
gpio-247 ( |en-mdm-pwr-3v7 ) out lo
gpio-249 ( |en-vdd-disp-1v8 ) out lo
gpio-250 ( |dis-vdd-1v2 ) out hi
gpio-252 ( |vdd-hdmi ) out hi
gpio-253 ( |en-vdd-cam-hv-2v8 ) out lo
GPIOs 256-447, platform/2200000.gpio, tegra-gpio:
gpio-317 ( |reset_gpio ) out lo
gpio-348 ( |vdd-usb0-5v ) out lo
gpio-349 ( |vdd-usb1-5v ) out lo
gpio-356 ( |eqos_phy_reset ) out hi
gpio-357 ( |eqos_phy_intr ) in hi
gpio-360 ( |wlan_pwr ) out hi
gpio-362 ( |cam1-pwdn ) out lo
gpio-377 ( |hdmi2.0_hpd ) in lo
gpio-380 ( |wp ) in hi
gpio-381 ( |cd ) in hi
gpio-382 ( |en-vdd-sd ) out lo
gpio-392 ( |cam_pwdn_gpio ) out lo
gpio-393 ( |cam1-rst ) out lo
gpio-397 ( |cam_reset_gpio ) out lo
gpio-415 ( |external-connection:) in hi
gpio-420 ( |bt_ext_wake ) out hi
GPIOs 448-511, platform/c2f0000.gpio, tegra-gpio-aon:
gpio-464 ( |temp_alert ) in hi
gpio-504 ( |Power ) in hi
gpio-505 ( |Volume Up ) in hi
gpio-506 ( |Volume Down ) in hi
gpio-507 ( |wifi-wake-ap ) in lo
gpio-508 ( |bt_host_wake ) in lo
I tried the disable / enable cycle for the regulators 20 and 33, the regulator 20 is the one linked to “vdd-usb1-5” and gives me the over current error message. The regulator 33 is linked to “vdd-usb2-5v” and does nothing (that I can see at least).
Hi molinadavid,
Please confirm the steps of reproducing the issue. We will try to reproduce it with USB cameras we have.
Clean flash of r28.2.1
Boot to ubuntu desktop
Insert USB camera and it runs well without hitting overvurrent
Disable regulator.20
Enable regulator.20
Overcurrent happens
Mostly those are the steps I did, however I also downloaded the Kernel and enabled the SPI following the instructions on this page Jetson/TX2 SPI - eLinux.org
I will try now re flashing again just to be sure that I didn’t forget anything in the process.
Also the camera I am using is the Zed mini from Stereolabs.
I am facing the ‘over current’ issue too as reported here when trying to enable usb power control on TX2 by disabling regulator@5 block in device tree. For me though, after re-enabling regulator@5, the overcurrent issue goes away. I still am not able to control usb power from userspace. Found few threads discussions on USB power control but they are for TX1.
Please suggest the right way to do that on TX2.
Thanks for your help.
Hi DaneLLL,
Tried what you suggested in #12 and it worked ! Thanks so much.
Couple of questions -
a) Could this be treated as an actual fix or it is a workaround that might have other implications ? I didn’t see any other issue when testing this fix but want to be sure.
b)Is there a plan to fix this in the next release or so ?
Thanks again!
hi,i use the jetpack3.3,tx2 and j120 with zedmini, ,the usb3.0 not work when each restart .and can’t find the in kernel/t18x/drivers/pinctrl/pinctrl-tegra186-padctl.c.
ok,I got it ,but its more different form the jetpack 3.3,I download the jetpack3.3and unpacked,there is a foder named 64TX/2Linux_for_Tegra/kernel/, there is 2 different kernel,one is kernel_headers.tbz2,and anther is kernel_supplements.tbz2,I relly have no idea ahout how to change it and how to use for .can use tell me more detail?THX again .