USB Serial CP210x driver

Asked by Nuno Lambuca

I am trying to use CP2104 (Silicon Labs), which should be support by CP210X driver and I am not able to get good baud rate or even to modify it. Bit time 40nS which means really high speed. Using Ubuntu kernel driver for it.
Is the kernel driver supposed to handle CP2104? May I have access to kernel CP210x driver so that I would "modify" it to support CP2104?
What are the steps to reconfigure (re-compile) the driver?

Thanks
Nuno

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
crmoratelli (crmoratelli-gmail) said :
#1

Nuno,

I am facing the same issue. I didn't figure out a solution yet. Could you share your solution?

Thank you.

Revision history for this message
Nuno Lambuca (nunolambuca) said :
#2

2 solutions:

Since I was not Ubuntu/Linux expert, I found it easier to recompile the kernel (which has a faulty CP210x driver) after solving the problem on the kernel driver.

The other way, which I have shared with other user, was to uninstall kernel driver for CP210x, then use the one provided by Silabs. Thiis one needs to remove one line of code that gives you error (.shutdown state) then should compile fine.

Cheers

Revision history for this message
crmoratelli (crmoratelli-gmail) said :
#3

Yes, the first solution worked for me. But, I was asking for the solution (patch) to the driver. My solution was change the function call:

 cp210x_set_config_single(port, CP210X_SET_BAUDDIV,
     ((BAUD_RATE_GEN_FREQ + baud/2) / baud)))

by

cp210x_set_config(port, SILABSER_SET_BAUDRATE, &baud, size);

The change is in the Config request code (SILABSER_SET_BAUDRATE 0x1e). It appears the device doesn't support the original CP210X_SET_BAUDDIV 0x01, but I am not sure about that.

This is not the final solution, but just a workaroud. I am looking forward for a better solution.

To the second solution, it shouldn't work well. When you comment out shutdown state (I did the same) the system crash removing out the usb cable or closing the ttyUSB.

The situation about the cp210x-3.1.0-.tar.gz driver from silabs website is: it was developed to support kernel 2.6.30 ou 31 (I am not sure rigth now). Newest Ubuntu is kernel 2.6.38+. The .shutdown call was changed to .release and .disconnect calls. So, the driver needs a port to newest kernels.

Can you help with this problem?

Provide an answer of your own, or ask Nuno Lambuca for more information if necessary.

To post a message you must log in.