After adding the mods to the kernel, this seems to have helped my situation. This driver seems to be trying to load before the usb is ready and causing some problems.
This problem came back darn it. Thought I had it fixed. Seems to only happen once in 20 boots. Seems serial-getty@ttyGS0.service is looking for /dev/ttyGS0 but itās not there yet on boot. Is this your take on this?
#!/bin/sh
# Wait until ttyGS0 is ready
for i in $(seq 1 20); do
echo "$(date): checking for /dev/ttyGS0" >> /var/log/ttyGS0.log
if [ -c /dev/ttyGS0 ]; then
# Try opening it non-blocking to see if it's ready
if stty -F /dev/ttyGS0 >/dev/null 2>&1; then
echo "$(date): ttyGS0 ready, starting agetty" >> /var/log/ttyGS0.log
exec /sbin/agetty -o '-p -- \u' --keep-baud 115200,38400,9600 ttyGS0 vt100
fi
fi
sleep 0.5
done
echo "$(date): ttyGS0 not ready, exiting" >> /var/log/ttyGS0.log
exit 1
Exactly, it use to wait and not āblockā but in Debian 13 itās now blocking⦠Make sure itās disabled by default:
systemctl disable serial-getty@ttyGS0.service
This makes sure it doesnāt auto-start on bootup..
Then i have it only āstartingā in the the gadget script:
# Create Serial function.
mkdir $CONFIGFS/g_multi/functions/acm.usb0 || echo "${log} Couldn't create $CONFIGFS/g_multi/functions/acm.usb0"
# Link the Serial instance to the configuration
ln -s $CONFIGFS/g_multi/functions/acm.usb0 $CONFIGFS/g_multi/configs/c.1 || echo "${log} Couldn't symlink acm.usb0"
I checked my set up - think critically my serial-getty service is different from yours - I just used the system standard, so looks like you have written your own service, to my mind its best to use the script that comes with systemd, and it you write your own give it a different name.
Interesting. Then Iām not sure what Iām doing differently - for me the UART comes up reliably - and Iām not doing anything special, just using the standard systemd way of doing things. Donāt know if the issue is that systemd is a complicated beast, and finding the right bit documented correctly has never been easy ā¦