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

Re: Problem with serial port



Hi, Per-Ola,

I had similar problem wirh R100,
Upgraded to 200 and magically began working, with many other things

Yes, definitively it's worth to upgrade.

cheers

Flavio
----- Original Message -----
From: "Per-Ola Svensson" <t98pos@xxxxxxx.se>
To: <dev-etrax@xxxxxxx.com>
Sent: Wednesday, July 18, 2001 10:54 PM
Subject: Problem with serial port


>
> Hi
>
> I hope someone can help me, excuse me if my english is not perfect.
>
> I have done a server running on the dev_board lissening on a socket and
the
> seriel port 1 (ttyS0). The problem is that I can't make the dev_board
sending
> data over the serial interface. The strange thing is that the same code is
> working on the PC without any problem.
>
> To try solving the problem I made two test application, one server
lissening
> on the serial port and one sending. When I start the server on the
dev_board
> and the sender on the PC it works, but the reversed do not.
>
> I init the port with:
>
>         serial = open("/dev/ttyS0", O_RDWR | O_NOCTTY );
>         if (serial <0)
>         {
>                 fprintf(stderr, "No, the port /dev/ttyS0 is NOT open ");
>                 exit(-1);
>         }
>         else
>         {
>                 fprintf(stderr, "/dev/ttyS0 open with fd = %d\n", serial);
>         }
>
>         bzero(&newtio, sizeof(newtio));
>         newtio.c_cflag = B38400 | CRTSCTS | CS8 | CLOCAL | CREAD;
>         newtio.c_iflag = IGNPAR;
>         newtio.c_oflag = 0;
>         newtio.c_lflag = 0;
>         newtio.c_cc[VTIME] = 0;
>         newtio.c_cc[VMIN] = 0;
>         tcflush(serial, TCIFLUSH);
>         tcsetattr(serial,TCSANOW,&newtio);
>
> Again. The PC can send with this settings but not the dev_board.
>
> One smaller question. Is it worth uppgrading to the new relese (R 2.0.0)?
It
> allready works perfecly (except serial) and I don't plan to use the new
> opptions glibc provide.
>
> Thank's
> Per-Ola Svensson, t98pos@xxxxxxx.se
>
>