Problem with usb libraries

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
kecC
Posts: 17
Joined: Mon Jul 04, 2005 11:07 pm

Problem with usb libraries

Post by kecC »

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!
Warren
Posts: 175
Joined: Sat Jan 24, 2004 8:26 am
Location: San Diego, CA

Post by Warren »

Look at the usb/storage sample
kecC
Posts: 17
Joined: Mon Jul 04, 2005 11:07 pm

Post by kecC »

where can i look that?

Thanks
Arwin
Posts: 426
Joined: Tue Jul 12, 2005 7:00 pm

Post by Arwin »

kecC wrote:where can i look that?

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

(or http://svn.pspdev.org/listing.php?repna ... rev=0&sc=0 to go to the samples directly)
kecC
Posts: 17
Joined: Mon Jul 04, 2005 11:07 pm

Post by kecC »

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

Code: Select all

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]
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

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

Jim
kecC
Posts: 17
Joined: Mon Jul 04, 2005 11:07 pm

Post by kecC »

I've done that, and it continues says me the same. :S
apache37
Posts: 76
Joined: Fri Jun 04, 2004 3:13 pm

Post by apache37 »

Paste your makefile here
kecC
Posts: 17
Joined: Mon Jul 04, 2005 11:07 pm

Post by kecC »

Code: Select all

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
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Should be

Code: Select all

LIBS = -lpspusb -lpspusbstor 
LIBDIR =
Jim
kecC
Posts: 17
Joined: Mon Jul 04, 2005 11:07 pm

Post by kecC »

if I put that, it says me:

Code: Select all

/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.
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

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
kecC
Posts: 17
Joined: Mon Jul 04, 2005 11:07 pm

Post by kecC »

I only have 6 :S.

Where can i get them?
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

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
2Xtremes2004
Posts: 53
Joined: Wed Aug 31, 2005 1:43 am

Post by 2Xtremes2004 »

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!?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

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?repna ... =1882&sc=1
Update your pspsdk and it should be ok.
Post Reply