Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong CSW status #124

Open
MaartenStottelaar opened this issue Dec 17, 2017 · 10 comments
Open

Wrong CSW status #124

MaartenStottelaar opened this issue Dec 17, 2017 · 10 comments

Comments

@MaartenStottelaar
Copy link

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

@magnusja
Copy link
Owner

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?

@MaartenStottelaar
Copy link
Author

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

@PMMKing
Copy link

PMMKing commented Feb 2, 2018

Thanks for solving my problem.

@dandan8936
Copy link

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

@alVal6
Copy link

alVal6 commented Jul 20, 2018

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
Copy link

alVal6 commented Jul 20, 2018

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

@RandallXia
Copy link

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

@alVal6
Copy link

alVal6 commented Aug 3, 2018

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

@bealebe
Copy link

bealebe commented Oct 25, 2018

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

@alVal6
Copy link

alVal6 commented Nov 6, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants