watershade 发表于 2015-6-4 11:50:26

F429-disco的VCP驱动问题

最近使用f4cube V1.5开发VCP驱动,按照F429-Discovery板子的配置选择OTG-HS接口作为Device设备来用,选择CDC协议。修改完APP_RX_DATA_SIZE和APP_TX_DATA_SIZE为2048,添加LineCoding代码。可是连接到计算机上,装完驱动(VCP V1.4)之后显示错误代码10的故障。计算机业换过win764/32位的。所以估计是代码的错误,使用USB VIEW观测之后,效果如下:
Device Descriptor:
bcdUSB:             0x0200
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x40 (64)
idVendor:         0x0483 (STMicroelectronics)
idProduct:          0x5740
bcdDevice:          0x0200
iManufacturer:      0x01
0x0409: "STMicroelectronics"
iProduct:             0x02
0x0409: "STM32 Virtual ComPort"
iSerialNumber:      0x03
0x0409: "000000002B1A"
bNumConfigurations:   0x01

ConnectionStatus: DeviceConnected
Current Config Value: 0x00
Device Bus Speed:   Full
Device Address:       0x03
Open Pipes:            0

Configuration Descriptor:
wTotalLength:       0x0043
bNumInterfaces:       0x02
bConfigurationValue:0x01
iConfiguration:       0x00
bmAttributes:         0xC0 (Bus Powered Self Powered )
MaxPower:             0x32 (100 Ma)

Interface Descriptor:
bInterfaceNumber:   0x00
bAlternateSetting:    0x00
bNumEndpoints:      0x01
bInterfaceClass:      0x02
bInterfaceSubClass:   0x02
bInterfaceProtocol:   0x01
iInterface:         0x00

Unknown Descriptor:
bDescriptorType:      0x24
bLength:            0x05
05 24 00 10 01

Unknown Descriptor:
bDescriptorType:      0x24
bLength:            0x05
05 24 01 00 01

Unknown Descriptor:
bDescriptorType:      0x24
bLength:            0x04
04 24 02 02

Unknown Descriptor:
bDescriptorType:      0x24
bLength:            0x05
05 24 06 00 01

Endpoint Descriptor:
bEndpointAddress:   0x82IN
Transfer Type:   Interrupt
wMaxPacketSize:   0x0008 (8)
bInterval:            0x10

Interface Descriptor:
bInterfaceNumber:   0x01
bAlternateSetting:    0x00
bNumEndpoints:      0x02
bInterfaceClass:      0x0A
bInterfaceSubClass:   0x00
bInterfaceProtocol:   0x00
iInterface:         0x00

Endpoint Descriptor:
bEndpointAddress:   0x01OUT
Transfer Type:      Bulk
wMaxPacketSize:   0x0040 (64)
bInterval:            0x00

Endpoint Descriptor:
bEndpointAddress:   0x81IN
Transfer Type:      Bulk
wMaxPacketSize:   0x0040 (64)
bInterval:            0x00

观察发现枚举应该没有问题,可是端点没有打开。不知何故?

mark0668 发表于 2015-6-4 12:18:15

看下USB 驱动ID是否一样

lusonghua 发表于 2015-6-4 12:22:04

学习学习,,,:lol

watershade 发表于 2015-6-4 13:31:13

最早就看过ID了,似乎不是。谢谢!

watershade 发表于 2015-6-4 13:33:07

驱动里面的ID:
%DESCRIPTION%=DriverInstall,USB\VID_0483& PID_5740
和我用USB VIEW看到的一样。
无助呀,:'(

莫林2020 发表于 2015-6-4 13:52:40

可以学习

无力回天 发表于 2015-6-4 13:54:15

xuexileafa 学习了

watershade 发表于 2015-6-4 14:05:59

