1

I have a Raspberry Pi Compute Module 3+ mounted on an IO board running Yocto Poky with linux 5.10.17-v7.

I've installed different usb modules and libraries trying to make CM3 detect connected USB device. I'm using a simple wireless keyboard as a test. Here is the related Poky configuration:

KERNEL_MODULE_AUTOLOAD += "dwc2 g_ether usb_f_ecm"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-dwc2 kernel-module-g-ether kernel-module-usb-f-ecm"
IMAGE_INSTALL_append = " libusb1"
ENABLE_DWC2_PERIPHERAL = "1"
IMAGE_INSTALL_append += " linux-firmware"

Unfortunately, this did not help. When I run: lsusb I get an empty result (no error, no devices connected). When I run ls -allh /lib/firmware | grep -i rt I see different usb drivers present. Here are messages from the boot process:

journalctl | grep -i usb
Dec 16 17:25:18 raspberrypi-cm3 kernel: usbcore: registered new interface driver usbfs
Dec 16 17:25:18 raspberrypi-cm3 kernel: usbcore: registered new interface driver hub
Dec 16 17:25:18 raspberrypi-cm3 kernel: usbcore: registered new device driver usb
Dec 16 17:25:18 raspberrypi-cm3 kernel: usbcore: registered new interface driver lan78xx
Dec 16 17:25:18 raspberrypi-cm3 kernel: usbcore: registered new interface driver smsc95xx
Dec 16 17:25:18 raspberrypi-cm3 kernel: usbcore: registered new interface driver usb-storage
Dec 16 17:25:18 raspberrypi-cm3 kernel: usbcore: registered new interface driver usbhid
Dec 16 17:25:18 raspberrypi-cm3 kernel: usbhid: USB HID core driver
Dec 16 17:25:18 raspberrypi-cm3 kernel: dwc2 3f980000.usb: supply vusb_d not found, using dummy regulator
Dec 16 17:25:18 raspberrypi-cm3 kernel: dwc2 3f980000.usb: supply vusb_a not found, using dummy regulator
Dec 16 17:25:19 raspberrypi-cm3 kernel: dwc2 3f980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
Dec 16 17:25:19 raspberrypi-cm3 kernel: usb0: HOST MAC 11:22:33:44:55:66
Dec 16 17:25:19 raspberrypi-cm3 kernel: usb0: MAC 22:33:44:55:66:77
Dec 16 17:25:19 raspberrypi-cm3 kernel: dwc2 3f980000.usb: bound driver g_ether
Dec 16 17:25:21 raspberrypi-cm3 systemd[1]: Reached target Hardware activated USB gadget.
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    0.153120] usbcore: registered new interface driver usbfs
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    0.153193] usbcore: registered new interface driver hub
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    0.153271] usbcore: registered new device driver usb
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    1.968721] usbcore: registered new interface driver lan78xx
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    1.968795] usbcore: registered new interface driver smsc95xx
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    1.969428] usbcore: registered new interface driver usb-storage
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    1.977270] usbcore: registered new interface driver usbhid
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    1.977287] usbhid: USB HID core driver
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    6.636383] dwc2 3f980000.usb: supply vusb_d not found, using dummy regulator
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    6.643849] dwc2 3f980000.usb: supply vusb_a not found, using dummy regulator
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    6.753380] dwc2 3f980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    6.815337] usb0: HOST MAC 11:22:33:44:55:66
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    6.823893] usb0: MAC 22:33:44:55:66:77
Dec 16 17:25:23 raspberrypi-cm3 kernel[193]: [    6.852014] dwc2 3f980000.usb: bound driver g_ether
Dec 16 17:25:25 raspberrypi-cm3 dnsmasq[224]: dnsmasq: unknown interface usb0
Dec 16 17:25:25 raspberrypi-cm3 NetworkManager[209]: <info>  [1608139525.1939] manager: (usb0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)

As a test, I used the same CM3+, same board, same jumpers configuration and installed Raspbian on the CM. It detected the same USB device instantly (wireless keyboard). This is the result from lsusb from Raspbian:

Bus 001 Device 002: ID 238a:8367 Maxxter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Any ideas what might be missing in my Yocto Poky linux?

1 Answer 1

0

I've figured this out. In local.conf I also had:

ENABLE_DWC2_PERIPHERAL = "1"

and in config.txt I had:

dtoverlay=dwc2,dr_mode=peripheral

which effectively meant my Raspberry Pi Compute Module was behaving as USB guest and was not detecting USB wireless keyboard.

After removing the lines above, CM3 detected the USB keyboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.