Dev Kit Micro USB0 "Pulsing"

Hi,

We’ve been having an issue with the DevKit + TX2 where certain USB audio capture devices (plugged into the micro USB port via OTG cable) which aren’t powered externally “lose” their power at a regular interval.

We put a 1A draw on it and the VUSB is a stable 4.88V loaded, but the enable keeps cutting out / power cycling.

We analyzed USB0_EN_OC (Jetson A17) and that appears to be the culprit. It’s enabled for 6 or 7 seconds, and then it disables for 1-2 seconds. Then it re-enables for 6-7 seconds, so on and so-forth.

Does anybody know what’s going on? It seems like some SW behavior, but the reasoning doesn’t make much sense to us.

Thanks!

Hi,
Please check if removing oc-pin in device tree helps:

usb2-micro-AB {
    nvidia,lanes = "otg-0";
    nvidia,function = "xusb";
    nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
<s>    nvidia,oc-pin = <0>;</s>
};

Just FYI, a USB 2.0 current output is rated at 500 mA for self-powered (and the micro-USB is self-powered). Charging outlets might go to 1.5 A. If power is cutting out at 1000 mA and then restoring, then this is because it is working the way it should. I would have to wonder, if you defeat the current limit mechanism, perhaps the rail will end up with permanent damage.

It did not work. To be clear this is the “enable” pin (A17) that is disabling causing the port to power down, which shouldn’t have any load on it. What pin would the Jetson use to “sense” an overdraw and disable that A17 pin, if this over-current disable in the DTB was enabled? There doesn’t seem to be any feedback to the Jetson to sense this.

Also, the behavior persists with no load on the system, just checking the enable pin the behavior persists.

Is there anything in the SW that could be disabling this A17 pin?

Yeah, I had thoughts about this too, but it doesn’t seem to be load related for 2 reasons:

  1. Behavior of the enable pin disabling persists with no load on the USB port
  2. There doesn’t seem to be any feedback to the Jetson regarding overdraw, so not sure how the Jetson would know to cut the enable pin.

We’re using a TPD3S0x4 to limit current on our product limiting to 1.5A, but since this is happening with the dev kit too (an Nvidia supported device), trying to debug there first.

Seems like something is driving this pin low, as there’s an internal pull-up. It has to be something in SW, but we don’t see a way of it sensing OC to do-so.

There is more than one way to deal with overload protection, and I’m not positive what the Jetsons do for this. It might be active, or it might be a polymer fuse. If you take a Jetson which has had a day to cool down (polymer fuses melt and then cool and reform…this can take a day…if cooling reestablishes current, but is still warm, then remelting occurs more easily), does this pulsing still occur?

Also, I don’t know what the rail itself can handle. Keep in mind that the 500 mA limit should never be exceeded on a single unpowered USB port (or on all combined ports if a HUB is running unpowered on the port), but the rail which provides that 500 mA could possibly be powering more than that port. It would be expected for each USB PHY to have limits, but the rail providing those limits probably also has limits and most likely is the source of power to more than just that one port.

The micro-USB isn’t a charging port, so 1.5A is out of question on this USB2 port.

This happens on every Jetson and it’s too consistent for me to think it’s any sort of fuse. 6-7 sec on, 1-2 sec off. Freshly powered up or been on for an hour, same behavior. As soon as it boots up the power kicks on , lasts 6-7 seconds, and then the cycle starts. I too wonder if it’s active or not. I don’t see how it could be as I don’t see any feedback from our current limit chip.

I think don’t focus so much on the current as this is happening on an unloaded system. The enable pin just shuts off in a set pattern.

I’m just wondering if some over-current condition might have caused something which is sticking around. If there are no devices connected at all to usb, what do you see with “lsusb”? Also, given that the micro port is USB2, when you run “lsusb” you should see the USB2 root HUB:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

You can see detailed information on that specific HUB with:

sudo lsusb -d 1d6b:0002 -vvv

I don’t know if it is convenient, but you might try to run that and see what lsusb shows differently between the on times and off times. You only need a subset of that, so I’m going to suggest you install “gawk” (“sudo apt-get install gawk”), and then run this while also watching the rail voltage:

sudo -s
while :; do echo ""; lsusb -d 1d6b:0002 -vvv | gawk '/^Hub Descriptor/,/Remote Wakeup/'; sleep 1; done
exit

I don’t know if there is something in “/sys” which could be monitored (power rails usually have status there, but I don’t know for this specific rail), but if there is it could be added in that above command. If you see something change, then you could hit control-c and stop the loop. The console should have some history in it and you can scroll back and copy and paste if something changes or looks interesting.

