我使用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驅動。