完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
最近使用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: 0x82 IN 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: 0x01 OUT Transfer Type: Bulk wMaxPacketSize: 0x0040 (64) bInterval: 0x00 Endpoint Descriptor: bEndpointAddress: 0x81 IN Transfer Type: Bulk wMaxPacketSize: 0x0040 (64) bInterval: 0x00 观察发现枚举应该没有问题,可是端点没有打开。不知何故? |
|
相关推荐
24个回答
|
|
看下USB 驱动ID是否一样
|
|
|
|
学习学习,,,
|
|
|
|
最早就看过ID了,似乎不是。谢谢!
|
|
|
|
|
|
|
|
可以学习
|
|
|
|
xuexileafa 学习了
|
|
|
|
刚才我从一个国外网站上找到一段F429-Disco的例程 ,测试通过。
网站是: http://stm32f4-discovery.com/ 我需要用u*** view再观察一下,然后排查一下cube生成的代码还需要做什么工作。我看cube的那个um1734看了一两天,也没看明白流程。杯具呀! 下面是用u*** 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: 0x82 IN Transfer Type: Interrupt wMaxPacketSize: 0x0008 (8) bInterval: 0x10 Endpoint Descriptor: bEndpointAddress: 0x01 OUT Transfer Type: Bulk wMaxPacketSize: 0x0040 (64) bInterval: 0x00 Endpoint Descriptor: bEndpointAddress: 0x81 IN 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: 0x82 IN 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: 0x01 OUT Transfer Type: Bulk wMaxPacketSize: 0x0040 (64) bInterval: 0x00 Endpoint Descriptor: bEndpointAddress: 0x81 IN Transfer Type: Bulk wMaxPacketSize: 0x0040 (64) bInterval: 0x00 顺便吐槽一下cube库中F4/429-discovery没有USB Device的例程,F4X9的例程似乎也不适用。 |
|
|
|
通过比较,发现枚举的数据和之前那个并无不同,唯一不同的是连接状态。设备在连上主机之后的枚举应该是完成的,但是为什么端点打不开呐?通过刚才烧写的那个程序显示,硬件是没有问题的。继续探测,能不能为cube库的u***做几节教程呐,高手们,哪怕是ppt也行。
|
|
|
|
naiztycheng 发表于 2019-3-4 15:23 我的F429使用的是标准库里面的USB CDC 驱动,比这个HAL好理解些,这个HAL的USB代码太复杂了 |
|
|
|
嗯,我刚才在看我提到网站上的VCP,他用的就是标准库。 |
|
|
|
又及: 关于cube和标准库的争辩由来已久。cube的好处是显而易见的:硬件免配置,用户可以将尽力用到应用上,而且熟悉了之后整个代码的结构还是相对简明的。但是标准库的好处也是不用言说的:代码结构非常简洁,不像cube同一个功能要封装几层,标准库很容易追踪到函数的实现。而且用户量庞大。 但是cube在另外一些方面也远远好于标准库,之前的标准库并不附带u***和freertos,当你使用stemwin的时候也要自己将其添加到工具中,但是cube想当一个百宝箱。 此外mbed的库叶挺不错,希望arm借助mbed能够将arm的变成标准化,今年年底应该可以看到mbed os。此外,谷歌新出的Brillo不知道是不是和M系列的CPU能搭上。 科技发展太快了,硬件工程师很累呀。希望能有办法只专注于应用,而非平台。 |
|
|
|
学习了
|
|
|
|
还是要潜心研究
|
|
|
|
naiztycheng 发表于 2019-3-4 15:51 HAL的结构的使用和Linux的做法很相似,将硬件层和应用层分离出来,这样的做法是很好的,但是适应的确需要个过程,比较标准库用了那么久了。 好像标准库也有USB的各种模式的驱动啊,我不知道你所指的没有USB是说哪方面? |
|
|
|
学习一下。什么叫VCP还不知道
|
|
|
|
学习一下。。。
|
|
|
|
我也不喜欢HAL,太绕,看着看着就晕了
|
|
|
|
|
|
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
717 浏览 1 评论
968 浏览 1 评论
1924 浏览 1 评论
1656 浏览 1 评论
MCU友好过渡MPU,米尔基于STM32MP135开发板裸机开发应用笔记
697 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-5-15 05:58 , Processed in 1.051731 second(s), Total 108, Slave 92 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号