Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Apr 2022 02:04:24 +0800
From:      Archimedes Gaviola <archimedes.gaviola@gmail.com>
To:        freebsd-arm@freebsd.org
Subject:   Raspberry Pi 3B Over-current USB
Message-ID:  <CAJFbk7FgSnWvN9Z7gp1wqW1CFa8bYqrr6zccMWEhotk5HMR=Tg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--000000000000d4f22b05dc3c8026
Content-Type: text/plain; charset="UTF-8"

 Hi,

I have a Prolific PL2303 USB-serial device when plugged-in to my Raspberry
Pi 3B (14.0-CURRENT) will cause an over-current situation (enabled USB hub
debugging hw.usb.uhub.debug=1) as observed in the dmesg below. All 4 ports
got no power hence my USB keyboard was disconnected and stopped functioning
and my PL2303 device wasn't able to get detected and load its uplcom(4)
driver. However, the network is still okay in which I am able to access the
system over SSH.

ukbd0: <A4Tech USB Keyboard, class 0/0, rev 2.00/1.05, addr 4> on usbus1
kbd1 at ukbd0
lo0: link state changed to UP
smsc0: chip 0xec00, rev. 0002
ue0: link state changed to DOWN
ue0: link state changed to UP
uhid0 on uhub1
uhid0: <A4Tech USB Keyboard, class 0/0, rev 2.00/1.05, addr 4> on usbus1
usb_needs_explore:
usb_bus_powerd: bus=0xffff000089390000
usb_needs_explore:
usb_bus_powerd: bus=0xffff000089390000
usb_needs_explore:
usb_bus_powerd: bus=0xffff000089390000
usb_needs_explore:
usb_bus_powerd: bus=0xffff000089390000
usb_needs_explore:
usb_bus_powerd: bus=0xffff000089390000
uhub_explore: Overcurrent on port 2.
uhub_reattach_port: reattaching port 4
ugen1.4: <A4Tech USB Keyboard> at usbus1 (disconnected)
ukbd0: at uhub1, port 4, addr 4 (disconnected)
uhub_child_location: device not on hub
uhub_child_pnpinfo: device not on hub
ukbd0: detached
uhid0: at uhub1, port 4, addr 4 (disconnected)
uhub_child_location: device not on hub
uhub_child_pnpinfo: device not on hub
uhid0: detached
usb_needs_explore:
usb_bus_powerd: bus=0xffff000089390000
usb_needs_explore:
usb_bus_powerd: bus=0xffff000089390000
usb_needs_explore:
usb_bus_powerd: bus=0xffff000089390000

Here's also the USB device info of my PL2303 device.

root@generic:~ # usbconfig -u 0 -a 5 dump_all_desc
  ugen0.5: <Prolific Technology Inc. USB-Serial Controller> at usbus0,
cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x067b
  idProduct = 0x2303
  bcdDevice = 0x0300
  iManufacturer = 0x0001  <Prolific Technology Inc.>
  iProduct = 0x0002  <USB-Serial Controller>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0027
    bNumInterfaces = 0x0001
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00a0
    bMaxPower = 0x0032

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0003
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x000a
        bInterval = 0x0001
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0002  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0040
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 2
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0083  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0040
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

