libaums icon indicating copy to clipboard operation
libaums copied to clipboard

Wrong CSW status

Open MaartenStottelaar opened this issue 7 years ago • 10 comments

Some USB devices seem to return an invalid CSW status, even when the operation apears to be correct. If I return TRUE in cases where csw.getbCswStatus== 1 in "transferCommand" (line 134) with these USB devices, the data transfer seems to be OK. For now I ignore csw.getbCswStatus== 1, but like to solve this problem.

Maarten

MaartenStottelaar avatar Dec 17 '17 17:12 MaartenStottelaar

Hey there,

and sorry for the late response.

Thanks for this information, I never had this problem, to be honest. Can you maybe elaborate a little which phone and pen drive you use? Is there a pattern?

magnusja avatar Dec 29 '17 06:12 magnusja

Dear Magnusja,

I am running the code on a Enybox 'Android box' with Android 6 (I tried several pieces). It seems that about 50% of the USB sticks do not work, but I have at least one official Sandisk 32G that works fine. I also noticed that (smaller) FAT formatted devices do not work, but that can of course eailly be solved.

Maarten

MaartenStottelaar avatar Dec 31 '17 13:12 MaartenStottelaar

Thanks for solving my problem.

PMMKing avatar Feb 02 '18 06:02 PMMKing

Hi, I have the same problem now, ScsiInquiryResponse [peripheralQualifier=0, peripheralDeviceType=0, removableMedia=false, spcVersion=2, responseDataFormat=2] java.io.IOException: Unsuccessful Csw status: 1

dandan8936 avatar Jun 07 '18 07:06 dandan8936

I get this error when i setupDevice() as in your MainActivity code, it happens to me with 2 usb different sticks, both fat 32 and mbr. 06:11:09.200 2229-2229/com.usb E/2: error setting up device java.io.IOException: Unsuccessful Csw status: 1 at com.github.mjdev.libaums.driver.scsi.ScsiBlockDevice.transferCommand(ScsiBlockDevice.java:185) at com.github.mjdev.libaums.driver.scsi.ScsiBlockDevice.init(ScsiBlockDevice.java:98) at com.github.mjdev.libaums.UsbMassStorageDevice.setupDevice(UsbMassStorageDevice.java:232) at com.github.mjdev.libaums.UsbMassStorageDevice.init(UsbMassStorageDevice.java:192) i always get same error with some usb sticks

Please help

alVal6 avatar Jul 20 '18 06:07 alVal6

Hi!, i solved the problem, just need a delay before calling discover function and all usb sticks work.

alVal6 avatar Jul 20 '18 10:07 alVal6

Hi there! I sleep the thread 1 second before i call device.init(); and it works!

RandallXia avatar Aug 03 '18 07:08 RandallXia

Nice!!! its great to hear it, you can try timer Countdown in order to avoid sleeping the thread

alVal6 avatar Aug 03 '18 07:08 alVal6

I'm still getting this. The 1 second sleep doesn't help.

bealebe avatar Oct 25 '18 19:10 bealebe

Try with 3 seconds delay

[https://ci3.googleusercontent.com/proxy/GYeW-WfXrv_SHe0fBJj--7wGxKXhXu22PUhEGDHeEPu98HxeGrUyMeXjFyLdSYJTwwajU6av-6Y9Fw=s0-d-e1-ft#http://bizintek.es/logo-bizintek.png]

C/ Nemesio Mogrobejo 9A 48015 - Bilbao (Vizcaya) Tel: +34 94 437 26 96 Fax: +34 94 434 47 05 www.bizintek.eshttp://www.bizintek.es/ Álvaro Valtierra De Pablo Firmware Engineer

[email protected]mailto:[email protected]

[https://ci4.googleusercontent.com/proxy/iN-a4agKdd_Pwr0dNwJWrzAozdp2wO52fOLxMKG7ANaQPfRy5EglRL8zAbD_oS4=s0-d-e1-ft#http://bizintek.es/bg.png]


De: Bryan E Beale [email protected] Enviado: jueves, 25 de octubre de 2018 21:38:00 Para: magnusja/libaums Cc: Alvaro Valtierra; Comment Asunto: Re: [magnusja/libaums] Wrong CSW status (#124)

I'm still getting this. The 1 second sleep doesn't help.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/magnusja/libaums/issues/124#issuecomment-433178835, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AnixcmGtKmoKiNBLONtkACmA6GtnX1Nnks5uohMYgaJpZM4REueP.

alVal6 avatar Nov 06 '18 13:11 alVal6