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 

Issues with USB - help!!!

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



Joined: 05 Jul 2005
Posts: 29

PostPosted: Tue Jul 03, 2007 6:38 pm    Post subject: Issues with USB - help!!! Reply with quote

I've been going crazy trying to setup USB to work in my PRX.

This is from the PSPSDK samples:
Code:

void usbEnable()
{
  //Setup USB
  LoadStartModule("flash0:/kd/semawm.prx");
  LoadStartModule("flash0:/kd/usbstor.prx");
  LoadStartModule("flash0:/kd/usbstormgr.prx");
  LoadStartModule("flash0:/kd/usbstorms.prx");
  LoadStartModule("flash0:/kd/usbstorboot.prx");
 
   //return;

   if ( sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0 ) != 0 )
   {
      sysUsb=0; return;
   }
   if ( sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0 ) != 0 )
   {
      sysUsb=0; return;
   }

   if ( sceUsbstorBootSetCapacity( 0x800000 ) != 0 )
   {
      sysUsb=0; return;
   }
 
  sceUsbActivate( 0x1c8 );
}


For some reason, sceUsb* functions cause my PRX to "stop working"
1) In my code, I don't even call usbEnable and it causes my PRX to stop from loading
2) So if I just link the function without using it - it still stops the PRX
3) BUT, if I put a "return;" right before the 'if (sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0 ) != 0 )', the damn thing compiles and runs fine - even though I don't call usbEnable from anywhere!

It's not a stack problem - it has to do with the sceUsb* functions - if I use them, the damn PRX fails to start.

I've included the pspusb.h and pspusbstor.h files
And yes I've linked the needed libs:
LIBS = -lpspchnnlsv -lpsputility -lpspdebug -lpspge_driver -lpspwlan -lpspumd -lpspusb -lpspusbstor
LDFLAGS = -nostdlib -nodefaultlibs

I've ran the thing in PSPLink and the funny part was - that it ran just fine.
But then I run it as a plugin in custom firmware 3.40 OE and BOOM =/

Any ideas?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP 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