I'm using a USB port measuring device that can check the voltage and
current usages and by default (without any USB devices attached) each port
reads as 5.15 volts and 0.00 amperes for current of 3B. I'm using the
official Raspberry Pi Stontronics power adapter with 5.1V with 2.5A DC
output https://docs.rs-online.com/0c30/0900766b814dc7bb.pdf. From here due
to over-current, I cannot obtain the actual power consumptions specific to
my PL2303 device so I try installing the latest Raspberry Pi OS to check if
it behaves the same. I found out that it has a similar behavior and
experience getting over-current with additional under-voltage detected
messages. However, it's interesting to observe that even in an over-current
and under-voltage experience, all the ports are re-powered up and
functioning and then able to load the PL2303 driver and I am able to use it
via /dev/ttyUSB0 device. This time I could see the measuring device giving
a 4.93 volts with 0.46 amperes of current (460mA) in the PL2303 device (see
captured measurement here https://filebin.net/kqq664yf9w70omnh). Below is
the dmesg log I've got from RPi OS.

[ 7490.507686] usb 1-1-port2: over-current change #3
[ 7490.722717] usb 1-1.2: USB disconnect, device number 5
[ 7491.006607] hwmon hwmon1: Undervoltage detected!
[ 7491.094482] usb 1-1.5: new full-speed USB device number 7 using dwc_otg
[ 7491.198613] usb 1-1.5: New USB device found, idVendor=067b,
idProduct=2303, bcdDevice= 3.00
[ 7491.198676] usb 1-1.5: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 7491.198700] usb 1-1.5: Product: USB-Serial Controller
[ 7491.198722] usb 1-1.5: Manufacturer: Prolific Technology Inc.
[ 7491.200210] pl2303 1-1.5:1.0: pl2303 converter detected
[ 7491.206808] usb 1-1.5: pl2303 converter now attached to ttyUSB0
[ 7491.209222] usb 1-1-port2: over-current change #4
[ 7491.646484] usb 1-1.2: new low-speed USB device number 8 using dwc_otg
[ 7491.770462] usb 1-1.2: New USB device found, idVendor=09da,
idProduct=2267, bcdDevice= 1.05
[ 7491.770515] usb 1-1.2: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 7491.770539] usb 1-1.2: Product: USB Keyboard
[ 7491.770560] usb 1-1.2: Manufacturer: A4Tech
[ 7491.793771] input: A4Tech USB Keyboard as
/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:09DA:2267.0004/input/input6
[ 7491.852612] hid-generic 0003:09DA:2267.0004: input,hidraw0: USB HID
v1.11 Keyboard [A4Tech USB Keyboard] on usb-3f980000.usb-1.2/input0
[ 7491.875068] input: A4Tech USB Keyboard as
/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.1/0003:09DA:2267.0005/input/input7
[ 7491.935697] hid-generic 0003:09DA:2267.0005: input,hidraw1: USB HID
v1.11 Device [A4Tech USB Keyboard] on usb-3f980000.usb-1.2/input1
[ 7495.038507] hwmon hwmon1: Voltage normalised

Though this experience is specific to the Raspberry 3B case, is there a way
to enable this in FreeBSD? Knowing that there is dropping of voltage to
4.93 volts and current is 460mA which is still below the maximum of 500mA?

Thanks,
Archimedes

--000000000000d4f22b05dc3c8026
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">
<div>Hi,</div><div><br></div><div>I have a Prolific PL2303 USB-serial=20
device when plugged-in to my Raspberry Pi 3B (14.0-CURRENT) will cause=20
an over-current situation (enabled USB hub debugging=20
hw.usb.uhub.debug=3D1) as observed in the dmesg below. All 4 ports got no=
=20
power hence my USB keyboard was disconnected and stopped functioning and
 my PL2303 device wasn&#39;t able to get detected and load its uplcom(4) dr=
iver.=20
However, the network is still okay in which I am able to access the=20
system over SSH.<br></div><div><br></div><div>
ukbd0: &lt;A4Tech USB Keyboard, class 0/0, rev 2.00/1.05, addr 4&gt; on usb=
us1<br>kbd1 at ukbd0<br>lo0: link state changed to UP<br>smsc0: chip 0xec00=
, rev. 0002<br>ue0: link state changed to DOWN<br>ue0: link state changed t=
o UP<br>uhid0 on uhub1<br>uhid0: &lt;A4Tech USB Keyboard, class 0/0, rev 2.=
00/1.05, addr 4&gt; on usbus1<br>usb_needs_explore:<br>usb_bus_powerd: bus=
=3D0xffff000089390000<br>usb_needs_explore:<br>usb_bus_powerd: bus=3D0xffff=
000089390000<br>usb_needs_explore:<br>usb_bus_powerd: bus=3D0xffff000089390=
000<br>usb_needs_explore:<br>usb_bus_powerd: bus=3D0xffff000089390000<br>us=
b_needs_explore:<br>usb_bus_powerd: bus=3D0xffff000089390000<br>uhub_explor=
e: Overcurrent on port 2.<br>uhub_reattach_port: reattaching port 4<br>ugen=
1.4: &lt;A4Tech USB Keyboard&gt; at usbus1 (disconnected)<br>ukbd0: at uhub=
1, port 4, addr 4 (disconnected)<br>uhub_child_location: device not on hub<=
br>uhub_child_pnpinfo: device not on hub<br>ukbd0: detached<br>uhid0: at uh=
ub1, port 4, addr 4 (disconnected)<br>uhub_child_location: device not on hu=
b<br>uhub_child_pnpinfo: device not on hub<br>uhid0: detached<br>usb_needs_=
explore:<br>usb_bus_powerd: bus=3D0xffff000089390000<br>usb_needs_explore:<=
br>usb_bus_powerd: bus=3D0xffff000089390000<br>usb_needs_explore:<br>usb_bu=
s_powerd: bus=3D0xffff000089390000</div><div><br></div><div>Here&#39;s also=
 the USB device info of my PL2303 device.</div><div><br></div><div>
