IMX233 custom baud rates

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX233 custom baud rates

997 Views
twdorris
Contributor I

For legacy purposes, I needed to be able to use the "old standard" way of specifying a custom baud rate in Linux.  And example follows.

// configure port to use custom speed instead of 38400
ioctl(port, TIOCGSERIAL, &ss);
ss.flags = (ss.flags & ~ASYNC_SPD_MASK) | ASYNC_SPD_CUST;
ss.custom_divisor = (ss.baud_base + (speed / 2)) / speed;
ioctl(port, TIOCSSERIAL, &ss);

cfsetispeed(&tios, B38400);
cfsetospeed(&tios, B38400);

The IMX23 UART drivers do not support this, however.  So I modified the drivers accordingly and thought I'd post it up.  NOTE: Technically, the driver should also check that baud is set to 38400 in addition to checking the SPD_CUST flag.  But for our purposes, the CUST flag is a sufficient trigger.

This enables custom baud rates on both the application and the debug UARTs.

Labels (1)
0 Kudos
1 Reply

590 Views
chaoli
Contributor I

I patch it . Now I can configure the buad that I want to be , I measure it by oscilloscope.  And it can send datas , but it cannot receive any datas .

If I open the tty device , then  close it , and open once again,there are some problem !

can you help me ?

0 Kudos