Raspi CM3+ in boot mode - discovery of USB device on other single board computer

sktpin

New Member
Credits
28
Hello there, first post here.

I already asked the same thing on the Raspi forums, alas they couldn't help with the details - which is, probably, specific Linux kernel config settings.
My thread is here.

I'll paste the gist of it here:

Assuming a Linux host with a minimalistic Linux image, buildroot based,
I so far was able to use the CM3+ as ethernet gadget / serial port combined, using g_cdc driver on the CM3, and enabling this feature in the kernel configuration of the host Linux.
I'm configuring 3 pins with host-GPIOs to select the proper mode for this, and that end of things works.

But when I want to flash the CM3 and switch it into boot mode, dmesg only shows that it does find something on the USB port, but loads no driver for it.
To that, an engineer from the Raspi forum said:
The rpiboot protocol uses a custom device to load the VPU code. It simply uses libusb to scan for a particular VID and does not require a specific kernel driver.
https://github.com/raspberrypi/usbboot/blob/master/main.c#L210
Presumably, your custom Linux config is rejecting USB devices that it doesn't recognise instead of allowing userspace programs to do this.
So, how flashing the CM3+ module is supposed to work (and does work, when using a Raspi4 or a Linux PC as the USB host, but does not work when the host is my buildroot board) is that 1) the rpiboot software, running on the host, searches for a device with a certain VID, opens & transfers a small image to it to turn it into a mass storage device, which then gets detected by the host, and presto, you can dd a Linux image image to the mounted USB mass storage -> eMMC of the Raspi CM3+ module.

On my buildroot board, this fails at theearly stage of the rpiboot software waiting forever to find a device with the known VID - hence the Raspi engineer suggesting this gets rejected by my buildroot Linuxbecause of my particular config.

E.g. all I see is
Code:
[  597.725309] usb 3-1: new full-speed USB device number 4 using xhci-hcd
[  601.965304] usb 3-1: new high-speed USB device number 5 using xhci-hcd
and no product is listed after that, whereas if the Raspi4 or Linux PC is the USB host, dmesg lists "Product: BCM2710 Boot" after the above.

Does anyone know specifig kernel options that would cause this not to work / the custom device being rejected?
 
Last edited:


sktpin

New Member
Credits
28
Seems there is no special option needed.
Rpiboot using libusb does, via libusb, by default, require udev to run, which it doesn't, on the host system. (it does not complain when you run it on a system without udev, though ...)
After compiling libusb myself, configuring it with "--disable-udev" before, and using that to build rpiboot, that then works.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!


Top