<div>root@generic:~ # usbconfig -u 0 -a 5 dump_all_desc</div><div>=C2=A0 ug=
en0.5: &lt;Prolific Technology Inc. USB-Serial Controller&gt; at usbus0, cf=
g=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (100mA)</div><div>=C2=A0 bLeng=
th =3D 0x0012</div><div>=C2=A0 bDescriptorType =3D 0x0001</div><div>=C2=A0 =
bcdUSB =3D 0x0200</div><div>=C2=A0 bDeviceClass =3D 0x0000=C2=A0 &lt;Probed=
 by interface class&gt;</div><div>=C2=A0 bDeviceSubClass =3D 0x0000</div><d=
iv>=C2=A0 bDeviceProtocol =3D 0x0000</div><div>=C2=A0 bMaxPacketSize0 =3D 0=
x0040</div><div>=C2=A0 idVendor =3D 0x067b</div><div>=C2=A0 idProduct =3D 0=
x2303</div><div>=C2=A0 bcdDevice =3D 0x0300</div><div>=C2=A0 iManufacturer =
=3D 0x0001=C2=A0 &lt;Prolific Technology Inc.&gt;</div><div>=C2=A0 iProduct=
 =3D 0x0002=C2=A0 &lt;USB-Serial Controller&gt;</div><div>=C2=A0 iSerialNum=
ber =3D 0x0000=C2=A0 &lt;no string&gt;</div><div>=C2=A0 bNumConfigurations =
=3D 0x0001</div><div><br></div><div>=C2=A0Configuration index 0</div><div><=
br></div><div>=C2=A0 =C2=A0 bLength =3D 0x0009</div><div>=C2=A0 =C2=A0 bDes=
criptorType =3D 0x0002</div><div>=C2=A0 =C2=A0 wTotalLength =3D 0x0027</div=
><div>=C2=A0 =C2=A0 bNumInterfaces =3D 0x0001</div><div>=C2=A0 =C2=A0 bConf=
igurationValue =3D 0x0001</div><div>=C2=A0 =C2=A0 iConfiguration =3D 0x0000=
=C2=A0 &lt;no string&gt;</div><div>=C2=A0 =C2=A0 bmAttributes =3D 0x00a0</d=
iv><div>=C2=A0 =C2=A0 bMaxPower =3D 0x0032<br></div><div><br></div><div>=C2=
=A0 =C2=A0 Interface 0</div><div>=C2=A0 =C2=A0 =C2=A0 bLength =3D 0x0009</d=
iv><div>=C2=A0 =C2=A0 =C2=A0 bDescriptorType =3D 0x0004</div><div>=C2=A0 =
=C2=A0 =C2=A0 bInterfaceNumber =3D 0x0000</div><div>=C2=A0 =C2=A0 =C2=A0 bA=
lternateSetting =3D 0x0000</div><div>=C2=A0 =C2=A0 =C2=A0 bNumEndpoints =3D=
 0x0003</div><div>=C2=A0 =C2=A0 =C2=A0 bInterfaceClass =3D 0x00ff=C2=A0 &lt=
;Vendor specific&gt;</div><div>=C2=A0 =C2=A0 =C2=A0 bInterfaceSubClass =3D =
0x0000</div><div>=C2=A0 =C2=A0 =C2=A0 bInterfaceProtocol =3D 0x0000</div><d=
iv>=C2=A0 =C2=A0 =C2=A0 iInterface =3D 0x0000=C2=A0 &lt;no string&gt;</div>=
<div><br></div><div>=C2=A0 =C2=A0 =C2=A0Endpoint 0</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 bLength =3D 0x0007</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bDes=
criptorType =3D 0x0005</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bEndpointAddre=
ss =3D 0x0081=C2=A0 &lt;IN&gt;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bmAttr=
ibutes =3D 0x0003=C2=A0 &lt;INTERRUPT&gt;</div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 wMaxPacketSize =3D 0x000a</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bInt=
erval =3D 0x0001</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bRefresh =3D 0x0000<=
/div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bSynchAddress =3D 0x0000</div><div><b=
r></div><div>=C2=A0 =C2=A0 =C2=A0Endpoint 1</div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 bLength =3D 0x0007</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bDescriptor=
Type =3D 0x0005</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bEndpointAddress =3D =
0x0002=C2=A0 &lt;OUT&gt;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bmAttributes=
 =3D 0x0002=C2=A0 &lt;BULK&gt;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 wMaxPa=
cketSize =3D 0x0040</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bInterval =3D 0x0=
000</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bRefresh =3D 0x0000</div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 bSynchAddress =3D 0x0000</div><div><br></div><div>=
=C2=A0 =C2=A0 =C2=A0Endpoint 2</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bLengt=
h =3D 0x0007</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bDescriptorType =3D 0x00=
05</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bEndpointAddress =3D 0x0083=C2=A0 =
&lt;IN&gt;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bmAttributes =3D 0x0002=C2=
=A0 &lt;BULK&gt;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 wMaxPacketSize =3D 0=
x0040</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bInterval =3D 0x0000</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bRefresh =3D 0x0000</div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 bSynchAddress =3D 0x0000</div>

