Skip to content

USB gadget link stays in NO-CARRIER state with macOS host (M2 Pro) #29

Description

@bradcar

I’ve been trying gadget mode to work on macbook pro M2 and I’m having a tough time. 6 months ago, Before Trixie, I was able to make communication over USB, but got distracted with other projects before coming back.

Environment:

  • Pi: Raspberry Pi Zero 2 W running Raspberry Pi OS Trixie (Kernel 6.18.34+rpt-rpi-v6), I also am trying to get this to work on a Pi Zero W.
  • Host: Apple MacBook Pro M2 running macOS Tahoe
  • Connection: Direct USB-C to Pi inner micro-USB (DATA) port (no hub), this is a 480Mbps cable that will show data from my camera.

To rule out power-only micro-USB cables, the exact micro-usb to usb-c cable was verified with a Sony DSC-RX100M7A camera on the same M2 MacBook Pro:

USB 3.1 Bus:

  Location ID:	0x01000000
  Connection Type:	Built-in
  Driver:	AppleT8112USBXHCI

DSC-RX100M7A:
  Location ID:	0x01100000
  Connection Type:	Removable
  Manufacturer:	Sony
  Serial Number:	C<REDACT>
  Link Speed:	480 Mb/s
  USB Vendor ID:	0x054c
  USB Product ID:	0x0f07
  USB Product Version:	0x0200
  Power Allocated:	2.5 W (500 mA)

This seems to be a good cable based on this, but Is there a particular cable that someone can point me to that they know works (Amazon)?

Description: After enabling rpi-usb-gadget, the usb0 interface remains in NO-CARRIER (state DOWN) and fails to establish a physical link-layer connection with the macOS host.

Steps Taken & Output:

  1. Enabled gadget mode and checked network interface status:
sudo rpi-usb-gadget on
sudo reboot
sudo nmcli connection up "USB Gadget (shared)"

Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)
ip addr show usb0

2: usb0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 12:34:56:78:9a:bc brd ff:ff:ff:ff:ff:ff
    inet 10.12.194.1/28 brd 10.12.194.15 scope global noprefixroute usb0
       valid_lft forever preferred_lft forever
ls /sys/class/udc
20980000.usb
  1. Attempted to bring up NetworkManager profile manually:
sudo nmcli connection up usb-gadget
# Output confirms connection profile exists, but usb0 link remains LOWER_DOWN / NO-CARRIER

Expected Behavior: I think Plugging the Pi directly into the Mac's USB-C port should trigger host link negotiation (LOWER_UP), allowing the Mac to receive a DHCP/Link-Local address in the 10.12.194.x subnet.

dmesg | grep -i -E "dwc2|gadget|udc"
[    7.946772] dwc2 20980000.usb: supply vusb_d not found, using dummy regulator
[    7.947113] dwc2 20980000.usb: supply vusb_a not found, using dummy regulator
[    8.049621] dwc2 20980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[   20.432989] g_ether gadget.0: HOST MAC 12:34:56:78:9a:bd
[   20.433032] g_ether gadget.0: MAC 12:34:56:78:9a:bc
[   20.433325] g_ether gadget.0: Ethernet Gadget, version: Memorial Day 2008
[   20.433354] g_ether gadget.0: g_ether ready
[   20.433501] dwc2 20980000.usb: bound driver g_ether

This may be the same problem, as it has the same macOS Apple Silicon driver/CDC-ECM enumeration issue reported in issue "USB Gadget Not Appearing; CM5 + IO Board Rev 2 #19."

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions