[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problem settin Serial Asynch speed.. AND include/asm/serial.h missing??



Hi,
 
I have not been able to reproduce the problem you got. The error message 
"serdriver tried setting invalid baudrate, flag cb0" indicates that the baud
rate has not been set. I have looked through your code and it looks correct.
Which version of the developer board software are you using?
 
We have found a difference between uC-libc/include/bits/termios.h and 
elinux/include/asm-cris/termbits.h which may cause problems in some
serial port applications. We will release a new developer board LX
release today with glibc instead of uC-libc. This release will solve this 
kind of incompatibility problems.
 
>I tried to enable serial support for traditional uart in character device setup
>in the kernel, but the compilation returned an error while making serial.c,
>telling that asm/serial.h file was missed. In fact it is not present, nor in the
>Linux-2.4.3 you supply in your site.
>Where's the error?
 
You shouldn't enable the normal serial port support in kernelconfig (it is
PC specific). Use the ETRAX specific serial port config options instead.
 
Regards
/Mikael

 
 -----Original Message-----  
From: owner-dev-etrax@xxxxxxx.com]On">mailto:owner-dev-etrax@xxxxxxx.com]On Behalf Of Flavio Molinelli
Sent: Monday, June 25, 2001 9:28 AM
To: dev-etrax
Subject: Problem settin Serial Asynch speed.. AND include/asm/serial.h missing??



I tried to run a simple serial program, that set serial-0 (ttyS0) params (baud, parity, stop, and so on), and comunicates with it.
 
The programs is ok w/ linux i386
 
uClinux Compilation was OK 
 
when started on the dev_board, serial communication fails, and on the debug line I see "serdriver tried setting invalid baudrate, flag cb0"
 
I tried also the serial.c exambple code I found on the list, it didnt work at all.
 
I tried to enable serial support for traditional uart in character device setup in the kernel, but the compilation returned an error while making serial.c, telling that asm/serial.h file was missed. In fact it is not present, nor in the Linux-2.4.3 you supply in your site.
Where's the error?
 
Here's my serial initialization code:
 
========
 
int WC_OpenNode(char *dev, int speed, long tmo) {

struct termios otermio, termio;

int mask = TIOCM_DTR;

inode = onode = 0;

/*

if (tcgetattr(inode, &otermio)) return WC_Rundown("tcgetattr()", errno);

bzero(&termio, sizeof(termio));

switch (speed) {

case 2400: speed = B2400; break;

case 4800: speed = B4800; break;

case 9600: speed = B9600; break;

case 19200: speed = B19200; break;

default: speed = B9600; break;

}

cfsetospeed(&termio, speed);

cfsetispeed(&termio, speed);

switch (TNode) {

case LARA:

termio.c_cflag |= speed|CS8|CSTOPB|CLOCAL|CREAD; 

termio.c_iflag = IGNPAR | IGNBRK; 

break;

case SYS:

case TTY:

case MAY2:

/* termio.c_cflag = CS8|CLOCAL|CREAD; */

termio.c_cflag = speed|CS8|CREAD|CLOCAL|HUPCL;

termio.c_iflag = IGNPAR | IGNBRK; 

break;

case MAYER:

termio.c_cflag |= speed|CS7|PARENB|CLOCAL|CREAD; 

termio.c_iflag |= IGNPAR|IGNBRK|INPCK|ISTRIP;

break; 

}

termio.c_lflag = 0;

/*

termio.c_cc[VTIME] = tmo/100; 

termio.c_cc[VMIN] = 0;

*/

if (tcflush(inode, TCIFLUSH)) return WC_Rundown("tcflush()", errno);

if (tcsetattr(inode, TCSANOW, &termio)) return WC_Rundown("tcsetattr()", errno);

ioctl(inode, TIOCMGET, &mask); 

mask |= TIOCM_DTR;

ioctl(inode, TIOCMSET, &mask); 

}