</div><div><br></div><div>I&#39;m using a USB port measuring device that ca=
n
 check the voltage and current usages and by default (without any USB=20
devices attached) each port reads as 5.15 volts and 0.00 amperes for=20
current of 3B. I&#39;m using the official Raspberry Pi=20
Stontronics power adapter with 5.1V with 2.5A DC output <a href=3D"https://=
docs.rs-online.com/0c30/0900766b814dc7bb.pdf">https://docs.rs-online.com/0c=
30/0900766b814dc7bb.pdf</a>. From here due=20
to over-current, I cannot obtain the actual power
consumptions specific to my PL2303 device so I try installing the latest
 Raspberry Pi OS to check if it behaves the same. I found out that it=20
has a similar behavior and experience getting over-current with=20
additional under-voltage detected messages. However, it&#39;s interesting t=
o observe=20
that even in an over-current and under-voltage experience, all the ports=20
are re-powered up and functioning and then able to load the PL2303 driver a=
nd I am able to use it via /dev/ttyUSB0 device. This time I could see=20
the measuring device giving a 4.93 volts with 0.46 amperes of current (460m=
A) in the PL2303 device (see captured measurement here <a href=3D"https://f=
ilebin.net/kqq664yf9w70omnh">https://filebin.net/kqq664yf9w70omnh</a>). Bel=
ow is the dmesg log I&#39;ve got from RPi OS.<br></div><div><br></div><div>
[ 7490.507686] usb 1-1-port2: over-current change #3<br>[ 7490.722717] usb =
1-1.2: USB disconnect, device number 5<br>[ 7491.006607] hwmon hwmon1: Unde=
rvoltage detected!<br>[ 7491.094482] usb 1-1.5: new full-speed USB device n=
umber 7 using dwc_otg<br>[ 7491.198613] usb 1-1.5: New USB device found, id=
Vendor=3D067b, idProduct=3D2303, bcdDevice=3D 3.00<br>[ 7491.198676] usb 1-=
1.5: New USB device strings: Mfr=3D1, Product=3D2, SerialNumber=3D0<br>[ 74=
91.198700] usb 1-1.5: Product: USB-Serial Controller<br>[ 7491.198722] usb =
1-1.5: Manufacturer: Prolific Technology Inc.<br>[ 7491.200210] pl2303 1-1.=
5:1.0: pl2303 converter detected<br>[ 7491.206808] usb 1-1.5: pl2303 conver=
ter now attached to ttyUSB0<br>[ 7491.209222] usb 1-1-port2: over-current c=
hange #4<br>[ 7491.646484] usb 1-1.2: new low-speed USB device number 8 usi=
ng dwc_otg<br>[ 7491.770462] usb 1-1.2: New USB device found, idVendor=3D09=
da, idProduct=3D2267, bcdDevice=3D 1.05<br>[ 7491.770515] usb 1-1.2: New US=
B device strings: Mfr=3D1, Product=3D2, SerialNumber=3D0<br>[ 7491.770539] =
usb 1-1.2: Product: USB Keyboard<br>[ 7491.770560] usb 1-1.2: Manufacturer:=
 A4Tech<br>[ 7491.793771] input: A4Tech USB Keyboard as /devices/platform/s=
oc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:09DA:2267.0004/input/input6<b=
r>[
 7491.852612] hid-generic 0003:09DA:2267.0004: input,hidraw0: USB HID=20
v1.11 Keyboard [A4Tech USB Keyboard] on usb-3f980000.usb-1.2/input0<br>[ 74=
91.875068] input: A4Tech USB Keyboard as /devices/platform/soc/3f980000.usb=
/usb1/1-1/1-1.2/1-1.2:1.1/0003:09DA:2267.0005/input/input7<br>[
 7491.935697] hid-generic 0003:09DA:2267.0005: input,hidraw1: USB HID=20
v1.11 Device [A4Tech USB Keyboard] on usb-3f980000.usb-1.2/input1<br>[ 7495=
.038507] hwmon hwmon1: Voltage normalised</div><div><br></div><div>Though
 this experience is specific to the Raspberry 3B case, is there a way to
 enable this in FreeBSD? Knowing that there is dropping of voltage to=20
4.93 volts and current is 460mA which is still below the maximum of 500mA?<=
/div><div><br></div><div>Thanks,</div><div>Archimedes</div>

</div>

--000000000000d4f22b05dc3c8026--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJFbk7FgSnWvN9Z7gp1wqW1CFa8bYqrr6zccMWEhotk5HMR=Tg>