AnsweredAssumed Answered

setting custom baud rate on UART for MPC52xx.

Question asked by Venu Reddy on Aug 14, 2007
Latest reply on Oct 14, 2007 by Ewald Mack
Hi,
I tried to set baud rate 5 bits/s as it needed by my application.
code snippet as below.

baudrate=5;

ret=ioctl(rfd, TIOCGSERIAL, &serial_info);

if(ret!=0)

{

perror("custom baud rate get");

}

serial_info.flags &= ~ASYNC_SPD_MASK;

serial_info.flags |= ASYNC_SPD_CUST;

serial_info.custom_divisor=serial_info.baud_base / baudrate;

ret=ioctl(fd, TIOCSSERIAL,serial_info);

if(ret!=0)

{

perror("custom baud rate set:");

}

for this I am getting "custom baud rate set: invalid argument" error in run time.

for standard baud rates it working well.

am I doing any thing wrong while accessing tty device?

does 8250 driver for mpc52xx really support custom baudrates?

and particulerly low baud rates like 5 bits/sec and 10.4 kbps.

Outcomes