Our company is attempting to use a raspberry pi 0 wifi for an IOT product that we are booting with a custom yocto image. After making some changes (added mender) the serial 1 device stopped working on first boot. This means that the bluetooth fails to start. After rebooting it works perfectly every time, but the very first time it boots after a fresh installation it fails consistently.
The error that we are getting is
dev-serial1.device: Job dev-serial1.device/start timed out. This then causes
bcrm43438 to fail which breaks bluetooth.
We have the following udev rule set up at
KERNEL=="ttyAMA", PROGRAM="/bin/sh -c '\ ALIASES=/proc/device-tree/aliases; \ if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \ echo 0;\ elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \ echo 1; \ else \ exit 1; \ fi\ '", SYMLINK+="serial%c" KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\ ALIASES=/proc/device-tree/aliases; \ if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \ echo 0; \ elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \ echo 1; \ else \ exit 1; \ fi \ '", SYMLINK+="serial%c"
if we run
udevadm control --reload-rules && udevadm trigger after booting it will load up serial1 and then if we run
btuart it will start working properly.
Is there a good way to debug the udev startup process to see what is going on? It is a little weird because it is only on the first boot, and so we can't edit the
systemd-udevd.service file and reboot because the problem will no longer manifest.