Hi, I attach my serial initialization code. It works fine on my
Ubuntu laptop though, but got garbage in TS7800. BAUDRATE is set
as "B57600". Comments?
int serialInit()
{
serial_fp = open(SERIALDEVICE, O_RDWR | O_NOCTTY | O_NDELAY);
tcgetattr(serial_fp,&oldtio);
bzero(&newtio, sizeof(newtio));
newtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD;
newtio.c_iflag = IGNPAR | ICRNL;
newtio.c_oflag = 0;
newtio.c_lflag = ICANON;
newtio.c_cc[VINTR] = 0; // Ctrl-c
newtio.c_cc[VQUIT] = 0; /* Ctrl-\ */
newtio.c_cc[VERASE] = 0; // del
newtio.c_cc[VKILL] = 0; // @
newtio.c_cc[VEOF] = 4; // Ctrl-d
newtio.c_cc[VTIME] = 0; // inter-character timer unused
newtio.c_cc[VMIN] = 1; // blocking read until 1
newtio.c_cc[VSWTC] = 0; // '\0'
newtio.c_cc[VSTART] = 0; // Ctrl-q
newtio.c_cc[VSTOP] = 0; // Ctrl-s
newtio.c_cc[VSUSP] = 0; // Ctrl-z
newtio.c_cc[VEOL] = 0; // '\0'
newtio.c_cc[VREPRINT] = 0; // Ctrl-r
newtio.c_cc[VDISCARD] = 0; // Ctrl-u
newtio.c_cc[VWERASE] = 0; // Ctrl-w
newtio.c_cc[VLNEXT] = 0; // Ctrl-v
newtio.c_cc[VEOL2] = 0; // '\0'
tcflush(serial_fp, TCIFLUSH);
tcsetattr(serial_fp, TCSANOW, &newtio);
return(0);
}
--- In Bill Whiteley <>
wrote:
>
> There could be number of things going on. One thing to start with
is to get
> setserial on your TS7800. Simply download it from here:
>
> http://sourceforge.net/projects/setserial/
>
> load it onto your TS7800 and then issue
>
> ./configure
> make && make install
>
> It will likely complain about not having a man directory but that
only
> affects the
> installation of the man page. Everything else works fine. However,
I suspect
> that this may not fix your problem. If you post your serial code
we can look
> at
> it and may see something affecting your setup. Serial ports can be
tricky to
> get right.
>
>
> Bill
>
>
> On Sat, Feb 28, 2009 at 10:44 AM, teohoeeng <> wrote:
>
> > I have similar problems when I try to use ttts4, the COM 3
header on
> > TS-7800. My original serial code works fine on my Linux laptop,
but
> > when I ported the code over, I got garbage. I suspect the TS7800
> > com3 baudrate wasn't set according to what I stated in my serial
> > code. But I try to use "setserial" command in TS7800, but this
> > command wasn't installed. I wonder in shell or in the script, how
> > can I set the baudrate to be permanent to the number I want for
> > various serial ports?
> >
> > --- In <ts-7000%40yahoogroups.com>,
Heinrich du
> > Toit <heinrichdt@>
> > wrote:
> > >
> > > OK some more information...
> > >
> > > The segfaults doesn' happen always.
> > > I'm not sure when it happens though.
> > > But if lsmod doesn't break it seems apt-get and mount breaks
> > > Bottom line: something somewhere will break :(
> > >
> > > I've now done some tests with /dev/ttts5 and a scope.
> > > When I program my own code it works fine :)
> > >
> > > When I install tsuart1 and tsuart7800...
> > > I'm not sure .
> > > echo "bla bla" > /dev/ttts5
> > > does produce output. But the baud rate is horribly wrong.
> > >
> > > I've installed the "setserial" program. And according to it's
> > feedback
> > > the baudrate is set.
> > > But it doesn't make a difference on the output.
> > >
> > > What I've also done is connect my serial program to COM3 port.
> > > Since ttts4 should be the normal COM on that.
> > > Well I see output on the PC.
> > > But it is garbage regardless of what I do.
> > > I've tried different settings with gtkterm as of baud rate and
> > flow
> > > control ect.
> > > No help
> > > From the scope output it seems the baud rate should be around
> > 10000
> > > more or less.
> > > Well setting that in gtkterm doesn't help. Maybe I'm doing
> > something
> > > else wrong.
> > >
> > > And I think I'm going to smother the whole board with silicon
to
> > stop
> > > myself accidently shorting random things :)
> > >
> > > Has this file:
> > > ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7800-
linux/sources/linux-
> > 2.6.21-ts-src-jan182008.tar.gz
> > > Got the newest source code for that driver?
> > >
> > > Anybody else having problems with this driver?
> > > Or is it just me?
> > >
> > >
> > >
> > >
> > > Heinrich du Toit wrote:
> > > >
> > > > Hi
> > > >
> > > > I've downloaded the newest version dated 21Jan.
> > > >
> > > > First the drivers didn't work.
> > > > Then I restarted.
> > > >
> > > > The drivers now load and creates all the /dev/tt(t/8)s?
devices
> > > >
> > > > but from then on if I try to run lsmod I get a segfault :(
> > > > even if I remove tsuart7800 again with rmmod the segfault
> > persists
> > > >
> > > > It also seems to break apt-get from working (after piping
some
> > stuff to
> > > > these devices)
> > > >
> > > > Also once I started trying to echo things through these new
> > devices my
> > > > terminal on ttyS0 stopped working also.
> > > > It seems that the device didn't want to shutdown also.. but
that
> > was
> > > > difficult to check because I couldn't see any output any
more.
> > > >
> > > > How can I debug this further to try and find the actual
problem?
> > > >
> > > > -Heinrich
> > > >
> > > >
> > >
> >
> >
> >
>
>
>
> --
> Bill Whiteley
>
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|