-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB PD request makes gadgets not work with some hosts #6569
Comments
I should also mention that I tried a wide variety of USB C cables, both with and without eMarkers. The PSU_MAX_CURRENT workaround works with iPad Pro M4, MacBook Air M3 and the rear (Thunderbolt 4) ports of the Mac mini M4, but not with the front (USB C) ports of the Mac mini M4. This is all with the Pi 5. Possibly related to #6289 |
Here's another report confirming that things don't work on the iPad Pro M4 verxion/RaspberryPi#1 |
I’m experiencing the same issue with my CM5 and the official IO board. If you take the same properly set up CM5 module and test it on a CM4 board (assuming you have access to one), could you let me know whether that setup works properly? In my case, the CM5 works perfectly on the CM4 boards that I previously used for ethernet gadgets. I currently only have the IO board for CM5 as few (if any?) other options exist. |
This problem can't possibly occur with the CM4 IO board, since it uses a 12V barrel connector for power rather than USB PD, and the connector for the dwc2 is MicroUSB which doesn't have the CC lines used for USB PD negotiation. There's Waveshare PoE board for the CM5. I haven't tried, but it is highly likely to have the same problem. |
Describe the bug
When connecting a Raspberry Pi 5 (or CM5) to some hosts (recent Apple devices) using a direct USB C cable connection and configuring the Pi as a USB ethernet gadget, the host does not recognize the ethernet gadget. This happens only in cases where the Pi sends a USB PD request to the host. If the EEPROM is configured not to send a USB PD request, then the host does recognize the gadget. The hosts where this happen include
Steps to reproduce the behaviour
/boot/firmware/config.txt
, add a linedtoverlay=dwc2,dr_mode=peripheral
/boot/firmware/cmdline.txt
, appendmodules-load=dwc2,g_ether
nmcli con add type ethernet ifname usb0 con-name usb0 ipv4.method link-local
touch /etc/udev/rules.d/85-nm-unmanaged.rules
What I see on the Pi:
od -t u4 --endian=big /proc/device-tree/chosen/power/max_current
shows 3000mA current has been negotiatedethtool usb0
shows no link detectednmcli dev show usb0
shows carrier offOn the host no ethernet gadget shows up in Settings.
What I expect to see on the Pi:
ethtool usb0
shows link detectedI also expect that the ethernet gadget shows up on the host and that I can ssh into the Pi using
ssh raspberrypi.local
If I use
rpi-eeprom-config -e
to addPSU_MAX_CURRENT=3000
, then I see what I expect to see.Device (s)
Raspberry Pi 5, Raspberry Pi CM5
System
/etc/rpi-issue
Firmware
Kernel
Logs
When things work I see
When things don't work, I don't see the last three lines.
Additional context
Everything works OK on:
On these,
/proc/device-tree/chosen/power/max_current
shows a current of 1500mA. Everything also works if I put a USB PD powered hub between the host and the Pi.I used a USB tester (a POWER-Z KM003C) with Windows software that allows the USB PD messages to be captured. With the iPad Mini, the iPad advertises some PDOs, but the Raspberry Pi never sends any PD requests (presumably because it is offering less than 5V3A). With the iPad Pro, the Raspberry Pi sends a request for 5V3A, which the iPad accepts. The iPad Pro then sends a whole bunch of messages (e.g. Get Sink Cap, Get Source Cap Extended, Get Sink Cap Extended, Get Revision, Get Source Info), which the Pi does not respond to. None of these messages got sent in the iPad Mini case. This suggests that a possible explanation is that the iPad is expecting a more complete USB PD implementation than the Pi provides.
The text was updated successfully, but these errors were encountered: