LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-13-2012, 09:14 AM   #1
beparas
Member
 
Registered: Nov 2006
Location: Pune
Posts: 48

Rep: Reputation: 0
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,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I send and receive data through a TUN interface? jayadhanesh Linux - Networking 4 02-26-2009 02:49 AM
How can I receive a 100kb data on a Linux server NancyT Linux - Server 1 11-12-2008 06:17 AM
MRTG didn't show previous data spice_prash Linux - Software 0 01-29-2008 04:59 AM
didn't compile emu10k1 as module fobius Linux - Software 1 02-04-2004 09:09 PM
How to receive Data-CD-ROM name? razem Programming 0 12-25-2003 01:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration