저는 SOC 플랫폼에서 u-boot(2013-07)를 부트로더로 사용하여 임베디드 Linux 시스템에서 작업하고 있습니다. 이제 u-boot에서 USB 디스크를 지원하려고 하므로 일부 포팅과 하드웨어 구성을 수행했습니다.
나생각하다usb start
u-boot는 USB 플래시 드라이브를 감지할 수 있지만 명령줄에서 실행할 때 오류가 발생합니다.
오류에 대한 자세한 정보를 얻기 위해 DEBUG 및 BBB_XPORT_TRACE를 활성화했는데 common/usb_storage.c
오류가 발생했습니다(이 SOC의 CACHELINE_SIZE는 32입니다).
0# usb start
(Re)start USB...
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... i=0
i=1
USB Mass Storage device detected
Transport: Bulk/Bulk/Bulk
Endpoints In 1 Out 2 Int 0
Get Max LUN -> len = 1, result = 0
address 2
COMMAND phase
dir 1 lun 0 cmdlen 12 cmd 83faf2a0 datalen 36 pdata 83b4a000
cmd[0] 0x12 cmd[1] 0x0 cmd[2] 0x0 cmd[3] 0x0 cmd[4] 0x24 cmd[5] 0x0 cmd[6] 0x0 cmd[7] 0x0 cmd[8] 0x0 cmd[9] 0x0 cmd[10] 0x0 cmd[11] 0x0
DATA phase
pdata[0] 0x0 pdata[1] 0x80 pdata[2] 0x6 pdata[3] 0x12 pdata[4] 0x43 pdata[5] 0x0 pdata[6] 0x0 pdata[7] 0x0 pdata[8] 0x53 pdata[9] 0x61 pdata[10] 0x6e pdata[11] 0x44 pdata[12] 0x69 pdata[13] 0x73 pdata[14] 0x6b pdata[15] 0x0 pdata[16] 0x43 pdata[17] 0x72 pdata[18] 0x75 pdata[19] 0x7a pdata[20] 0x65 pdata[21] 0x72 pdata[22] 0x20 pdata[23] 0x42 pdata[24] 0x6c pdata[25] 0x61 pdata[26] 0x64 pdata[27] 0x65 pdata[28] 0x0 pdata[29] 0x0 pdata[30] 0x0 pdata[31] 0x0 pdata[32] 0x31 pdata[33] 0x2e pdata[34] 0x30 pdata[35] 0x30
STATUS phase
ptr[0] 0x0 ptr[1] 0x80 ptr[2] 0x6 ptr[3] 0x12 ptr[4] 0x43 ptr[5] 0x0 ptr[6] 0x0 ptr[7] 0x0 ptr[8] 0x53 ptr[9] 0x61 ptr[10] 0x6e ptr[11] 0x44 ptr[12] 0x69
XXXXXXXXXXXx csw@83b49f80, CSWSig = 0x12068000, result: 0
!CSWSIGNATURE
BBB_reset
BBB_reset result 0: status 0 reset
BBB_reset result 0: status 0 clearing IN endpoint
BBB_reset result 0: status 0 clearing OUT endpoint
BBB_reset done
inquiry returns -1
COMMAND phase
dir 1 lun 0 cmdlen 12 cmd 83faf2a0 datalen 36 pdata 83b4a000
cmd[0] 0x12 cmd[1] 0x0 cmd[2] 0x0 cmd[3] 0x0 cmd[4] 0x24 cmd[5] 0x0 cmd[6] 0x0 cmd[7] 0x0 cmd[8] 0x0 cmd[9] 0x0 cmd[10] 0x0 cmd[11] 0x0
DATA phase
usb_bulk_msg error status 0
BBB_reset
BBB_reset result -1: status 0 reset
BBB_reset result -1: status 0 clearing IN endpoint
BBB_reset result -1: status 0 clearing OUT endpoint
BBB_reset done
inquiry returns -1
COMMAND phase
dir 1 lun 0 cmdlen 12 cmd 83faf2a0 datalen 36 pdata 83b4a000
cmd[0] 0x12 cmd[1] 0x0 cmd[2] 0x0 cmd[3] 0x0 cmd[4] 0x24 cmd[5] 0x0 cmd[6] 0x0 cmd[7] 0x0 cmd[8] 0x0 cmd[9] 0x0 cmd[10] 0x0 cmd[11] 0x0
usb_stor_BBB_comdat:usb_bulk_msg error
failed to send CBW status 0
BBB_reset
BBB_reset result -1: status 0 reset
BBB_reset result -1: status 0 clearing IN endpoint
BBB_reset result -1: status 0 clearing OUT endpoint
BBB_reset done
inquiry returns -1
COMMAND phase
dir 1 lun 0 cmdlen 12 cmd 83faf2a0 datalen 36 pdata 83b4a000
cmd[0] 0x12 cmd[1] 0x0 cmd[2] 0x0 cmd[3] 0x0 cmd[4] 0x24 cmd[5] 0x0 cmd[6] 0x0 cmd[7] 0x0 cmd[8] 0x0 cmd[9] 0x0 cmd[10] 0x0 cmd[11] 0x0
usb_stor_BBB_comdat:usb_bulk_msg error
failed to send CBW status 0
BBB_reset
BBB_reset result -1: status 0 reset
BBB_reset result -1: status 0 clearing IN endpoint
BBB_reset result -1: status 0 clearing OUT endpoint
BBB_reset done
inquiry returns -1
COMMAND phase
dir 1 lun 0 cmdlen 12 cmd 83faf2a0 datalen 36 pdata 83b4a000
cmd[0] 0x12 cmd[1] 0x0 cmd[2] 0x0 cmd[3] 0x0 cmd[4] 0x24 cmd[5] 0x0 cmd[6] 0x0 cmd[7] 0x0 cmd[8] 0x0 cmd[9] 0x0 cmd[10] 0x0 cmd[11] 0x0
usb_stor_BBB_comdat:usb_bulk_msg error
failed to send CBW status 0
BBB_reset
BBB_reset result -1: status 0 reset
BBB_reset result -1: status 0 clearing IN endpoint
BBB_reset result -1: status 0 clearing OUT endpoint
BBB_reset done
inquiry returns -1
error in inquiry
i=2
0 Storage Device(s) found
scanning usb for video devices... 0 Video Device(s) found
usb info
다음과 같이 표시됩니다 .
# usb info
1: Hub, USB Revision 1.10
- U-Boot Root Hub
- Class: Hub
- PacketSize: 8 Configurations: 1
- Vendor: 0x0000 Product 0x0000 Version 0.0
Configuration: 1
- Interfaces: 1 Self Powered 0mA
Interface: 0
- Alternate Setting 0, Endpoints: 1
- Class Hub
- Endpoint 1 In Interrupt MaxPacket 2 Interval 255ms
2: Mass Storage, USB Revision 2.0
- SanDisk Cruzer Blade 040172060905221??653
- Class: (from Interface) Mass Storage
- PacketSize: 64 Configurations: 1
- Vendor: 0x0781 Product 0x5567 Version 1.0
Configuration: 1
- Interfaces: 1 Bus Powered 200mA
Interface: 0
- Alternate Setting 0, Endpoints: 2
- Class Mass Storage, Transp. SCSI, Bulk only
- Endpoint 1 In Bulk MaxPacket 512
- Endpoint 2 Out Bulk MaxPacket 512
1000ms 지연을 추가하려고 시도했지만 usb_stor_BBB_transport()
효과가 없었습니다.
저는 U-boot의 USB 스택을 처음 사용하는데, 이 오류의 가능한 원인은 무엇입니까? 문제를 해결하려면 어떻게 해야 하나요?
작동 중인 SOC의 로그로 업데이트
유사한 SOC에서 u-boot 코드베이스를 시도했는데 작동합니다. 다음 로그를 얻었 usb start
는데 그러한 오류가 없습니다 . STATUS phase
즉, 오류가 발생하지 않습니다 CSWSIGNATURE
.
USB0: scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... i=0
i=1
USB Mass Storage device detected
Transport: Bulk/Bulk/Bulk
Endpoints In 1 Out 2 Int 0
Get Max LUN -> len = 1, result = 0
address 2
COMMAND phase
dir 1 lun 0 cmdlen 12 cmd 87faba20 datalen 36 pdata 86efb000
cmd[0] 0x12 cmd[1] 0x0 cmd[2] 0x0 cmd[3] 0x0 cmd[4] 0x24 cmd[5] 0x0 cmd[6] 0x0 cmd[7] 0x0 cmd[8] 0x0 cmd[9] 0x0 cmd[10] 0x0 cmd[11] 0x0
DATA phase
pdata[0] 0x0 pdata[1] 0x80 pdata[2] 0x6 pdata[3] 0x12 pdata[4] 0x43 pdata[5] 0x0 pdata[6] 0x0 pdata[7] 0x0 pdata[8] 0x53 pdata[9] 0x61 pdata[10] 0x6e pdata[11] 0x44 pdata[12] 0x69 pdata[13] 0x73 pdata[14] 0x6b pdata[15] 0x0 pdata[16] 0x43 pdata[17] 0x72 pdata[18] 0x75 pdata[19] 0x7a pdata[20] 0x65 pdata[21] 0x72 pdata[22] 0x20 pdata[23] 0x42 pdata[24] 0x6c pdata[25] 0x61 pdata[26] 0x64 pdata[27] 0x65 pdata[28] 0x0 pdata[29] 0x0 pdata[30] 0x0 pdata[31] 0x0 pdata[32] 0x31 pdata[33] 0x2e pdata[34] 0x30 pdata[35] 0x30
STATUS phase
ptr[0] 0x55 ptr[1] 0x53 ptr[2] 0x42 ptr[3] 0x53 ptr[4] 0x0 ptr[5] 0x0 ptr[6] 0x0 ptr[7] 0x0 ptr[8] 0x0 ptr[9] 0x0 ptr[10] 0x0 ptr[11] 0x0 ptr[12] 0x0
XXXXXXXXXXXx csw@86efaf80, CSWSig = 0x53425355, result: 0
inquiry returns 0