I'm working on custom firmware HAL for Nanodesktop.
So, when I try to use sceUsbStart, the homebrew is terminated
by the VSH with an error code 8002013C
The firmware is version 3.77 M33-4 on PSP-SLIM.
Why ?
The NIDs for USB functions have been changed ?
sceUsbStart on custom firmware 3.71
Re: sceUsbStart on custom firmware 3.71
I trust you're not simply calling sceUsbStart();? :Dpegasus2000 wrote:I'm working on custom firmware HAL for Nanodesktop.
So, when I try to use sceUsbStart, the homebrew is terminated
by the VSH with an error code 8002013C
The firmware is version 3.77 M33-4 on PSP-SLIM.
Why ?
The NIDs for USB functions have been changed ?
See the example in Cygwin\usr\local\pspdev\psp\sdk\samples\usb\storage (If you're using CYGWIN) on how to properly start USB.
Re: sceUsbStart on custom firmware 3.71
Hi! :)
This works for me with kernel 3.71.
usb.c
usb.h
Ciaooo
Sakya
This works for me with kernel 3.71.
usb.c
Code: Select all
#include <pspkernel.h>
#include <pspusb.h>
#include <pspusbstor.h>
#include <kubridge.h>
SceUID modules[7];
//Init USB:
int LoadStartModule(char *path)
{
u32 loadResult;
u32 startResult;
int status;
loadResult = kuKernelLoadModule(path, 0, NULL);
if (loadResult & 0x80000000){
return -1;
}else{
startResult = sceKernelStartModule(loadResult, 0, NULL, &status, NULL);
}
if (loadResult != startResult){
return -2;
}
return 0;
}
int StopUnloadModule(SceUID modID){
int status;
sceKernelStopModule(modID, 0, NULL, &status, NULL);
sceKernelUnloadModule(modID);
return 0;
}
int USBinit(){
u32 retVal;
//start necessary drivers
modules[0] = LoadStartModule("flash0:/kd/chkreg.prx");
modules[1] = LoadStartModule("flash0:/kd/npdrm.prx");
modules[2] = LoadStartModule("flash0:/kd/semawm.prx");
modules[3] = LoadStartModule("flash0:/kd/usbstor.prx");
modules[4] = LoadStartModule("flash0:/kd/usbstormgr.prx");
modules[5] = LoadStartModule("flash0:/kd/usbstorms.prx");
modules[6] = LoadStartModule("flash0:/kd/usbstorboot.prx");
//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;
}
int USBActivate(){
sceUsbActivate(0x1c8);
return 0;
}
int USBDeactivate(){
sceUsbDeactivate(0x1c8);
sceIoDevctl("fatms0:", 0x0240D81E, NULL, 0, NULL, 0 ); //Avoid corrupted files
return 0;
}
int USBEnd(){
int i;
sceUsbStop(PSP_USBSTOR_DRIVERNAME, 0, 0);
sceUsbStop(PSP_USBBUS_DRIVERNAME, 0, 0);
for (i=0; i<7; i++){
StopUnloadModule(modules[i]);
}
return 0;
}
Code: Select all
int USBinit();
int USBActivate();
int USBDeactivate();
int USBEnd();
Sakya