@barryjump
With regards to the usb2-port4 message, I get the same messages when I running the dmesg command with no peripherals connected (see output below).
rak@rakpios:~ $ dmesg | grep usb2
[ 1.385990] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
[ 1.386026] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.386053] usb usb2: Product: xHCI Host Controller
[ 1.386074] usb usb2: Manufacturer: Linux 5.15.74-v8+ xhci-hcd
[ 1.386096] usb usb2: SerialNumber: 0000:05:00.0
[ 5.876347] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[ 9.964251] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[ 9.964490] usb usb2-port4: attempt power cycle
[ 14.368198] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[ 18.460271] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[ 18.460507] usb usb2-port4: unable to enumerate USB device
[ 22.532304] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[ 26.772221] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[ 30.860215] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[ 30.860432] usb usb2-port4: attempt power cycle
…message repeats…
When I run the dmesg -w I can see that it looks like it detects the USB2.0 Hub, but has and issue with usb2-port 4 for some reason
[ 5.801295] usb 3-1.4: Product: USB 2.0 Hub
[ 5.852037] hub 3-1.4:1.0: USB hub found
[ 5.852422] hub 3-1.4:1.0: 4 ports detected
[ 5.876347] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
Running the lsusb command, it looks like both USB2.0 root hubs are detected.
rak@rakpios:~ $ lsusb
Bus 003 Device 005: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 003 Device 004: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 003 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 003 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Looking at the Rakwireless RAK7391 datasheet (RAK7391 WisGate Connect Datasheet | RAKwireless Documentation Center) it mentions that the RAK7391 has two onboard USB 2.0 root hubs that expand one USB 2.o port on the CM4 to seven ports; one is available on the USB2 connector on the board, two are connected to mPCIe slots #1 and #2, and two more are connected to WisBlock slots and the other two are converted to UART and connected to the WisBlock interfaces as well.
In summary, I was not aware of the use with port4 on the usb2 root hub until you raised it. Like you. I’m not 100% sure what usb2-port four is mapped to, but suspect that it is one of the functions that I referred to above. Also, on the RAK7391 datasheet there is a block diagram (figure 2) showing how the USB2 root hubs are connected. Unfortunately, it doesn’t indicate what ports are used to connect to the interfaces. I’ll do some digging and would be interested in any of your findings.
Regards
Greg
Note:
I just noticed that at the bottom of the dmesg -w output there are a number of over-current messages relating to usb ports, one if which is related to usb2-port4. Note sure whether this is related, but I was interested to see whether you have the messages?
[ 894.590350] usb 1-1-port1: over-current change #1
[ 894.725345] usb usb2-port4: over-current change #1
[ 894.809016] usb 1-1-port1: over-current condition
[ 894.811199] usb 1-1-port2: over-current change #1
[ 894.940845] usb usb2-port4: over-current condition
[ 895.033030] usb 1-1-port2: over-current condition
[ 895.035221] usb 1-1-port3: over-current change #1
[ 895.256966] usb 1-1-port3: over-current condition
[ 895.259155] usb 1-1-port4: over-current change #1
[ 895.476956] usb 1-1-port4: over-current condition
Interestingly, if I disable USB2 on the /boot/config.txt, the message “usb usb2-port4: Cannot enable. Maybe the USB cable is bad?” is replaced with “usb usb2-port2: Cannot enable. Maybe the USB cable is bad?”. Also, all the other usb over-current messages disappear with exception to the on relating to usb2-port4. Note sure whether this is related and more of an observation.
UPDATE:
After enabling usb 2 in the /boot/config.txt file and rebooting the device, the “usb usb2-port4: Cannot enable. Maybe the USB cable is bad?” messages did not return when running the dmesg command. The only message that I had relating to usb2-port4 was the over-current message (see below).
Can you try:
- commenting out the “dtoverlay=dwc2,dr_mode=host” in the /boot/config.txt file to disable usb2;
- reboot the device;
- uncomment “dtoverlay=dwc2,dr_mode=host” in the /boot/config.txt file to enable usb2;
- reboot the device;
- run dmesg command to see if messages relating to usb2-port4 persist?
rak@rakpios:~ $ dmesg | grep usb2
[ 1.682242] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
[ 1.684949] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.687614] usb usb2: Product: xHCI Host Controller
[ 1.690151] usb usb2: Manufacturer: Linux 5.15.74-v8+ xhci-hcd
[ 1.692745] usb usb2: SerialNumber: 0000:05:00.0
[ 1.805673] usb usb2-port4: over-current change #1
[ 2.021419] usb usb2-port4: over-current condition