Hello
On my AM3352 based custom board i have a Microchip USB2513 wich is well recognized by linux :
[ 1.507446] usb 1-1.1: new high-speed USB device number 3 using musb-hdrc
[ 1.631622] usb 1-1.1: New USB device found, idVendor=0403, idProduct=6011
[ 1.638610] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber
=3
[ 1.646026] usb 1-1.1: Product: USB <-> Serial Converter
[ 1.651397] usb 1-1.1: Manufacturer: FTDI
[ 1.655456] usb 1-1.1: SerialNumber: FTXO9FIB
[ 1.663330] ftdi_sio 1-1.1:1.0: FTDI USB Serial Device converter detected
[ 1.670562] usb 1-1.1: Detected FT4232H
[ 1.674468] usb 1-1.1: Number of endpoints 2
[ 1.678802] usb 1-1.1: Endpoint 1 MaxPacketSize 512
[ 1.683746] usb 1-1.1: Endpoint 2 MaxPacketSize 512
[ 1.688690] usb 1-1.1: Setting MaxPacketSize 512
[ 1.693847] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUS
B0
[ 1.704223] ftdi_sio 1-1.1:1.1: FTDI USB Serial Device converter detected
[ 1.711486] usb 1-1.1: Detected FT4232H
[ 1.715362] usb 1-1.1: Number of endpoints 2
[ 1.719696] usb 1-1.1: Endpoint 1 MaxPacketSize 512
[ 1.724639] usb 1-1.1: Endpoint 2 MaxPacketSize 512
[ 1.729583] usb 1-1.1: Setting MaxPacketSize 512
[ 1.734710] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUS
B1
[ 1.744995] ftdi_sio 1-1.1:1.2: FTDI USB Serial Device converter detected
[ 1.752197] usb 1-1.1: Detected FT4232H
[ 1.756072] usb 1-1.1: Number of endpoints 2
[ 1.760406] usb 1-1.1: Endpoint 1 MaxPacketSize 512
[ 1.765350] usb 1-1.1: Endpoint 2 MaxPacketSize 512
[ 1.770324] usb 1-1.1: Setting MaxPacketSize 512
[ 1.775390] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUS
B2
[ 1.785644] ftdi_sio 1-1.1:1.3: FTDI USB Serial Device converter detected
[ 1.792816] usb 1-1.1: Detected FT4232H
[ 1.796722] usb 1-1.1: Number of endpoints 2
[ 1.801055] usb 1-1.1: Endpoint 1 MaxPacketSize 512
[ 1.805999] usb 1-1.1: Endpoint 2 MaxPacketSize 512
[ 1.810943] usb 1-1.1: Setting MaxPacketSize 512
[ 1.816009] usb 1-1.1: FTDI USB Serial Device converter now attached to ttyUS
B3
[ 1.917449] usb 1-1.2: new high-speed USB device number 4 using musb-hdrc
[ 2.041595] usb 1-1.2: New USB device found, idVendor=0403, idProduct=6011
[ 2.048583] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber
=3
[ 2.055969] usb 1-1.2: Product: USB <-> Serial Converter
[ 2.061370] usb 1-1.2: Manufacturer: FTDI
[ 2.065429] usb 1-1.2: SerialNumber: FTXO9FIB
[ 2.073120] ftdi_sio 1-1.2:1.0: FTDI USB Serial Device converter detected
[ 2.080352] usb 1-1.2: Detected FT4232H
[ 2.084259] usb 1-1.2: Number of endpoints 2
[ 2.088592] usb 1-1.2: Endpoint 1 MaxPacketSize 512
[ 2.093536] usb 1-1.2: Endpoint 2 MaxPacketSize 512
[ 2.098480] usb 1-1.2: Setting MaxPacketSize 512
[ 2.103576] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUS
B4
[ 2.113861] ftdi_sio 1-1.2:1.1: FTDI USB Serial Device converter detected
[ 2.121093] usb 1-1.2: Detected FT4232H
[ 2.124969] usb 1-1.2: Number of endpoints 2
[ 2.129333] usb 1-1.2: Endpoint 1 MaxPacketSize 512
[ 2.134277] usb 1-1.2: Endpoint 2 MaxPacketSize 512
[ 2.139221] usb 1-1.2: Setting MaxPacketSize 512
[ 2.144287] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUS
B5
[ 2.154571] ftdi_sio 1-1.2:1.2: FTDI USB Serial Device converter detected
[ 2.161834] usb 1-1.2: Detected FT4232H
[ 2.165740] usb 1-1.2: Number of endpoints 2
[ 2.170104] usb 1-1.2: Endpoint 1 MaxPacketSize 512
[ 2.175048] usb 1-1.2: Endpoint 2 MaxPacketSize 512
[ 2.180023] usb 1-1.2: Setting MaxPacketSize 512
[ 2.185150] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUS
B6
[ 2.195465] ftdi_sio 1-1.2:1.3: FTDI USB Serial Device converter detected
[ 2.202667] usb 1-1.2: Detected FT4232H
[ 2.206542] usb 1-1.2: Number of endpoints 2
[ 2.210906] usb 1-1.2: Endpoint 1 MaxPacketSize 512
[ 2.215850] usb 1-1.2: Endpoint 2 MaxPacketSize 512
[ 2.220794] usb 1-1.2: Setting MaxPacketSize 512
[ 2.225891] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUS
B7
when i write on /dev/ttyUSB0, that's OK, i get my characters on an hyperterminal, but when i want to read, the caracters received aren't those emited by the hyperterminal. (for example a 'm' becomes'I', h becomes 'J'...)
Have you any idea of what can happen ?
thanks
Here is the source code to open COM :
if ( (com_fd1=open("/dev/ttyUSB0",O_RDWR )) == -1 )
{
perror("open tty232USB0\r\n");
}
}
//read COM parameter
if (tcgetattr(fd,&termios_p) != 0)
{
printf ("error %d from tcgetattr\r\n", errno);
}
/
//set baud rate
termios_p.c_cflag = B9600 | CS8;
// termios_p.c_cflag = B115200 | CS8;
termios_p.c_lflag = 0; // no signaling chars, no echo,
termios_p.c_oflag = 0; // no remapping, no delays
termios_p.c_cc[VMIN] = 0; // read doesn't block
termios_p.c_cc[VTIME] = 0; // no timeout
//TODO
if ((comport==5)||(comport==6))
termios_p.c_cc[VTIME] = 5;
//shut off parity
//termios_p.c_cflag &= ~(PARENB | PARODD);
//one stop bit
//termios_p.c_cflag &= ~CSTOPB;
//save new parameter
if (tcsetattr(fd,TCSANOW,&termios_p) != 0)
{
printf ("error %d from tcsetattr\r\n", errno);
}
printf ("COM%d initailized\r\n",comport);
Here is the source code to read COM :
len = read(fd1,&c,1);
if (len < 1 ) //TODO && errno != EAGAIN)
{
printf("Rx error%d: %s\n",com1, strerror(errno));
}
else if (len==1)
{
printf("Rx %c %d\r\n",c,c);
break;
}