[HMI/GUI] 新塘N9H26 使用USBH2.0无法识别U盘问题请教

[复制链接]
841|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,有如下问题:

  1. USB new device connect on bus2/1, assigned device number 3
  2. USB_SetAddress
  3. USB_GetDescriptor...
  4. USB_GetDeviceDescriptor 2th...
  5. USB_GetDeviceDescriptor 2 ok!!
  6. USB_GetConfiguration...
  7. USB_SetConfiguration...
  8. qTD halt 8C40, (0)
  9. Manufacturer: Generic
  10. qTD halt 8C40, (0)
  11. Product: Mass Storage
  12. qTD halt 8C40, (0)
  13. SerialNumber: 7AE66014
  14.   Length              = 18
  15.   DescriptorType      = 01
  16.   USB version         = 2.00
  17.   Vendor:Product      = 058F:6387
  18.   MaxPacketSize0      = 64
  19.   NumConfigurations   = 1
  20.   Device version      = 1.00
  21.   Device Class:SubClass:Protocol = 00:00:00
  22.     Per-interface classes
  23. Configuration:
  24.   bLength             =    9
  25.   bDescriptorType     =   02
  26.   wTotalLength        = 0020
  27.   bNumInterfaces      =   01
  28.   bConfigurationValue =   01
  29.   iConfiguration      =   00
  30.   bmAttributes        =   80
  31.   MaxPower            =  200mA

  32.   Interface: 0
  33.   Alternate Setting:  0
  34.     bLength             =    9
  35.     bDescriptorType     =   04
  36.     bInterfaceNumber    =   00
  37.     bAlternateSetting   =   00
  38.     bNumEndpoints       =   02
  39.     bInterface Class:SubClass:Protocol =   08:06:50
  40.     iInterface          =   00
  41.     Endpoint:
  42.       bLength             =    7
  43.       bDescriptorType     =   05
  44.       bEndpointAddress    =   01 (out)
  45.       bmAttributes        =   02 (Bulk)
  46.       wMaxPacketSize      = 0200
  47.       bInterval           =   00
  48.     Endpoint:
  49.       bLength             =    7
  50.       bDescriptorType     =   05
  51.       bEndpointAddress    =   82 (in)
  52.       bmAttributes        =   02 (Bulk)
  53.       wMaxPacketSize      = 0200
  54.       bInterval           =   00
  55. port 1 of hub 2 reset change
  56. act_altsettting is -484,314,925
  57. id_index calculated to be: 17
  58. Array length appears to be: 19
  59. USB Mass Storage device detected
  60. Endpoints: In: 0x0 Out: 0x0 Int: 0xE59D0074 (Period 255)
  61. Endpoint sanity check failed! Rejecting dev.
  62. USB Mass Storage support registered.
使用例程USBHost,日志如下:

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



  14. ******* Read lun 0 ******

  15. INQUIRY ==>
  16. STS_ERR!!
  17. qh_completions - qh = 800BC8C0, info1 = 32002D03, token = 248148
  18. qTD error 248148, (0)
  19. ep13in 3strikes
  20. ehciq.c 421, URB error --- qtd = 800BC980
  21. qtd:800BC980, next:800BC800
  22. qTD halt 248148, (0)
  23. usb_stor_transfer_partial - clearing endpoint halt for pipe 0xC0068380
  24. clear_halt!
  25. STS_ERR!!
  26. qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
  27. qTD halt 80008D40, (0)
  28. usb_stor_transfer_partial - unknown error
  29. STS_ERR!!
  30. qh_completions - qh = 800BC8C0, info1 = 32002D03, token = D8148
  31. qTD error D8148, (0)
  32. ep13in 3strikes
  33. ehciq.c 421, URB error --- qtd = 800BC800
  34. qtd:800BC800, next:800BCE80
  35. qTD halt D8148, (0)
  36. get CSW failed - clearing endpoint halt for pipe 0xC0068380
  37. clear_halt!
  38. STS_ERR!!
  39. qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
  40. qTD halt 80008D40, (0)
  41. Attempting to get CSW (2nd try)...
  42. STS_ERR!!
  43. qh_completions - qh = 800BC8C0, info1 = 32002D03, token = D8148
  44. qTD error D8148, (0)
  45. ep13in 3strikes
  46. ehciq.c 421, URB error --- qtd = 800BCE80
  47. qtd:800BCE80, next:800BD380
  48. qTD halt D8148, (0)
  49. get CSW command 2nd try failed - clearing halt for pipe 0xC0068380
  50. clear_halt!
  51. STS_ERR!!
  52. qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
  53. qTD halt 80008D40, (0)
  54. UMAS_BulkReset!
  55. clear_halt!
  56. STS_ERR!!
  57. qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
  58. qTD halt 80008D40, (0)
  59. clear_halt!
  60. UMAS_InvokeTransport - transport indicates transport error
  61. Fixing INQUIRY data to show SCSI rev 2
  62. INQUIRY - command failed!
  63. TEST UNIT READY ==>
  64. STS_ERR!!
  65. qh_completions - qh = 800BC8C0, info1 = 32002D03, token = D8148
  66. qTD error D8148, (0)
  67. ep13in 3strikes
  68. ehciq.c 421, URB error --- qtd = 800BD380
  69. qtd:800BD380, next:800BE680
  70. qTD halt D8148, (0)
  71. get CSW failed - clearing endpoint halt for pipe 0xC0068380
  72. clear_halt!
  73. STS_ERR!!
  74. qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
  75. qTD halt 80008D40, (0)
  76. Attempting to get CSW (2nd try)...
  77. STS_ERR!!
  78. qh_completions - qh = 800BC8C0, info1 = 32002D03, token = D8148
  79. qTD error D8148, (0)
  80. ep13in 3strikes
  81. ehciq.c 421, URB error --- qtd = 800BE680
  82. qtd:800BE680, next:800BEB80
  83. qTD halt D8148, (0)
  84. get CSW command 2nd try failed - clearing halt for pipe 0xC0068380
  85. clear_halt!
  86. STS_ERR!!
  87. qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
  88. qTD halt 80008D40, (0)
  89. UMAS_BulkReset!
  90. clear_halt!
  91. STS_ERR!!
  92. qh_completions - qh = 800B7B40, info1 = 30406003, token = 80008D40
  93. qTD halt 80008D40, (0)
  94. clear_halt!
  95. UMAS_InvokeTransport - transport indicates transport error
  96. TEST_UNIT_READY not UNIT_ATTENTION!
  97. USB Mass Storage support registered.
  98. fsDiskFreeSpace failed!!


 楼主| stone31 发表于 2022-7-11 16:35 | 显示全部楼层
问题暂时解决了,新塘的N9H26_USBH.lib库不能用,具体原因不清楚,解决办法是使用
  1. 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

粉丝
快速回复 在线客服 返回列表 返回顶部