Reboot stuck in u-boot while scanning USB bus

Hi!

I am experimenting with rebooting my devices once a day, as a guarantee against memory leaks.

This morning the reboot had failed. The device was reported as offline, and no output was available when I connected to the serial port.

When rebooting from the container I use this Python snippet:
proc = await asyncio.create_subprocess_shell(
‘’‘DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket \
dbus-send \
–system \
–print-reply \
–dest=org.freedesktop.systemd1 \
/org/freedesktop/systemd1 \
org.freedesktop.systemd1.Manager.Reboot
‘’’
)

To debug the issue, I connected to the serial port and did several “reboot” commands in the host OS. After several reboots my device got stuck I U-Boot, at “USB0: scanning bus 0 for devices…”

My Raspberry 3B+ has an FDTI USB-to-RS232 device connected, which might be relevant.
BalenaOS version is at VERSION=“2.31.0+rev1”

Does anyone know what’s wrong with my system?

Logs from console:
[ 23.966057] IPv6: ADDRCONF(NETDEV_UP): supervisor0: link is not ready
[ 24.220016] IPv6: ADDRCONF(NETDEV_UP): br-7710cc8e4b13: link is not ready
[ 35.626461] systemd-journald[44]: Received request to flush runtime journal from PID 1
[ 37.518136] ip6_tables: © 2000-2006 Netfilter Core Team
[ 72.010339] systemd-journald[44]: Received SIGTERM.
[ 89.505581] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -30
[ 89.512621] brcmfmac: brcmf_vif_set_mgmt_ie: vndr ie set error : -30
[ 90.099479] systemd-shutdow: 28 output lines suppressed due to ratelimiting
[ 90.115261] systemd-shutdown[1]: Syncing filesystems and block devices.
[ 90.281321] systemd-shutdown[1]: Sending SIGTERM to remaining processes…
[ 90.302127] systemd-journald[465]: Received SIGTERM from PID 1 (systemd-shutdow).
[ 90.430730] systemd-shutdown[1]: Sending SIGKILL to remaining processes…
[ 90.450281] systemd-shutdown[1]: Hardware watchdog ‘Broadcom BCM2835 Watchdog timer’, version 0
[ 90.460765] systemd-shutdown[1]: Unmounting file systems.
[ 90.483461] EXT4-fs (mmcblk0p5): re-mounted. Opts: data=ordered
[ 90.629203] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
[ 90.642463] systemd-shutdown[1]: Failed to wait for process: Protocol error
[ 90.650706] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
[ 90.658716] systemd-shutdown[1]: Failed to wait for process: Protocol error
[ 90.668053] systemd-shutdown[1]: Failed to wait for process: Protocol error
[ 90.676649] systemd-shutdown[1]: Failed to wait for process: Protocol error
[ 90.683889] systemd-shutdown[1]: Not all file systems unmounted, 2 left.
[ 90.778155] reboot: Restarting system
MMC: mmc@7e202000: 0, mmc@7e300000: 1
Loading Environment from FAT… *** Warning - bad CRC, using default environment

Failed (-5)
In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
USB0:   scanning bus 0 for devices...