Hi Moritz, > I am building a custom yocto image for the raspberry pi compute module > 4. I am using meta-raspberry scarthgap branch using the raspberrypi4
Can you provide a link to what ever that branch is? > machine (32-bit version). (U-Boot 2024.01) That release is quite old, can you test the latest 2025.04 release or even 2025.07-rc1 to see if that fixes things, I am pretty sure there's been quite a few fixes to that in the last year+. > In the /boot/config.txt I added: > # Enable USB peripheral mode > dtoverlay=dwc2,dr_mode=peripheral > which should be the right mode if I understand correctly. > > On startup the following is logged: > > PCIe BRCM: link up, 5.0 Gbps x1 (SSC) > PCI: Failed autoconfig bar 10 > starting USB... > Bus xhci_pci: dm_pci_bus_to_phys: invalid physical address > xhci-pci init cannot map PCI mem bar > probe failed, error -5 > No working controllers found So the USB2 controller on the CM4 isn't PCI based so those errors are likely spurious. > I have no idea on what could be the problem and how to fix this. > Ultimately I want to use the U-Boot ums feature to expose a block device > via the usb port to another computer. I have searched the mailing list > and other resources online but only found the following unanswered > stackoverflow post: > https://stackoverflow.com/questions/78843599/usb-not-working-in-u-boot-on-raspberry-pi-4b-with-custom-yocto-image So if I understand your description correctly you want to be able to emulate the RPi usbboot process described here? TBH as one of the RPi maintainers here I've never even considered this so have definitely not tested it in any form nor do I remember anyone mentioning it. Taking a quick look without digging out a CM3/CM4 device I think you're going to need to enable USB_GADGET_DWC2_OTG and associated configs, I am not sure if the meta you reference above does any of that for the configs etc. Peter [1] https://github.com/raspberrypi/usbboot