我使用CH32V307下载CH372Device例程,在电脑上可以识别为CH372设备。
请帮忙提供一下模拟成CH372设备的Linux驱动。
尝试:
CH32V307烧录CH372Device例程(vid, pid默认为1A86:5537);
linux驱动使用CH372的驱动,但无法与CH32V307的CH372Device的vid, pid匹配。
强行将ch372的驱动与ch32v307的vid, pid匹配,会挂掉。
ch32v307的CH372Device例程,官方例程配置为:
(uint8_t)DEF_USB_VID, (uint8_t)(DEF_USB_VID >> 8), // idVendor 0x1A86
(uint8_t)DEF_USB_PID, (uint8_t)(DEF_USB_PID >> 8), // idProduct 0x5537
CH372的官方linux驱动,官方驱动配置为:
/* Define these values to match your devices */
#define USB_ch37x_VENDOR_ID_1 0x4348
#define USB_ch37x_VENDOR_ID_2 0x1A86
#define USB_ch37x_VENDOR_ID_3 0x1C00
#define USB_ch37x_PRODUCT_ID_1 0x5537
#define USB_ch37x_PRODUCT_ID_2 0x5538
#define USB_ch37x_PRODUCT_ID_3 0x5576
#define USB_ch37x_PRODUCT_ID_4 0x55e0
/* table of devices that work with this driver */
static struct usb_device_id ch37x_table [] = {
{ USB_DEVICE(USB_ch37x_VENDOR_ID_1, USB_ch37x_PRODUCT_ID_1) },
{ USB_DEVICE(USB_ch37x_VENDOR_ID_1, USB_ch37x_PRODUCT_ID_2) },
{ USB_DEVICE(USB_ch37x_VENDOR_ID_3, USB_ch37x_PRODUCT_ID_1) },
{ USB_DEVICE(USB_ch37x_VENDOR_ID_2, USB_ch37x_PRODUCT_ID_3)},
{ USB_DEVICE(USB_ch37x_VENDOR_ID_1, USB_ch37x_PRODUCT_ID_4) },
{ }/* Terminating entry */
};
上述配置无法匹配上,请帮忙提供一下:
CH32V307模拟为CH372Device的例程;(如果没有特殊的,则使用官方的例程)
这个例程对应的linux驱动。