Hi, > Yes, i see the bad characters in the log file. I apologize for that, > my eyes was in pain after looking thru the log files and did not > notice that when i attached the log file. > > The good news is i can get gadget to work with Lenovo x100e on Ubuntu > and Windows. The change is adding more delay after writing to endpoint > one IN FIFO register, for the case of writing more than the endpoint > buffer size. However, the gadget only work on high-speed mode. If i > disable ehci_hcd driver in Ubuntu (force it to be full speed), the > same problem of SCSI_READ_10 command asking 4096 bytes and gadget > returning the data, and gadget reset, still happens. I can bring up the gadget in full speed mode now, so the SCSI_READ_10 command problem is fixed. It is caused by an error interfacing to hardware. Now there is another problem with SCSI_MODE_SELECT_6 command, when in full speed mode, the data for SCSI_MODE_SELECT_6 command is 72 byte, and somehow the gadget is reset. Is it because gadget is not able to handle the amount of data? Please see the attached gadget log. Normally, in high speed mode, the data of SCSI_MODE_SELECT_6 command is 24 byte. Thanks, victor
g_file_storage gadget: reset config g_file_storage gadget: reset interface g_file_storage gadget: in handle_exception loop g_file_storage gadget: in fsg->running loop g_file_storage gadget: in fsg->running loop g_file_storage gadget: ep0-setup, length 8: 00000000: 80 06 00 01 00 00 40 00 g_file_storage gadget: get device descriptor ept0 in queue len 0x12, buffer 0xc128f800 ep0_complete g_file_storage gadget: ep0-in, length 18: 00000000: 12 01 00 02 00 00 00 40 25 05 a5 a4 33 03 01 02 00000010: 00 01 g_file_storage gadget: disconnect or port reset handle_exception begin handle_exception wait until handle_exception old_state 5 g_file_storage gadget: in handle_exception loop g_file_storage gadget: in fsg->running loop USB_RECIP_DEVICE fa is 0x3 exit A g_file_storage gadget: ep0-setup, length 8: 00000000: 80 06 00 01 00 00 12 00 g_file_storage gadget: get device descriptor exit C ept0 in queue len 0x12, buffer 0xc128f800 ep0_complete g_file_storage gadget: ep0-in, length 18: 00000000: 12 01 00 02 00 00 00 40 25 05 a5 a4 33 03 01 02 00000010: 00 01 g_file_storage gadget: ep0-setup, length 8: 00000000: 80 06 00 02 00 00 09 00 g_file_storage gadget: get configuration descriptor ept0 in queue len 0x9, buffer 0xc128f800 ep0_complete g_file_storage gadget: ep0-in, length 9: 00000000: 09 02 20 00 01 01 04 c0 01 g_file_storage gadget: ep0-setup, length 8: 00000000: 00 09 01 00 00 00 00 00 g_file_storage gadget: set configuration handle_exception begin handle_exception wait until handle_exception old_state 4 g_file_storage gadget: set interface 0 g_file_storage gadget: full-speed config #1 EP1 OUT IRQ 0x28 ept0 in queue len 0x0, buffer 0xc128f800 g_file_storage gadget: in handle_exception loop [start_transfer] 8000000 0 ept1 out queue len 0x40, buffer 0xc1340000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 64 31 EP1 OUT IRQ 0x28 [kagen2_ep_queue] 43425355 87a68008 g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 08 80 a6 87 18 00 00 00 00 00 06 15 00000010: 10 00 00 18 00 00 00 00 00 00 00 00 00 00 00 g_file_storage gadget: SCSI command: MODE SELECT(6); Dc=6, Do=24; Hc=6, Ho=24 attention condition [start_transfer] 43425355 87a68008 ept1 out queue len 0x40, buffer 0xc1340000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 24 64 24 before kagen2_ep_queue g_file_storage gadget: disconnect or port reset after kagen2_ep_queue kagen2_ep_queue 48 64 24 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 72 64 24 [kagen2_ep_queue] 8000000 0 g_file_storage gadget: bulk-out, length 72: 00000000: 00 00 00 08 00 00 00 00 00 00 02 00 08 0a 00 00 00000010: ff ff 00 00 ff ff ff ff 00 00 00 00 00 00 00 5f 00000020: c1 9f 75 00 58 1d 00 00 00 00 00 00 02 00 00 00 00000030: 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00000040: 80 00 29 5f 22 e8 c2 4e g_file_storage gadget: bulk_out_complete --> 0, 72/24 g_file_storage gadget: before calling send_status g_file_storage gadget: sending command-failure status g_file_storage gadget: sense data: SK x06, ASC x29, ASCQ x00; info x0 g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 08 80 a6 87 18 00 00 00 01 [start_transfer] 53425355 87a68008 exit C ept1 in queue len 0xd, buffer 0xc1350000 0: 0x53425355 4: 0x87a68008 8: 0x18 bulk_in_complete --> 0, 13/13 handle_exception begin handle_exception wait until handle_exception old_state 5 g_file_storage gadget: reset config g_file_storage gadget: reset interface g_file_storage gadget: in handle_exception loop g_file_storage gadget: in fsg->running loop g_file_storage gadget: in fsg->running loop g_file_storage gadget: ep0-setup, length 8: 00000000: 80 06 00 01 00 00 40 00 g_file_storage gadget: get device descriptor ept0 in queue len 0x12, buffer 0xc128f800 ep0_complete g_file_storage gadget: ep0-in, length 18: 00000000: 12 01 00 02 00 00 00 40 25 05 a5 a4 33 03 01 02 00000010: 00 01 g_file_storage gadget: disconnect or port reset handle_exception begin handle_exception wait until handle_exception old_state 5 g_file_storage gadget: in handle_exception loop g_file_storage gadget: in fsg->running loop USB_RECIP_DEVICE fa is 0x2 exit A g_file_storage gadget: ep0-setup, length 8: 00000000: 80 06 00 01 00 00 12 00 g_file_storage gadget: get device descriptor exit C ept0 in queue len 0x12, buffer 0xc128f800 ep0_complete g_file_storage gadget: ep0-in, length 18: 00000000: 12 01 00 02 00 00 00 40 25 05 a5 a4 33 03 01 02 00000010: 00 01 g_file_storage gadget: ep0-setup, length 8: 00000000: 80 06 00 02 00 00 09 00 g_file_storage gadget: get configuration descriptor ept0 in queue len 0x9, buffer 0xc128f800 ep0_complete g_file_storage gadget: ep0-in, length 9: 00000000: 09 02 20 00 01 01 04 c0 01 g_file_storage gadget: ep0-setup, length 8: 00000000: 00 09 01 00 00 00 00 00 g_file_storage gadget: set configuration handle_exception begin handle_exception wait until handle_exception old_state 4 g_file_storage gadget: set interface 0 g_file_storage gadget: full-speed config #1 EP1 OUT IRQ 0x28 ept0 in queue len 0x0, buffer 0xc128f800 g_file_storage gadget: in handle_exception loop [start_transfer] 8000000 0 ept1 out queue len 0x40, buffer 0xc1340000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 31 64 31 [kagen2_ep_queue] 43425355 899de008 g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 08 e0 9d 89 18 00 00 00 00 00 06 15 00000010: 10 00 00 18 00 00 00 00 00 00 00 00 00 00 00 EP1 OUT IRQ 0x28 g_file_storage gadget: SCSI command: MODE SELECT(6); Dc=6, Do=24; Hc=6, Ho=24 attention condition [start_transfer] 43425355 899de008 ept1 out queue len 0x40, buffer 0xc1340000 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 24 64 24 before kagen2_ep_queue g_file_storage gadget: disconnect or port reset after kagen2_ep_queue kagen2_ep_queue 48 64 24 before kagen2_ep_queue after kagen2_ep_queue kagen2_ep_queue 72 64 24 [kagen2_ep_queue] 8000000 0 g_file_storage gadget: bulk-out, length 72: 00000000: 00 00 00 08 00 00 00 00 00 00 02 00 08 0a 00 00 00000010: ff ff 00 00 ff ff ff ff 00 00 00 00 00 00 00 a7 00000020: c1 9f 75 00 58 1d 00 00 00 00 00 00 02 00 00 00 00000030: 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00000040: 80 00 29 5f 22 e8 c2 4e g_file_storage gadget: bulk_out_complete --> 0, 72/24 g_file_storage gadget: before calling send_status g_file_storage gadget: sending command-failure status g_file_storage gadget: sense data: SK x06, ASC x29, ASCQ x00; info x0 g_file_storage gadget: bulk-in, length 13: 00000000: 55 53 42 53 08 e0 9d 89 18 00 00 00 01 [start_transfer] 53425355 899de008 exit C ept1 in queue len 0xd, buffer 0xc1350000 0: 0x53425355 4: 0x899de008 8: 0x18 bulk_in_complete --> 0, 13/13