set serial [open /dev/ttyS0 RDWR]
fconfigure $serial -mode "115200,n,8,1"
here's the message i get:
bad option "-mode": should be one of -blocking, -buffering, -
buffersize, -encoding, -eofchar, or -
translation
while
executing
"fconfigure $serial -mode "115200,n,8,1" "
Any ideas ?
regards
> set serial [open /dev/ttyS0 RDWR]
> fconfigure $serial -mode "115200,n,8,1"
>
> here's the message i get:
>
> bad option "-mode": should be one of -blocking, -buffering, -
> buffersize, -encoding, -eofchar, or -
> translation
The -mode flag was moved to tcl's open command back in 2003. Read the
second n open man page (see the link at the top of http://wiki.tcl.tk/open
if you don't have local man pages) for more details.
Seems to work for me on Ubuntu 7.10
TkCon screen dump
loading history file ... 48 events added
buffer line limit: 512 max line length: unlimited
Main console display active (Tcl8.4.15 / Tk8.4.15)
(dp01) 49 % set fd [ open /dev/ttyS0 r+]
file6
(dp01) 50 % fconfigure $fd -mode "9600,n,8,1"
(dp01) 51 % close $fd
(dp01) 52 % set fd [ open /dev/ttyS0 RDWR]
file6
(dp01) 53 % fconfigure $fd -mode "9600,n,8,1"
(dp01) 54 % close $fd
(dp01) 57 % set fd [ open /dev/ttyS0 RDWR]
file6
(dp01) 58 % fconfigure $fd -mode "115200,n,8,1"
(dp01) 59 %
>On my target (kernel-2.6.23) when i tried to execute the following
>commands
>
>set serial [open /dev/ttyS0 RDWR]
>fconfigure $serial -mode "115200,n,8,1"
>
>here's the message i get:
>
> bad option "-mode": should be one of -blocking, -buffering, -
Is it possible that /dev/ttyS0 is not truly an
asynchronous serial device?
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan...@MYCOMPANY.com
http://www.MYCOMPANY.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
That sounds like TCL did not recognize /dev/ttyS0 as a serial port but
as a 'real' file. Can you confirm that /dev/ttyS0 is indeed the
correct pathname to the port on that platform?
R'
If I recall correctly, there are Linux distribution with incorrectly
configured Tcl.
You should try to recompile Tcl.
Yes i confirm /dev/ttyS0 is the correct pathname to the serial port of
my target.
If i issue the same commands on my host (ubuntu), it works !
Thanks in advance
What do you mean by that ?
Well, then... However, if you open /dev/ttyS0 in tcl, and then do an
fconfigure on the fd, and you don't see the -mode in the response,
this tells you that TCL is not seeing /dev/ttyS0 as a serial device:
fconfigure [open /tmp/xxx w+]
=> -blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 \
-eofchar {{} {}} -translation {auto lf}
fconfigure [open /dev/ttyS0 w+]
=> -blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 \
-eofchar {{} {}} -translation {auto crlf} \
-mode 9600,n,8,1 -xchar {^Q ^S}
Someone else pointed out that maybe it is worth to recompile TCL
yourself for that platform in question.
| If i issue the same commands on my host (ubuntu), it works !
This does not tell you anything about whether /dev/ttyS0 is the
correct path on your ARM platform.
R'
Hi,
If -mode configure option is missing, it means isatty() system call on
file descriptor for this channel failed to report it as a TTY. This may
occur either if the kernel driver is failing to report itself as a TTY
(some broken/partial implementation of serial drivers on embedded
systems have this problem), or if Tcl is wrongly configured (especially
when cross-compiling, since configure script may fails to set
USE_TERMIOS, etc... correctly).
If you want to try another Tcl binary for your arm-linux system, so you
can test if problem comes from kernel driver or Tcl/libc, eTcl binary
for arm-linux is a standalone, statically linked executable which should
run on your platform as is, by simply copying it anywhere on your
filesystem.
http://www.evolane.com/software/etcl/index.html
http://www.evolane.com/download/etcl/linux/etcl-1.0-rc25-linux-arm.tar.gz
http://www.evolane.com/download/etcl/linux/etcl-1.0-rc25-linux-arm-all.tar.gz
Next release (coming very soon) will include Tcl only (no Tk) binaries
for embedded linux targets, so binary will be much smaller (current
binaries are linked with libX11, ... statically too).
Eric