刚才我从一个国外网站上找到一段F429-Disco的例程 ,测试通过。:D
网站是: http://stm32f4-discovery.com/
我需要用usb view再观察一下,然后排查一下cube生成的代码还需要做什么工作。我看cube的那个um1734看了一两天,也没看明白流程。杯具呀!
下面是用usb view得出的数据:
Device Descriptor:
bcdUSB:             0x0200
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x40 (64)
idVendor:         0x0483 (STMicroelectronics)
idProduct:          0x5740
bcdDevice:          0x0200
iManufacturer:      0x01
0x0409: "STMicroelectronics"
iProduct:             0x02
0x0409: "STM32 Virtual ComPort in FS Mode"
iSerialNumber:      0x03
0x0409: "00000000050C"
bNumConfigurations:   0x01

ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:   Full
Device Address:       0x03
Open Pipes:            3

Endpoint Descriptor:
bEndpointAddress:   0x82IN
Transfer Type:   Interrupt
wMaxPacketSize:   0x0008 (8)
bInterval:            0x10

Endpoint Descriptor:
bEndpointAddress:   0x01OUT
Transfer Type:      Bulk
wMaxPacketSize:   0x0040 (64)
bInterval:            0x00

Endpoint Descriptor:
bEndpointAddress:   0x81IN
Transfer Type:      Bulk
wMaxPacketSize:   0x0040 (64)
bInterval:            0x00

Configuration Descriptor:
wTotalLength:       0x0043
bNumInterfaces:       0x02
bConfigurationValue:0x01
iConfiguration:       0x00
bmAttributes:         0xC0 (Bus Powered Self Powered )
MaxPower:             0x32 (100 Ma)

Interface Descriptor:
bInterfaceNumber:   0x00
bAlternateSetting:    0x00
bNumEndpoints:      0x01
bInterfaceClass:      0x02
bInterfaceSubClass:   0x02
bInterfaceProtocol:   0x01
iInterface:         0x00

Unknown Descriptor:
bDescriptorType:      0x24
bLength:            0x05
05 24 00 10 01

Unknown Descriptor:
bDescriptorType:      0x24
bLength:            0x05
05 24 01 00 01

Unknown Descriptor:
bDescriptorType:      0x24
bLength:            0x04
04 24 02 02

Unknown Descriptor:
bDescriptorType:      0x24
bLength:            0x05
05 24 06 00 01

Endpoint Descriptor:
bEndpointAddress:   0x82IN
Transfer Type:   Interrupt
wMaxPacketSize:   0x0008 (8)
bInterval:            0x10

Interface Descriptor:
bInterfaceNumber:   0x01
bAlternateSetting:    0x00
bNumEndpoints:      0x02
bInterfaceClass:      0x0A
bInterfaceSubClass:   0x00
bInterfaceProtocol:   0x00
iInterface:         0x00

Endpoint Descriptor:
bEndpointAddress:   0x01OUT
Transfer Type:      Bulk
wMaxPacketSize:   0x0040 (64)
bInterval:            0x00

Endpoint Descriptor:
bEndpointAddress:   0x81IN
Transfer Type:      Bulk
wMaxPacketSize:   0x0040 (64)
bInterval:            0x00

顺便吐槽一下cube库中F4/429-discovery没有USB Device的例程,F4X9的例程似乎也不适用。

watershade 发表于 2015-6-4 14:22:53

通过比较,发现枚举的数据和之前那个并无不同,唯一不同的是连接状态。设备在连上主机之后的枚举应该是完成的,但是为什么端点打不开呐?通过刚才烧写的那个程序显示,硬件是没有问题的。继续探测,能不能为cube库的usb做几节教程呐,高手们,哪怕是ppt也行。

creep 发表于 2015-6-4 14:26:29

watershade 发表于 2015-6-4 14:22
通过比较,发现枚举的数据和之前那个并无不同,唯一不同的是连接状态。设备在连上主机之后的枚举应该是完成 ...

我的F429使用的是标准库里面的USB CDC 驱动,比这个HAL好理解些,这个HAL的USB代码太复杂了
页: [1] 2 3
查看完整版本: F429-disco的VCP驱动问题