Activating USB in a kernel mode prx (CF 3.52)?

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

Moderators: cheriff, TyRaNiD

Post Reply
sakya
Posts: 190
Joined: Fri Apr 28, 2006 5:48 pm
Contact:

Activating USB in a kernel mode prx (CF 3.52)?

Post by sakya »

Hi! :)

I'm experiencing problems activating usb in a prx (kernel mode) under CF 3.52 update 4.

I've always activated USB with this code (taken from the sdk sample):

Code: Select all

int USBinit(){
    u32 retVal;
    //start necessary drivers
    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");

    //setup USB drivers
    retVal = sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
    if (retVal != 0) {
		return -1;
    }
    retVal = sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
    if (retVal != 0) {
		return -1;
	}
    retVal = sceUsbstorBootSetCapacity(0x800000);
    if (retVal != 0) {
		return -1;
	}
	return 0;
}
and then

Code: Select all

int USBActivate(){
    sceUsbActivate(0x1c8);
    return 0;
}
This code seems to fail in my prx.
The prx doesen't even load and start (returning "Library not found").
The prx loads fine if I comment all the sceUSB* functions.
What's wrong?

Many thanks. :)

Ciaooo
Sakya
septem
Posts: 21
Joined: Wed Aug 29, 2007 7:44 am

Post by septem »

I had the same problem, you need to remove one of the libs that are used in makefile, I guess that was one of -lpspusb... you must try for yourself- delete any that's not necessary to compile.
Post Reply