USB problem, please help. :)

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:

USB problem, please help. :)

Post by sakya »

Hi! :)

I'm experiencing problems enabling the usb in a kernel 3.52 app.
First I had problem loading the usbstorms.prx (with the code from the sdk's sample) and I fixed it using pspSdkLoadStartModule.

Now is the last prx that fails to load (giving error 800213C) usbstorboot.prx
This way it fails also the sceUsbstorBootSetCapacity() call.
When I call sceUsbActivate() Windows detects the new hardware but I cannot see the new drive...

Here's my code:

Code: Select all

//Init USB:
int USBinit(){
	u32 retVal;

    //start necessary drivers
    pspSdkLoadStartModule("flash0:/kd/semawm.prx", PSP_MEMORY_PARTITION_KERNEL);
    pspSdkLoadStartModule("flash0:/kd/usbstor.prx", PSP_MEMORY_PARTITION_KERNEL);
    pspSdkLoadStartModule("flash0:/kd/usbstormgr.prx", PSP_MEMORY_PARTITION_KERNEL);
    pspSdkLoadStartModule("flash0:/kd/usbstorms.prx", PSP_MEMORY_PARTITION_KERNEL);
    pspSdkLoadStartModule("flash0:/kd/usbstorboot.prx", PSP_MEMORY_PARTITION_KERNEL);

    //setup USB drivers
    retVal = sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
    if (retVal != 0) {
		return -6;
    }
    retVal = sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
    if (retVal != 0) {
		return -7;
	}

    retVal = sceUsbstorBootSetCapacity(0x800000);
    if (retVal != 0) {
		return -8;
	}
    return 0;
}
Can someone help me loading this module, please? :)

P.S. If I copy the prx from my flash0 to my ms, then the module starts correctly...

Many thanks.
Ciaooo
Sakya
_.-noel-._
Posts: 49
Joined: Mon Aug 13, 2007 12:57 am

Post by _.-noel-._ »

Delate the

Code: Select all

PSP_MEMORY_PARTITION_KERNEL
may be, then it works....

and, i think,

Code: Select all

return -1
work, too....

not

Code: Select all

return -6;

Code: Select all

return -7;
....

but i'm not sure....
Sry for my english
sakya
Posts: 190
Joined: Fri Apr 28, 2006 5:48 pm
Contact:

Post by sakya »

Hi! :)

Many thanks for your reply.
_.-noel-._ wrote:Delate the

Code: Select all

PSP_MEMORY_PARTITION_KERNEL
may be, then it works....
I'll try this when at home, thanks. ;)
and, i think,

Code: Select all

return -1
work, too....
not

Code: Select all

return -6;

Code: Select all

return -7;
....
but i'm not sure....
?????????
Sorry, I can't understand what you're saying here.
What's the problem with a int function returning -6 or -7?

Ciaooo
Sakya
_.-noel-._
Posts: 49
Joined: Mon Aug 13, 2007 12:57 am

Post by _.-noel-._ »

i dont know...

but i have allways

Code: Select all

return -1
...
have you this code in your app?

Code: Select all

int LoadStartModule(char *path)

{

    u32 loadResult;

    u32 startResult;

    int status;




    loadResult = sceKernelLoadModule(path, 0, NULL);

    if (loadResult & 0x80000000)

        return -1;

    else

        startResult =

            sceKernelStartModule(loadResult, 0, NULL, &status, NULL);



    if (loadResult != startResult)

        return -2;



    return 0;

}
??

when not, try it out...

---
and my code for this is:

Code: Select all

//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) {

        printf("Error.... (0x%08X)\n", retVal);

        sceKernelSleepThread();

    }

    retVal = sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);

    if (retVal != 0) {

        printf("Error.... (0x%08X)\n",

               retVal);

        sceKernelSleepThread();

    }

    retVal = sceUsbstorBootSetCapacity(0x800000);

    if (retVal != 0) {

        printf

            ("Error... (0x%08X)\n",

             retVal);

        sceKernelSleepThread();

    }

    retVal = 0;
i hope it help
Sry for my english
Post Reply