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 

Problem with usb libraries

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



Joined: 04 Jul 2005
Posts: 17

PostPosted: Fri Jul 29, 2005 1:47 am    Post subject: Problem with usb libraries Reply with quote

Hi.

I'm trying to make a homebrew to connect my PSP to the PC, but I dont know very sure how I have to do it.

There are 4 functions in pspusb.h -> sceUsbStart(); sceUsbStop(); sceUsbActivate(); sceUsbDeactivate();

How I have to use them to connect my PSP to PC? In the homebrew i've done a code that when you push CIRCLE usb have to connect to PC, and when you push TRIANGLE usb disconnect from the PC.

Anyone can help me please?

Thanks for all!
Back to top
View user's profile Send private message
Warren



Joined: 24 Jan 2004
Posts: 173
Location: San Diego, CA

PostPosted: Fri Jul 29, 2005 2:46 am    Post subject: Reply with quote

Look at the usb/storage sample
Back to top
View user's profile Send private message
kecC



Joined: 04 Jul 2005
Posts: 17

PostPosted: Fri Jul 29, 2005 6:24 am    Post subject: Reply with quote

where can i look that?

Thanks
Back to top
View user's profile Send private message
Arwin



Joined: 12 Jul 2005
Posts: 426

PostPosted: Fri Jul 29, 2005 6:27 am    Post subject: Reply with quote

kecC wrote:
where can i look that?

Thanks


that would be http://svn.pspdev.org ...

(or http://svn.pspdev.org/listing.php?repname=psp&path=%2Ftrunk%2Fpspsdk%2Fsdk%2Fsamples%2F&rev=0&sc=0 to go to the samples directly)
Back to top
View user's profile Send private message
kecC



Joined: 04 Jul 2005
Posts: 17

PostPosted: Fri Jul 29, 2005 8:54 am    Post subject: Reply with quote

I've looked the sample and I've done my file, but when i'm going to compile it, it says me:

Code:

main.o: In function 'main':
main.c:(.text+0x1f8): undefined reference to 'sceUsbStart'
main.c:(.text+0x214): undefined reference to 'sceUsbStart'
main.c:(.text+0x224): undefined reference to 'sceUsbstorBootSetCapacity'
main.c:(.text+0x248): undefined reference to 'sceUsbGetState'
main.c:(.text+0x29c): undefined reference to 'sceUsbDeactivate'
main.c:(.text+0x2c0): undefined reference to 'sceUsbGetState'
main.c:(.text+0x2f8): undefined reference to 'sceUsbActivate'
collect2: ld returned 1 exit status
make: *** [usbstorage.elf] Error 1


That seems like if the usb functiones there wouldn't be defined, but the includes to pspusb.h and pspusbstor.h are OK.

Anyone can help me, i'm very lose :S:S.

Thanks!
Bye.[/code]
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Fri Jul 29, 2005 9:02 am    Post subject: Reply with quote

You have to add the libraries 'pspusb' and 'pspusbstor' to your makefile.

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
kecC



Joined: 04 Jul 2005
Posts: 17

PostPosted: Fri Jul 29, 2005 9:52 am    Post subject: Reply with quote

I've done that, and it continues says me the same. :S
Back to top
View user's profile Send private message
apache37



Joined: 04 Jun 2004
Posts: 76

PostPosted: Fri Jul 29, 2005 9:53 am    Post subject: Reply with quote

Paste your makefile here
Back to top
View user's profile Send private message
kecC



Joined: 04 Jul 2005
Posts: 17

PostPosted: Fri Jul 29, 2005 10:02 am    Post subject: Reply with quote

Code:
TARGET = usbstorage
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR = -lpspusb -lpspusbstor
LDFLAGS =

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Fri Jul 29, 2005 2:46 pm    Post subject: Reply with quote

Should be
Code:

LIBS = -lpspusb -lpspusbstor
LIBDIR =


Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
kecC



Joined: 04 Jul 2005
Posts: 17

PostPosted: Fri Jul 29, 2005 8:21 pm    Post subject: Reply with quote

if I put that, it says me:

Code:
/cygdrive/c/PSPDev/bin/../lib/gcc/psp/4.0.0/../../../../psp/bin/ld: cannot find -lpspusb
collect2: ld returned 1 exit status
make: *** [usbstorage.elf] Error 1


Do I need any other library?
I only have pspusb.h and pspsubstor.h in the dir of psp libraries.

Thanks.
Bye.
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Fri Jul 29, 2005 8:45 pm    Post subject: Reply with quote

In the lib folder you should have about 20 files that are named 'libpspXYZ.a' This is where libpspusb.a and libpspusbstor.a live.

In the include folder parallel to that you should have a load of .h files.

I can tell you've not updated your toolchain very recently too.

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
kecC



Joined: 04 Jul 2005
Posts: 17

PostPosted: Fri Jul 29, 2005 9:10 pm    Post subject: Reply with quote

I only have 6 :S.

Where can i get them?
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Fri Jul 29, 2005 9:17 pm    Post subject: Reply with quote

All the information you seek is on the Wiki.
http://wiki.ps2dev.org/psp:toolchain
You really should read it and try to keep up to date. The PSPSDK changes daily.

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
2Xtremes2004



Joined: 31 Aug 2005
Posts: 53

PostPosted: Tue Jun 06, 2006 8:37 am    Post subject: Reply with quote

I keep getting the following error when I try to compile the usb sample code that comes with the pspsdk:

error: too few arguments to function 'sceUsbDeactivate'

Can anyone spare a few moments to help me, Thanks.
_________________
I want my money back!?
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Tue Jun 06, 2006 8:48 am    Post subject: Reply with quote

2Xtremes2004 wrote:
I keep getting the following error when I try to compile the usb sample code that comes with the pspsdk:

error: too few arguments to function 'sceUsbDeactivate'

This was fixed in revision 1882:
http://svn.pspdev.org/listing.php?repname=psp&path=%2Ftrunk%2F&rev=1882&sc=1
Update your pspsdk and it should be ok.
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