Thursday, October 27, 2011

The PL-2303 code 10 error

Some cheap PL-2303 based USB to serial adapters don't work with new drivers from Prolific. In Windows, Device Manager gives a "This device cannot start. (Code 10)" error. Prolific knows about this error and has a FAQ question about it. To me, the answer there seems to imply that these PL-2303 chips may be counterfeit.

When I ended up with such a bad PL-2303 based  adapter, I investigated the issue using Snoopy Pro. It is a free open source (GPL) program which logs USB communication between the driver and device. SnoopyPro allowed me to see the requests sent by the Prolific driver, and compare responses.

Here is the request sent from Prolific v1417 driver in 32 bit Windows 7 SP1, with version 3.3.17.203 ser2pl.sys:

URB Header (length: 80)
SequenceNumber: 10
Function: 0008 (CONTROL_TRANSFER)
PipeHandle: 00000000

SetupPacket:
0000: c0 01 86 86 00 00 02 00 
bmRequestType: c0
  DIR: Device-To-Host
  TYPE: Vendor
  RECIPIENT: Device
bRequest: 01  

No TransferBuffer

Here is the response from a Dynex DX-UBDB9 adapter, which works perfectly:

URB Header (length: 80)
SequenceNumber: 10
Function: 0008 (CONTROL_TRANSFER)
PipeHandle: a24f2724

SetupPacket:
0000: c0 01 86 86 00 00 02 00 
bmRequestType: c0
  DIR: Device-To-Host
  TYPE: Vendor
  RECIPIENT: Device
bRequest: 01 

TransferBuffer: 0x00000001 (1) length
0000: aa

Finally, here's the response from the BAFO USB to RS232 Converter Adapter that I got from DinoDirect:

URB Header (length: 80)
SequenceNumber: 10
Function: 0008 (CONTROL_TRANSFER)
PipeHandle: 856e8594

SetupPacket:
0000: c0 01 86 86 00 00 02 00 
bmRequestType: c0
  DIR: Device-To-Host
  TYPE: Vendor
  RECIPIENT: Device
bRequest: 01

TransferBuffer: 0x00000001 (1) length
0000: 00

There's one difference: the good adapter responds with 0xAA and the bad adapter responds with zero. The information could be used to find the check in ser2pl.sys and make the driver accept the zero. However, the EULA doesn't allow that. In any case, the adapter from DinoDirect has other problems which cannot be fixed.

3 comments:

phsorx said...

Nice findings! Have you tried patching the driver yet?

There is also a difference between the inf files of the last working prolific 2303 drivers and the new ones that drop code 10 error.

I haven't tried patching the inf files yet though.

Boris Gjenero said...

I was hesitant to discuss patching. Now I'll just say the 0x8686 provides a convenient value to search for.

Bright said...

Didn't patch the driver, but we did create an installer that does most of this for you, including copying over the older ser2pl.sys (or ser2pl64.sys) after the driver install.

http://www.brightledsigns.com/downloads/plclean.exe

Read the license first...goes over what it does.