Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-13-2012, 09:14 AM
|
#1
|
Member
Registered: Nov 2006
Location: Pune
Posts: 48
Rep:
|
CP210x module didn't receive data
Hi All,
I added support for Silicon Labs CP210x to my development board kernel.
On my development board CP210x chip is connected using USB bus.
And I am sending data to CP210x using one external device.
I write a program to read data on usb-serial (ttyUSB0) on development board.
But I didn't get any data,
external device -------> CP210x -------> My development device
enable debug messages
Quote:
# echo 1 > /sys/bus/usb-serial/drivers/generic/module/parameters/debug
# cat /sys/bus/usb-serial/drivers/generic/module/parameters/debug
Y
# echo 1 > /sys/bus/usb-serial/drivers/cp210x/module/parameters/debug
# cat /sys/bus/usb-serial/drivers/cp210x/module/parameters/debug
Y
|
debug messages
Quote:
#demesg
....
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ar71xx-ohci ar71xx-ohci: Atheros AR71xx built-in OHCI controller
ar71xx-ohci ar71xx-ohci: new USB bus registered, assigned bus number 1
ar71xx-ohci ar71xx-ohci: irq 3, io mem 0x1b000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb 1-1: new full speed USB device using ar71xx-ohci and address 2
USB Serial support registered for cp210x
usbcore: registered new interface driver cp210x
cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
usb 1-1: configuration #1 chosen from 1 choice
cp210x 1-1:1.0: cp210x converter detected
usb 1-1: reset full speed USB device using ar71xx-ohci and address 2
usb 1-1: cp210x converter now attached to ttyUSB0
......
|
When I open ttyUSB0 for communication, debug messages are
Quote:
#dmesg
...
drivers/usb/serial/usb-serial.c: serial_install
drivers/usb/serial/usb-serial.c: serial_open - port 0
drivers/usb/serial/cp210x.c: cp210x_open - port 0
drivers/usb/serial/cp210x.c: cp210x_get_termios_port - port 0
drivers/usb/serial/cp210x.c: cp210x_get_termios_port - baud rate = 115200
drivers/usb/serial/cp210x.c: cp210x_get_termios_port - data bits = 8
drivers/usb/serial/cp210x.c: cp210x_get_termios_port - parity = NONE
drivers/usb/serial/cp210x.c: cp210x_get_termios_port - stop bits = 1
drivers/usb/serial/cp210x.c: cp210x_get_termios_port - flow control = NONE
drivers/usb/serial/cp210x.c: cp210x_tiocmset_port - port 0
drivers/usb/serial/cp210x.c: cp210x_tiocmset_port - control = 0x0303
.....
|
The debug messages I get when I send data from external device to developemnt board,
Quote:
#demesg
....
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: usb_serial_port_work - port 0
drivers/usb/serial/usb-serial.c: usb_serial_port_work - port 0
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: serial_write_room - port 0
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [5E]
drivers/usb/serial/usb-serial.c: serial_write - port 0, 1 byte(s) data [40]
drivers/usb/serial/usb-serial.c: usb_serial_port_work - port 0
drivers/usb/serial/usb-serial.c: usb_serial_port_work - port 0
drivers/usb/serial/usb-serial.c: usb_serial_port_work - port 0
|
Program to read data from ttyUSB0, running on development board
Quote:
int main(void)
{
int UartFd;
char ReadData[30];
int ReturnVal;
UartFd = open("/dev/ttyUSB0", O_RDONLY);
if ( UartFd < 0 )
{
perror("Open");
}
else
{
printf("Uart_Fd: %d\r\n", UartFd);
}
memset(ReadData, 0, sizeof(ReadData));
ReturnVal = read(UartFd, ReadData, sizeof(ReadData));
if ( ReturnVal < 0 )
{
perror("Read");
}
else
{
printf("ReturnVal: %d\r\n", ReturnVal);
int i;
for(i = 0; i < ReturnVal; i++)
printf(" %2X ", ReadData[i]);
}
close(UartFd);
return 0;
}
|
My program didn't print any data on terminal.
Is any body help me how to debug this issue, what is the problem.
Thanks in advance,
|
|
|
All times are GMT -5. The time now is 06:23 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|