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.
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.
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?
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.