PS2KBD: Found a keyboard device
PS2KBD: Connected device
PS2KBD - USB Keyboard Library
PS2KEYBOARD: Configuration set error res 290, bytes 0, arg a8700
Maybe there are connection problems:
1. Try to plug it out and reconnect the keyboard.
2. You should only use a USB hub with power supply or connect the keyboard directly to the USB port of the PS2.
There was also a bug in the USB driver (usbd.irx) which could generate such errors, so use a newer USB driver (11.08.2009, SVN rev 1599 or higher)
PS2KBD: Found a keyboard device
PS2KBD: Connected device
PS2KEYBOARD: Configuration set error res 290, bytes 0, arg a8700
PS2KEYBOARD: Data Recv set res 4, bytes 0, arg a8700
The failed call to UsbSetDeviceConfiguration() didn't set the configuration, so every try to use an USB endpoint will stall.
I add here an explanation, because you may to solve the problem by experimenting:
An USB endpoint is a one way pipe to communicate to the USB device. The only way for a device to refuse the communication is to stall. The configuration endpoint 0x00/0x80 is an exception. The endpoint 0x00/0x80 is used to configure the device and is always available. This endpoint allows communication in both directions. The other endpoints need to be activated by selecting a configuration.
The call UsbSetDeviceConfiguration() will activate a configuration. You can ask the device which configuration can be used. The function UsbGetDeviceStaticDescriptor() can read this configuration. I detected that this descriptor is sometimes bad. At least the listed endpoints were mixed up.
So what you can do:
1. Guess the correct configuration number: Replace "conf->bConfigurationValue" in the call to UsbSetDeviceConfiguration() by one number. Normally 1 is working, maybe you will need 2 or 3.
2. Read the configuration number from a working operating system: Connect the keyboard to an Linux and enter the command "lsusb -v" to get all possible configurations. Then look for possible values for bConfigurationValue. You need to select something which supports the boot protocol.
I tried guess the correct configuration number (I checked from 1 to 10) and no luck. Then I launched ubuntu and from there I got bConfigurationValue = 1. Again no luck. There must be something wrong in ps2kbd.irx because my keyboard is working with modules from PS2 game (which aren't usable in homebrew).
Ok, I think the problem is usbd.irx and not ps2kbd.irx, because usbd.irx is responsible for UsbSetDeviceConfiguration. You can try to use a usbd.irx from a PS2 game disc. Some old versions are compatible (at least with ps2kdb.irx). As far as I remember the version included in naplink was working with it. Other USB stuff was not working, but the keyboard.
I've tested usbd.irx from naplink and the same error occurred. Also module taken from ps2 game (where my keyboard works) didn't help. I believe there must be bug in ps2kbd.irx.
I found something in ps2kbd. When I uncomment one line (which is printing configuration value) in src:
The ps2link connection sometimes looses lines if you print too much. You should also modify a printed line to verify that your code reaches the target.