|
发表于 2021-3-20 04:48:40
|
显示全部楼层
我是用cubemx生成的vcp,在win10下被自动识别成usb串口设备并自动安装了驱动,我的上位机是用的libusb,我想用zadig生成的驱动,需要手动更新才行。改了vid和pid,bDeviceClass也是这样,都被win10自动识别了,还要改动那个描述符能让win10不自动安装它自带的串口驱动。
/* USB Standard Device Descriptor */
const uint8_t Virtual_Com_Port_DeviceDescriptor[] =
{
0x12, /* bLength */
USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType */
0x00,
0x02, /* bcdUSB = 2.00 */
0xFF, /* bDeviceClass: CDC */
0xFF, /* bDeviceSubClass */
0xFF, /* bDeviceProtocol */
0x40, /* bMaxPacketSize0 */
0x78,
0x56, /* idVendor = 0x0483 */
0x34,
0x12, /* idProduct = 0x7805 */
0x00,
0x02, /* bcdDevice = 2.00 */
1, /* Index of string descriptor describing manufacturer */
2, /* Index of string descriptor describing product */
3, /* Index of string descriptor describing the device's serial number */
0x01 /* bNumConfigurations */
}; |
|