Perhaps there is some other interaction going on, e.g., sleep (I’m just speculating). Another possibility is that when in host mode power is delivered, but in device mode power would normally be consumed (but the device mode is self-powered, so power delivered to the connector would be ignored at the Jetson end and power source would be the host if Jetson is a device). For the case of the Jetson itself being in some sort of power savings mode you might run this before checking rail voltages:

sudo nvpmodel -m 0
sudo jetson_clocks

(in releases prior to R32.1 you need to use the full path to the commands)

The sleep mode is a good point, but we’re using model 0 already, so it’s at least not related to those modes, but maybe something USB specific.

In 28.1 nvpmodel was in the path, but the jetson_clocks script wasn’t. That’s just a side note, though.

I do see the root hub, yes.

I ran that command looking for changes, I didn’t see any changes at all unloaded, but I can’t see voltage, only current, and current is obviously 0 unloaded.

I’ll try what you suggested loaded and look for any changes. Though unfortunately it won’t be for a few weeks, I timed this question badly & am stepping out for a few weeks, won’t have access to testing equipment. I will try it when I return.

It definitely seems something SW related, that’s for sure, as it’s happening both in our custom HW which uses the Jetson, as well as the Nvidia Dev Kit / Carrier, but we just don’t see how it could be an overdraw as there’s no feedback to the Jetson, enable pin A17 doesn’t have a load, so it shouldn’t be that.

Hi,
Do you see over-current prints in kernel such as:
[url]https://devtalk.nvidia.com/default/topic/1042460/jetson-tx2/usb-power-control/post/5287681/#5287681[/url]

I’ll have to wait until I get back to a device that can put a load on it, but given that the behavior seems to exists when there’s no load on it, I would say it’s not printing that to the kernel logs.

Regarding over-current protection, which pin does Jetson sense over-current?

Hi,

Please check oem design guide. A17 and A18 are oc pins.

I’m seeing similar behavior. Is the correct pinmux setting supposed to be as follows per the default pinmux download?

Column A        B9               AQ			AR	AS              AT
USB0_EN_OC#	A17		GPIO3_PL.04		Output	Drive 0		No
USB1_EN_OC#	A18		GPIO3_PL.05		Output	Drive 0		No

OR

Column A        B9               AQ			AR	        AS              AT
USB0_EN_OC#	A17		USB_VBUS_EN0		Open Drain	Drive 0		No
USB1_EN_OC#	A18		USB_VBUS_EN1		Open Drain	Drive 0		No

@greg2 Is yours set up in either of these two configurations?

Which way is the correct way for the devkit?

In the device tree it calls out for the vdd_usb0_5v and vdd_usb1_5v regulators.

gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(L, 4> 0>;
gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(L, 5> 0>;

Please check if you see same dmesg as
[url]https://devtalk.nvidia.com/default/topic/1042460/jetson-tx2/usb-power-control/post/5287681/#5287681[/url]

if you mean these messages or similar to these below. no don’t see them in the logs with dmesg.

[ 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

USB “autosuspend” might also get in the way if the unit has been sitting there for a bit.

Hi,
Although you do not see the prints, please still check if removing the code in below post helps.
[url]https://devtalk.nvidia.com/default/topic/1042460/jetson-tx2/usb-power-control/post/5295901/#5295901[/url]

Are you on r28.2.1?

Hmm, I thought there was no load on A17, only enable. Let me re-check & check A18 too.

Let me check.

Same, I don’t see those over-current messages.
I have a snippet of the dmesg log posted, I don’t see any of those messages about over-current. We’re seeing this disable behavior on A17 without a load, so I’m still having a hard time understanding how it could be a load issue. In the dmesg log there seems to be something happening with USB. The cable state 2 I think is expected (?), as the device is connected via OTG cable. But I’m not sure what the 5 command means.

17.184194] gk20a 17000000.gp10b: railgate is disabled.
[   17.421689] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   26.533641] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   27.445636] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   36.557626] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   37.469618] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   46.545753] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   47.455982] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   56.558310] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   57.469823] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   66.579282] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   67.491161] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   76.603977] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   77.516084] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   86.628906] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   87.540970] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   96.653494] extcon-gpio-states external-connection:extcon@1: Cable state 2
[   97.565530] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  105.184178] CFG80211-ERROR) wl_cfg80211_change_station : WLC_SCB_AUTHORIZE sta_flags_mask not set 
[  105.423036] "!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc.
[  106.677968] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  107.589981] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  108.774350] "!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc.
[  116.702202] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  117.614215] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  119.949844] "!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc.
[  121.023027] "!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc.
[  121.073931] "!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc.
[  121.224478] "!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc.
[  123.777398] "!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc."!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc.
[  124.187152] "!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc.
[  124.859620] "!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))": file "dhd_wlfc.
[  126.706452] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  127.638467] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  129.618843] xhci-tegra 3530000.xhci: exiting ELPG
[  129.646635] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  129.661949] xhci-tegra 3530000.xhci: exiting ELPG done
[  131.307900] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  131.316235] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  131.778384] xhci-tegra 3530000.xhci: entering ELPG
[  131.788348] xhci-tegra 3530000.xhci: entering ELPG done
[  136.730126] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  137.661995] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  139.618807] xhci-tegra 3530000.xhci: exiting ELPG
[  139.645860] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  139.660815] xhci-tegra 3530000.xhci: exiting ELPG done
[  141.306526] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  141.315602] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  141.777303] xhci-tegra 3530000.xhci: entering ELPG
[  141.789166] xhci-tegra 3530000.xhci: entering ELPG done
[  146.752945] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  147.684835] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  149.618624] xhci-tegra 3530000.xhci: exiting ELPG
[  149.648777] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  149.664086] xhci-tegra 3530000.xhci: exiting ELPG done
[  151.309809] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  151.317670] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  151.776264] xhci-tegra 3530000.xhci: entering ELPG
[  151.784822] xhci-tegra 3530000.xhci: entering ELPG done
[  156.776038] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  157.708094] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  159.618444] xhci-tegra 3530000.xhci: exiting ELPG
[  159.647957] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  159.662549] xhci-tegra 3530000.xhci: exiting ELPG done
[  161.308269] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  161.316130] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  161.775541] xhci-tegra 3530000.xhci: entering ELPG
[  161.785592] xhci-tegra 3530000.xhci: entering ELPG done
[  166.795401] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  167.731343] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  169.618240] xhci-tegra 3530000.xhci: exiting ELPG
[  169.647394] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  169.662113] xhci-tegra 3530000.xhci: exiting ELPG done
[  171.307827] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  171.315702] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  171.775058] xhci-tegra 3530000.xhci: entering ELPG
[  171.786111] xhci-tegra 3530000.xhci: entering ELPG done
[  176.822948] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  177.754902] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  179.618094] xhci-tegra 3530000.xhci: exiting ELPG
[  179.646949] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  179.661853] xhci-tegra 3530000.xhci: exiting ELPG done
[  181.307582] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  181.317422] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  181.774608] xhci-tegra 3530000.xhci: entering ELPG
[  181.790256] xhci-tegra 3530000.xhci: entering ELPG done
[  186.846589] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  187.778564] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  189.617887] xhci-tegra 3530000.xhci: exiting ELPG
[  189.646641] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  189.660142] xhci-tegra 3530000.xhci: exiting ELPG done
[  191.305968] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  191.315699] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  191.774288] xhci-tegra 3530000.xhci: entering ELPG
[  191.784086] xhci-tegra 3530000.xhci: entering ELPG done
[  196.866352] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  197.802356] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  199.617757] xhci-tegra 3530000.xhci: exiting ELPG
[  199.646421] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  199.661013] xhci-tegra 3530000.xhci: exiting ELPG done
[  201.306740] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  201.315672] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  201.774119] xhci-tegra 3530000.xhci: entering ELPG
[  201.789442] xhci-tegra 3530000.xhci: entering ELPG done
[  206.894172] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  207.826161] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  209.617552] xhci-tegra 3530000.xhci: exiting ELPG
[  209.646257] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  209.660844] xhci-tegra 3530000.xhci: exiting ELPG done
[  211.306558] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  211.314477] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  211.773947] xhci-tegra 3530000.xhci: entering ELPG
[  211.783192] xhci-tegra 3530000.xhci: entering ELPG done
[  216.918070] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  217.850054] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  219.617485] xhci-tegra 3530000.xhci: exiting ELPG
[  219.646134] xhci-tegra 3530000.xhci: Firmware timestamp: 2017-03-31 06:21:56 UTC, Version: 55.07 release
[  219.660796] xhci-tegra 3530000.xhci: exiting ELPG done
[  221.306513] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 5
[  221.315374] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work ignore firmware MBOX_CMD_DEC_SSPI_CLOCK request
[  221.773840] xhci-tegra 3530000.xhci: entering ELPG
[  221.783628] xhci-tegra 3530000.xhci: entering ELPG done
[  226.938074] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  227.873966] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  236.985895] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  237.897889] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  247.009822] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  247.921829] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  257.033785] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  257.945774] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  267.058182] extcon-gpio-states external-connection:extcon@1: Cable state 2
[  267.970092] extcon-gpio-states external-connection:extcon@1: Cable state 2

Behavior starts immediately at boot-up.

It’ll be a fair bit delayed before I can make the changes & test, maybe it helps fix smccuen’s problem.