loosing usb-c connection after latest upgrade of bb-usb-gadgets

Dear all,

I spend an entire afternoon in trying to fix a problem after I updated to the latest version of the bb-usb-gadgets (that came with sudo apt upgrade) on a BB A64 board with the latest 6.19 kernel.

Using a win11 host i couldn’t get it to run anymore. That leads to no ssh and no com connection to the board (that is vital in my application). It always shows a warning sign for a USB-composite device. What ever I tried (mainly re-install RNDIS driver) doesn’t work. The warning sign moved from USB-composite to Networkadapters but thats all I could achieve. To be honest, it’s a little bit annoying to break the connection to the board by just upgrading.
On my linux host I could get it to work with some help of Claude AI. But even here it was broken on the first run.

It will be great if someone could point me on how to fix that broken usb-gadget connection.

Best Regards
Markus

please share this output..

journalctl | grep bb-usb-gadget

i merged a change to rework how the usb “serial” gadget was loaded as it was hanging login at bootup..

If you dump:

cat /etc/dogtag

i can also help debug to see how much i’ve ripped out since it worked…

Does beagleboard use g_multi or libcomposite? I changed to libcomposite years ago - it is a more modern system, but has it faults like having to use configfs, to set things up.

we use libcomposite, we’ve been transition all rndis to ncm, as that’s the best supported right now..

Ah yes - I originally used ecm, but also changed to ncm later. As I was connecting to a linux machine all methods worked out of the box and were fine - as ncm was newest I just forced it to only do ncm, and that worked for me.

But yes in a general set up you need to ensure that the ethernet over usb, works for all - I though it was fine to enable ncm, ecm, eem, rndis etc and just use some of the legacy g_ kernel modules. Think it isn’t much extra effort - as its just a case of setting them up in configfs. Not sure if there is a downside other than continuing support host that use legacy ethernet over usb?

Hi Robert,

this is what I get:

$ journalctl | grep bb-usb-gadget
Jun 03 22:12:07 BeagleBone systemd[1]: Starting bb-usb-gadgets.service - BeagleBoard.org USB gadgets...
Jun 03 22:12:08 BeagleBone bb-start-usb-gadgets[522]: bb-usb-gadgets: bb-start-acm-ncm-rndis-old-gadget
Jun 03 22:12:13 BeagleBone systemd[1]: Started bb-usb-gadgets.service - BeagleBoard.org USB gadgets.
Jun 03 22:12:13 BeagleBone systemd[1]: bb-usb-gadgets.service: Deactivated successfully.

$ cat /etc/dogtag
BeagleBoard.org Debian Trixie Xfce Image 2026-02-12

Actually the messages are exactly the same, independent if my host is linux or win11.

Some more information that might be of interest:

$ ls -l /sys/kernel/config/usb_gadget/
total 0
drwxr-xr-x 7 root root 0 Jun  3 22:12 g_multi

$ systemctl cat bb-usb-gadgets.service
# /usr/lib/systemd/system/bb-usb-gadgets.service
[Unit]
Description=BeagleBoard.org USB gadgets
After=usb-gadget.target
ConditionFileIsExecutable=/usr/bin/bb-start-usb-gadgets

[Service]
Type=forking
ExecStartPre=/sbin/modprobe libcomposite
ExecStart=/usr/bin/bb-start-usb-gadgets

[Install]
WantedBy=multi-user.target

Hope that helps to identify the problem

When setting up my pocket beagle, I was using Arch linux - but doing the same. Crux is what /usr/bin/bb-start-usb-gadgets does. Its there to construct the configfs file system that describes the functionality of the usb gadgets. This is creating files and directories.

I set this up in my file /etc/libcomposite.conf which is just a shell script for me, so its worth looking at:

#!/bin/bash
cd /sys/kernel/config/usb_gadget/
mkdir usbg
cd usbg
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
mkdir strings/0x409
echo "fedcba9876543210" > strings/0x409/serialnumber
echo "PocketBeagle" > strings/0x409/manufacturer
echo "USB OTG" > strings/0x409/product
mkdir -p configs/c.1/strings/0x409
echo "Config 1: ECM network" > configs/c.1/strings/0x409/configuration
echo 250 > configs/c.1/MaxPower
mkdir functions/acm.usb0
ln -s functions/acm.usb0 configs/c.1/
mkdir -p functions/ncm.usb0
HOST="48:6f:73:74:50:43" # Mac given to the host
SELF="42:61:64:55:53:42" # Mac given to ourselves
# echo $HOST > functions/ecm.usb0/host_addr
# echo $SELF > functions/ecm.usb0/dev_addr
ln -s functions/ncm.usb0 configs/c.1/
ls /sys/class/udc > UDC

So you can see the commands run. I’d check the /usr/bin/bb-start-usb-gadgets file, see if its a shell script, or if its been compiled. If its a shell script - suggest just running the commands one by one on the command line, and see what fails. To my mind it looks like the first failure is it has made the directory in /sys/kernel/config/usb_gadget as you can’t see it - so that the first step of why its failing.

How to fix is less clear, you need to understand /usr/bin/bb-start-usb-gadgets.