To: | |
---|---|
Subject: | [ts-7000] Re: TS-7800 strange tsuart behaviour |
From: | "cedric_roussel" <> |
Date: | Thu, 15 May 2008 08:06:48 -0000 |
Thanks Michael for your reply, I've got the same problem with the code you gave me. Here is the test code I used: #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <termios.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/select.h> #include <unistd.h> extern void termConfigRaw (int fd, struct termios *saved, int baud_Enum); #define MAX(a, b) ((a) > (b) ? (a) : (b)) struct termios tty; #define USAGE "Usage : terminal dev speed\nwith speed in Kbps\n\0" /* * Serial port initialisation : * arg : port, baud rate, number of bits/byte, parity, number of stop bits. */ void port_init (int portfd, char *speed) { speed_t spd; /*Seting comu nication speed */ switch (atol (speed)) { case 0: spd = B0; break; case 300: spd = B300; break; case 600: spd = B600; break; case 1200: spd = B1200; break; case 2400: spd = B2400; break; case 4800: spd = B4800; break; case 9600: spd = B9600; break; case 19200: spd = B192 0 0; break; case 38400: spd = B38400; break; case 57600: spd = B57600; break; case 115200: spd = B115200; break; case 230400: spd = B230400; break; default: printf (USAGE); exit (1); } termConfigRaw (portfd, &tty, spd); } int main (int argc, char **argv) { char c; int portfd, n, res; fd_set rfds; if (argc < 3) { printf (USAGE); & n bsp; exit (1); } /*Openning the serial port in read/write with nodelay mode */ portfd = open (argv[1], O_RDWR | O_NOCTTY); /*Serial port initialisation with the right proprieties */ port_init (portfd, argv[2]); /*Flushing old IO */ tcflush (portfd, TCIOFLUSH); setbuf (stdout, NULL); while (1) { n = 0; FD_ZERO (&rfds); FD_SET (STDIN_FILENO, &rfds); n = MAX (n, STDIN_FILENO); FD_SET (portfd, &rfds); n = MAX (n, portfd); res = select (n + 1, &rfds, NULL, NULL, NULL); if (res > 0) { if (FD_ISSET (portfd, &rfds)) { if (read (portfd, &c, 1) != -1) { printf ("%c", c); fflush (stdout); } } if (FD_ISSET (STDIN_FILENO, &rfds)) { if (read (STDIN_FILENO, &c, 1) != -1) { write (portfd, &c, 1); } } } } close (portfd); exit (0); } --- In "Michael" <> wrote: > > > Hello there, > > > > I'm the owner of a brand new ts7800 board i'd like to use with > > multiples serial devices. My problem is that i cant get every ports to > > work. Some are ok and some won't talk... > > I've tested my ports with a simple loopback wire connecting rx to tx > > and here are the r e sults: > > > > ttyS0 ok > > ttyS1 failed > > ttts0 ok > > ttts1 ok > > ttts2 untested > > ttts3 untested > > ttts4 failed > > ttts5 failed > > ttts6 ok > > ttts7 ok > > ttts8 ok > > ttts9 ok > > > > pinout there: > > http://www.embeddedarm.com/about/resource.php?item=303#uart > > > > I'm currently running full distro from microsd slot but I hade the > > same problem under fastboot... > > dmesg does not complain and my modules md5 are: > > > > fb71d4c375c724551dc7f2f4165a3392 > > /lib/modules/2.6.21-ts/kernel/drivers/serial/tsuart1.ko > > > > 7639cb90e387ce7c4f2836a67b61f406 > > /lib/modules/2.6.21-ts/kernel/drivers/serial/tsuart7800.ko > > Those are the latest modules. > > However, it is interesting that you are seeing a problem with both ttyS1 > (which is a serial port in the SoC) and ttts3/4 (which are serial ports in > the FPGA). > > I assume you using the same identical code to initialize and talk to each > port? It's possible that you might not be completely initializing the > termios, you may want to look at this sample code: > ftp://ftp.embeddedARM.com/tmp/term.c > > > If you have any idea... > > Thank you, > > Cedric. > > > ______ Best Regards, > |__ __/ Michael Schmidt > || Software Engineer > ||echnologic Systems (EmbeddedARM.com) > || (480) 16610 East Laser Drive #10 > |/ 837-5200 Fountain Hills, AZ 85268 > http://oz.embeddedarm.com/~michael > __._,_.___
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe __,_._,___ |
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | Re: [ts-7000] Re: New to embedded Linux...., Anssi Kolehmainen |
---|---|
Next by Date: | [ts-7000] Re: Rebind after process crash -- quasi-n00b sockets issue, naturalwatt |
Previous by Thread: | Re: [ts-7000] TS-7800 strange tsuart behaviour, Michael |
Next by Thread: | Re: [ts-7000] Re: TS-7800 strange tsuart behaviour, Frank |
Indexes: | [Date] [Thread] [Top] [All Lists] |
Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU