考虑在一些带有 USB 主机端口的 1-PCB 计算机上的极简主义、基于 buildroot 的 Linux 映像。
然后是另一台小电脑:一个树莓派计算模块“CM3”,两者之间唯一的连接是USB。当 CM3 在其上运行 Linux 时,它充当以太网小工具进行通信。
但是当 CM3 需要刷机时,它上面的一个输入引脚,由 buildroot 机器切换,告诉它“启动模式”,它将成为一个自定义 USB 设备“BCM2710 启动”。然后,Raspi 人员提供了一个用户空间程序usbboot aka rpiboot ,以通过 VID找到设备并上传一个小图像,将其变成大容量存储设备。
当我尝试这个时,将 CM3 USB 插入“普通”RaspberryPi 的主机 USB 端口,我看到了dmesg:
[16689.527482] usb 1-1.3: new high-speed USB device number 3 using xhci_hcd
[16689.657906] usb 1-1.3: config index 0 descriptor too short (expected 55, got 32)
[16689.658302] usb 1-1.3: New USB device found, idVendor=0a5c, idProduct=2764, bcdDevice= 0.00
[16689.658319] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[16689.658335] usb 1-1.3: Product: BCM2710 Boot
[16689.658350] usb 1-1.3: Manufacturer: Broadcom
然后, Rpiboot确实找到了设备并发送了提到的那个特殊图像。所以这行得通。
但是当我将它插入我的 buildroot 机器时,我只看到:
[ 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
所以它似乎看到了一些新的 USB 东西,但不会更进一步。并且rpiboot永远等待,而不是像在 Raspi 主机上那样找到它。因此,似乎有一个或多个 Linux 内核配置选项在我的 buildroot 映像中未启用,这会阻止它工作。我有这个想法是因为最初,所有以太网小工具的东西也不起作用,我不得不去启用 CDCETHER 和其他一些选项 - 但我不知道在这里用这个非标准设备寻找什么。有很多未启用的 CONFIG_USB_* 选项似乎与特定设备有关,但没有像“自定义”之类的东西。
什么是/是相应的选项?
添加:两种内核配置的排序和行匹配(相同选项)摘录的视图:我删除了两边相同设置的所有内容、特定设备的驱动程序或与 USB 无关的内容,以缩小列表公平的数额。我在https://cateee.net/上浏览了这些内核选项的简短描述,到目前为止,没有发现任何符合要求的内容 - 但并不是说我没有忽略或误解某些东西......
configRaspi4-Raspbian configBuildrootDevice
--------------------------------------------------------------------------------
CONFIG_HISI_HIKEY_USB is not set
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_NOP_USB_XCEIV=y CONFIG_NOP_USB_XCEIV is not set
CONFIG_USB_ACM=m CONFIG_USB_ACM=y
CONFIG_USB_ADUTUX=m CONFIG_USB_ADUTUX is not set
CONFIG_USB_AIRSPY is not set
CONFIG_USB_AN2720=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_ATM=m
CONFIG_USB_BELKIN=y
CONFIG_USB_CDC_COMPOSITE=m CONFIG_USB_CDC_COMPOSITE is not set
CONFIG_USB_CONFIGFS_ACM=y CONFIG_USB_CONFIGFS_ACM is not set
CONFIG_USB_CONFIGFS_ECM_SUBSET=y
CONFIG_USB_CONFIGFS_ECM=y CONFIG_USB_CONFIGFS_ECM is not set
CONFIG_USB_CONFIGFS_ECM_SUBSET is not set
CONFIG_USB_CONFIGFS_F_FS=y CONFIG_USB_CONFIGFS_F_FS is not set
CONFIG_USB_CONFIGFS_F_HID=y CONFIG_USB_CONFIGFS_F_HID is not set
CONFIG_USB_CONFIGFS_F_LB_SS=y CONFIG_USB_CONFIGFS_F_LB_SS is not set
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_NCM=y CONFIG_USB_CONFIGFS_NCM is not set
CONFIG_USB_CONFIGFS_OBEX=y CONFIG_USB_CONFIGFS_OBEX is not set
CONFIG_USB_CONFIGFS_RNDIS=y CONFIG_USB_CONFIGFS_RNDIS is not set
CONFIG_USB_CONFIGFS_SERIAL=y CONFIG_USB_CONFIGFS_SERIAL is not set
CONFIG_USB_CONFIGFS=m CONFIG_USB_CONFIGFS=y
CONFIG_USB_DEFAULT_PERSIST=y CONFIG_USB_DEFAULT_PERSIST is not set
CONFIG_USB_DWC2_DEBUG is not set
CONFIG_USB_DWC2_DUAL_ROLE=y
CONFIG_USB_DWC2_HOST is not set
CONFIG_USB_DWC2_PCI is not set
CONFIG_USB_DWC2_PERIPHERAL is not set
CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
CONFIG_USB_DWC2=m CONFIG_USB_DWC2 is not set
CONFIG_USB_DWC3_DUAL_ROLE=y
CONFIG_USB_DWC3_GADGET is not set
CONFIG_USB_DWC3_HAPS=y
CONFIG_USB_DWC3_HOST is not set
CONFIG_USB_DWC3_OF_SIMPLE=y
CONFIG_USB_DWC3_OTG is not set
CONFIG_USB_DWC3 is not set CONFIG_USB_DWC3=y
CONFIG_USB_DWCOTG=y
CONFIG_USB_ETH_EEM is not set CONFIG_USB_ETH_EEM=y
CONFIG_USB_ETH=m CONFIG_USB_ETH=y
CONFIG_USB_EZUSB_FX2=m CONFIG_USB_EZUSB_FX2 is not set
CONFIG_USB_F_ACM=m
CONFIG_USB_F_ECM=m CONFIG_USB_F_ECM=y
CONFIG_USB_F_EEM=m CONFIG_USB_F_EEM=y
CONFIG_USB_F_FS=m
CONFIG_USB_F_HID=m
CONFIG_USB_F_MASS_STORAGE=m CONFIG_USB_F_MASS_STORAGE=y
CONFIG_USB_F_NCM=m
CONFIG_USB_F_OBEX=m
CONFIG_USB_F_RNDIS=m CONFIG_USB_F_RNDIS=y
CONFIG_USB_F_SERIAL=m
CONFIG_USB_F_SS_LB=m
CONFIG_USB_F_SUBSET=m CONFIG_USB_F_SUBSET=y
CONFIG_USB_F_UAC2=m
CONFIG_USB_FEW_INIT_RETRIES is not set
CONFIG_USB_G_ACM_MS=m CONFIG_USB_G_ACM_MS is not set
CONFIG_USB_G_HID=m CONFIG_USB_G_HID is not set
CONFIG_USB_G_MULTI_CDC is not set
CONFIG_USB_G_MULTI_RNDIS=y
CONFIG_USB_G_MULTI=m CONFIG_USB_G_MULTI is not set
CONFIG_USB_G_SERIAL=m CONFIG_USB_G_SERIAL is not set
CONFIG_USB_GADGETFS=m CONFIG_USB_GADGETFS is not set
CONFIG_USB_GSPCA=m
CONFIG_USB_HIDDEV=y CONFIG_USB_HIDDEV is not set
CONFIG_USB_HSO=m
CONFIG_USB_LD=m CONFIG_USB_LD is not set
CONFIG_USB_LIBCOMPOSITE=m CONFIG_USB_LIBCOMPOSITE=y
CONFIG_USB_MASS_STORAGE=m CONFIG_USB_MASS_STORAGE is not set
CONFIG_USB_MON=m CONFIG_USB_MON is not set
CONFIG_USB_NET_CDC_EEM=m CONFIG_USB_NET_CDC_EEM=y
CONFIG_USB_NET_CDC_MBIM=m CONFIG_USB_NET_CDC_MBIM is not set
CONFIG_USB_NET_CDC_NCM=m CONFIG_USB_NET_CDC_NCM is not set
CONFIG_USB_NET_CDC_SUBSET_ENABLE=m
CONFIG_USB_NET_CDC_SUBSET=m CONFIG_USB_NET_CDC_SUBSET is not set
CONFIG_USB_NET_CDCETHER=m CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_RNDIS_HOST=m CONFIG_USB_NET_RNDIS_HOST is not set
CONFIG_USB_NET_RNDIS_WLAN=m
CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_OTG_FSM=y
CONFIG_USB_OTG_WHITELIST is not set
CONFIG_USB_OTG is not set CONFIG_USB_OTG=y
CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set
CONFIG_USB_OTG_PRODUCTLIST is not set
CONFIG_USB_PWC=m
CONFIG_USB_RAW_GADGET is not set
CONFIG_USB_ROLE_SWITCH=m CONFIG_USB_ROLE_SWITCH is not set
CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL is not set
CONFIG_USB_SEVSEG=m CONFIG_USB_SEVSEG is not set
CONFIG_USB_TEST=m CONFIG_USB_TEST is not set
CONFIG_USB_TMC=m CONFIG_USB_TMC is not set
CONFIG_USB_U_ETHER=m CONFIG_USB_U_ETHER=y
CONFIG_USB_U_SERIAL=m
CONFIG_USB_WUSB_CBAF is not set
CONFIG_USB_ZERO=m CONFIG_USB_ZERO is not set