Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to get a 485 port on a Manx PC-104 board to work. This is suppose to be COM3 in Windows or TTYS2 in Linux. I have written a C-program to enable the 485 hardware transmitter and dump characters into the UART's transmit buffer. This works. I can see the 458 serial stream on an oscillascope <sic> so I know the hardware is OK.
But when I stop the C-program and then try to output using a Linux driver, it doesn't work -- nothing on the scope.
I have tried 2 approaches to stimulate the output:
--- I have used minicom, setting the device to /dev/ttyS2
--- I have tried this command or variations "echo UUUUUUUUUU > /dev/ttyS2".
setserial reports the device at the correct address with the correct IRQ. (0x3e8 and IRQ4)
"mesg | grep /dev/ttyS [01234] also confirms this.
Do I have to do something special, like "mounting" the device to /dev/ttyS2? If so how? What is the device "type" for the mount command?
No, you don't mount it. Linux has had 485 support for a while and many patches are available for different chips. 485 doesn't really work like 232-c so you have to use other means than a common serial uart setup or posix serial type apps.
If mountng is not required, what is? The article from Moxa goes into detail about the handshaking and need to control precisely when the transmitter turns off after each transmission. At this time, that is not my problem. It may be in the future, but not yet. Right now, I cannot get the transmitter to work at all using a Linux driver. (As I said, it's OK when I load the registers directly.) Simply stated how come the command "echo "UUUUUUUUUUUUU" >/dev/ttyS2" issued after the transmitter is enabled does not produce a stream of pulses on the TXD+/- lines?
The standard linux driver is probably hardware agnostic for anything beyond the UART. Whatever means you have employed to enable the transmitter is probably undone by the driver, since it was probably written with the expectation of supporting RS-232. You may be able to suppress this behavior. It may also be caused by the expectation of some modem control line such as CTS or CD to be enabled before it will transmit. This behavior may also be suppressed. It may be helpful to tell us specifially what driver is being used for your system. Since you said PC/104 & Windows, it seems probable that it is a standard 8250 UART family driver, but it is probably worth knowing for sure.
The device nodes '/dev/ttyS*' are created as part of the driver loading. I assume this is the basis of your question about 'mounting' (filesystem partitions on block devices are 'mounted'). That there is a device node for your hardware is pretty much sufficient to confirm that the driver is properly loaded.
May I suggest the use of C-Kermit to diagnose this problem? It has a fair degree of flexibility about how modem control and handshaking is used, and may at least help you determine the cause of your problem. From there, a solution may become evident.
--- rod.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.