forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems with usb_mass

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
raipsu



Joined: 25 Oct 2004
Posts: 6

PostPosted: Mon Nov 01, 2004 2:00 am    Post subject: Problems with usb_mass Reply with quote

Hi!

I have been trying to use usb_mass without success. I have a Transcend 256MB JetFlash. I'm trying to test with mass_example.elf. It jams when trying to read directory listing. I added some XPRINTFs to the iop mass_stor.c and noticed that it jams when usb_bulk_status() is calling WaitSema(). I have tested with usbd.irx from a demo disc and npm-usbd.irx.

Output when executing mass_example.elf, debug messages turned on in usb_mass.irx:

Code:

# ps2client execee host:mass_example.elf
loadelf: fname host:mass_example.elf secname all
Input ELF format filename = host:mass_example.elf
0 00100000 00006f28 .
Loaded, host:mass_example.elf
start address 0x100008
gp address 00000000
loadmodule: fname rom0:SIO2MAN args 0 arg
loadmodule: id 34, ret 1
loadmodule: fname rom0:PADMAN args 0 arg
Pad driver. (99/11/22)
loadmodule: id 35, ret 0
loadmodule: fname mc0:/BOOT/usbd.irx args 0 arg
USB Driver (Version 0.14.0 Tue Sep 19 10:51:41 JST 2000)
loadmodule: id 36, ret 0
usbd.irx ok  ret=36
loadmodule: fname host:../iop/usb_mass.irx args 0 arg
usb_mass: version 0.22
mass_stor: registerDriver=0
loadmodule: id 37, ret 0
usbtest.irx ok. ret=37
okusb_mass: connect: devId=1
register Intput endpoint id =1 addr=81 packetSize=64
register Output endpoint id =2 addr=02 packetSize=64
usb_mass: connect ok: epI=1, epO=2
DIRECTORY LIST -------------- mass_stor: getting status...
wait reset semaId=24516449
Usb - callback: res 0, bytes 0, arg 1761761
wait clear halt semaId=24516451
Usb - callback: res 0, bytes 0, arg 1761763
setting configuration controlEp=0, confNum=1
Waiting for config done...
Usb - callback: res 0, bytes 0, arg 1761765
mass_stor: warm up called !
-INQUIRY
Usb - callback: res 0, bytes 31, arg 1761767
-INQUIRY READ DATA
Usb - callback: res 8, bytes 0, arg 1761769
 retCode=8 retSize=0
-INQUIRY STATUS
...waiting for status 1 ...
usbbulktransfer..
usbbulktransfer done.. (0)
USB: WaitSema..

It jams here. If I'll remove the usb stick, it will (sometimes) continue:
Code:

Usb - callback: res 5, bytes 0, arg 176176b
USB: WaitSema done..
Usb: bulk csw.status: 0
buld done 0

Inquiry data
usb_mass: disconnect: devId=1
usb_mass: disconnect ok.
------------
Vendor   : JetFlash
Prod id  :TS256MJF2A
Prod rev :1.00
-START COMMAND
Usb: Error sending bulk command
-START COMMAND STATUS
...waiting for status 1 ...
usbbulktransfer..
usbbulktransfer done.. (258)
Usb: Error sending csw bulk command
buld done -1

Is there something that could be done? Or will I just buy another usb-stick for PS2? :)
Back to top
View user's profile Send private message
raipsu



Joined: 25 Oct 2004
Posts: 6

PostPosted: Mon Nov 01, 2004 4:08 am    Post subject: Reply with quote

I commented this line from mass_stor_warmup():

usb_bulk_manage_status(dev, -TAG_INQUIRY);

and from usb_bulk_manage_status():

usb_bulk_reset(dev, 1); /* Perform reset recovery */

Now it seems to work just fine. :) Maybe my stick is non-standard or the warmup sequence is incorrect? More error handling should be added.. Seems that UsbBulkTransfer() does not necessary ever call usb_callback() functions. Some timeout should be added?
Back to top
View user's profile Send private message
raipsu



Joined: 25 Oct 2004
Posts: 6

PostPosted: Mon Nov 01, 2004 6:45 am    Post subject: usb_mass fioDopen() etc. Reply with quote

I added fioDopen(), fioDclose(), fioDread() and fioGetStat() support to usb_mass. Here's the patch:

http://ruoho.org/ps2/usb_mass_dopen_patch.diff
Back to top
View user's profile Send private message
ole



Joined: 08 May 2004
Posts: 92
Location: Czech Republic

PostPosted: Wed Nov 03, 2004 12:00 am    Post subject: Reply with quote

Quote:
Is there something that could be done? Or will I just buy another usb-stick for PS2? :)

The warmup content is experimental, it is quite possible it will not work for all devices. You can try to find more reliable warmup sequence.

I've experienced lock-ups of the usb part when the debugging printf are used. When the printfs are removed then program works (most of the time :-) fine.

Thanks for the diff, I will update the sources soon.
Back to top
View user's profile Send private message
jum



Joined: 06 Apr 2004
Posts: 38
Location: Cape Town

PostPosted: Wed Nov 03, 2004 7:00 pm    Post subject: Reply with quote

I also had the lockup problem with my Transcend 128MB stick.

Looking forward to using usb_mass in one of my projects :)

- Jum
_________________
8 bits is all you'll ever need...
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group