打印
[HMI/GUI]

新塘N9H26 使用USBH2.0无法识别U盘问题请教

[复制链接]
407|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
stone31|  楼主 | 2022-7-11 15:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 stone31 于 2022-7-11 15:49 编辑

问题:N9H26 无法通过USB2.0读取到U盘,硬件上是UH_DP,UH_DM直连出来的,UH_REXT也用12.1k接地了,具体设计参照新塘样机设计。供电什么的也正常,但是就是U盘有问题。
如果有知道是什么问题的大佬,请指点一下,谢谢!
主控:新塘N9H26k6
例程:USBH2.0/USBHost 和 USBH2.0/Command_Line
其中使用Command_Line,有如下问题:

USB new device connect on bus2/1, assigned device number 3
USB_SetAddress
USB_GetDescriptor...
USB_GetDeviceDescriptor 2th...
USB_GetDeviceDescriptor 2 ok!!
USB_GetConfiguration...
USB_SetConfiguration...
qTD halt 8C40, (0)
Manufacturer: Generic
qTD halt 8C40, (0)
Product: Mass Storage
qTD halt 8C40, (0)
SerialNumber: 7AE66014
  Length              = 18
  DescriptorType      = 01
  USB version         = 2.00
  Vendor:Product      = 058F:6387
  MaxPacketSize0      = 64
  NumConfigurations   = 1
  Device version      = 1.00
  Device Class:SubClass:Protocol = 00:00:00
    Per-interface classes
Configuration:
  bLength             =    9
  bDescriptorType     =   02
  wTotalLength        = 0020
  bNumInterfaces      =   01
  bConfigurationValue =   01
  iConfiguration      =   00
  bmAttributes        =   80
  MaxPower            =  200mA

  Interface: 0
  Alternate Setting:  0
    bLength             =    9
    bDescriptorType     =   04
    bInterfaceNumber    =   00
    bAlternateSetting   =   00
    bNumEndpoints       =   02
    bInterface Class:SubClass:Protocol =   08:06:50
    iInterface          =   00
    Endpoint:
      bLength             =    7
      bDescriptorType     =   05
      bEndpointAddress    =   01 (out)
      bmAttributes        =   02 (Bulk)
      wMaxPacketSize      = 0200
      bInterval           =   00
    Endpoint:
      bLength             =    7
      bDescriptorType     =   05
      bEndpointAddress    =   82 (in)
      bmAttributes        =   02 (Bulk)
      wMaxPacketSize      = 0200
      bInterval           =   00
port 1 of hub 2 reset change
act_altsettting is -484,314,925
id_index calculated to be: 17
Array length appears to be: 19
USB Mass Storage device detected
Endpoints: In: 0x0 Out: 0x0 Int: 0xE59D0074 (Period 255)
Endpoint sanity check failed! Rejecting dev.
USB Mass Storage support registered.
使用例程USBHost,日志如下:

port 1 of hub 2 reset change
act_altsettting is -442,511,332
id_index calculated to be: 17
Array length appears to be: 19
USB Mass Storage device detected
Endpoints: In: 0x94B Out: 0x125B Int: 0x13AF (Period 0)
New GUID 058F63870000000000000000
GetMaxLUN command result is 1, data is 0
Bulk max logical unit number: 0
Mass storage transport: Bulk-only
Mass storage protocol: Transparent SCSI
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3



******* Read lun 0 ******

INQUIRY ==>
STS_ERR!!
qh_completions - qh = 800BC8C0, info1 = 32002D03, token = 248148
qTD error 248148, (0)
ep13in 3strikes
ehciq.c 421, URB error --- qtd = 800BC980
qtd:800BC980, next:800BC800
qTD halt 248148, (0)
usb_stor_transfer_partial - clearing endpoint halt for pipe 0xC0068380
clear_halt!
STS_ERR!!
qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
qTD halt 80008D40, (0)
usb_stor_transfer_partial - unknown error
STS_ERR!!
qh_completions - qh = 800BC8C0, info1 = 32002D03, token = D8148
qTD error D8148, (0)
ep13in 3strikes
ehciq.c 421, URB error --- qtd = 800BC800
qtd:800BC800, next:800BCE80
qTD halt D8148, (0)
get CSW failed - clearing endpoint halt for pipe 0xC0068380
clear_halt!
STS_ERR!!
qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
qTD halt 80008D40, (0)
Attempting to get CSW (2nd try)...
STS_ERR!!
qh_completions - qh = 800BC8C0, info1 = 32002D03, token = D8148
qTD error D8148, (0)
ep13in 3strikes
ehciq.c 421, URB error --- qtd = 800BCE80
qtd:800BCE80, next:800BD380
qTD halt D8148, (0)
get CSW command 2nd try failed - clearing halt for pipe 0xC0068380
clear_halt!
STS_ERR!!
qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
qTD halt 80008D40, (0)
UMAS_BulkReset!
clear_halt!
STS_ERR!!
qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
qTD halt 80008D40, (0)
clear_halt!
UMAS_InvokeTransport - transport indicates transport error
Fixing INQUIRY data to show SCSI rev 2
INQUIRY - command failed!
TEST UNIT READY ==>
STS_ERR!!
qh_completions - qh = 800BC8C0, info1 = 32002D03, token = D8148
qTD error D8148, (0)
ep13in 3strikes
ehciq.c 421, URB error --- qtd = 800BD380
qtd:800BD380, next:800BE680
qTD halt D8148, (0)
get CSW failed - clearing endpoint halt for pipe 0xC0068380
clear_halt!
STS_ERR!!
qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
qTD halt 80008D40, (0)
Attempting to get CSW (2nd try)...
STS_ERR!!
qh_completions - qh = 800BC8C0, info1 = 32002D03, token = D8148
qTD error D8148, (0)
ep13in 3strikes
ehciq.c 421, URB error --- qtd = 800BE680
qtd:800BE680, next:800BEB80
qTD halt D8148, (0)
get CSW command 2nd try failed - clearing halt for pipe 0xC0068380
clear_halt!
STS_ERR!!
qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
qTD halt 80008D40, (0)
UMAS_BulkReset!
clear_halt!
STS_ERR!!
qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
qTD halt 80008D40, (0)
clear_halt!
UMAS_InvokeTransport - transport indicates transport error
TEST_UNIT_READY not UNIT_ATTENTION!
USB Mass Storage support registered.
fsDiskFreeSpace failed!!


使用特权

评论回复
沙发
stone31|  楼主 | 2022-7-11 16:35 | 只看该作者
问题暂时解决了,新塘的N9H26_USBH.lib库不能用,具体原因不清楚,解决办法是使用
https://gitlab.com/OpenNuvoton/NuMicro-ARM7-ARM9-Family/N32926_NonOS_BSP

这个里面的库W55FA92_usbh.lib和W55FA92_UMAS.lib。
有点坑,这问题调试了很久,没想到是库问题。新塘这款的USBH没有源码,太难了。

使用特权

评论回复
板凳
redone| | 2022-7-12 20:34 | 只看该作者
这是usb专用的库么

使用特权

评论回复
地板
sadicy| | 2022-7-17 09:21 | 只看该作者
记录下,将来用到了翻翻看

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

3

帖子

0

粉丝