rs232 communication speeds over Embedded linux ARM
Linux - MobileThis forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Sailfish OS, Replicant, Ubuntu Touch, webOS, and other similar projects and products.
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.
rs232 communication speeds over Embedded linux ARM
Hi ,
I am using ARM embedded linux 2.6.30 on a samsung s3c2440. When I try to transfer bulk data (eg. a database) over serial port, I am getting speed of around 2-3 kbps. I am using a rs232 interface from my PC to the ARM development kit. The same code on PC to PC transfer gives me speed of 20kbps.
Is that the best speed I can get on an embedded platform. Can I do any to improve the performance, like mapping DMA channel for a UART or increasing the fifo size etc. etc.
Are you using the same bit rate on both platforms? RS-232 can operate at different speeds, and is runtime configurable. Lower bit rates result in lower overall transfer rates. Are you using a direct file-transfer application, such as Kermit, or is the serial port mapped as a ppp interface, or... ? How are you measuring the transfer speed?
Hi ,
Thanks rod
I am communicating between a dot net application on windowsxp and a linux application on QT. The linux application is deployed on an ARM9 based target. Both the applications are custom made. The transfer is done using the read/write APIs for serial port.
The baudrates used are 115200 on both platforms. The transfer speed is calculated by starting and stopping the timers between the transfer and dividing the total datasize value with the timer.
Okay, good. We've established the framework for the transfers, and it sounds like comparing apples to apples. So, the first thing I would explore is whether the hardware is capable of faster speeds, and I feel certain that it should be. Can you try transferring files using a standard serial file transfer protocol, like zmodem, kermit, etc.? If that shows good transfer rates, then I would be suspicious about the Qt aspect. Although I don't know much about your application, it would be easy to wonder whether the extra burden of Qt &/or the way in which your application uses the serial port is playing a role. When your application runs, what is the CPU usage on the Arm? Serial ports are somewhat configurable using the termios API, but other than setting the bitrate, those things mostly don't affect throughput, unless you've got some kind of flow control interfering. I would be surprised if there was anything you could change in terms of the low-level hardware configuration, that the driver doesn't do already. Only the manufacturer's documentation is likely to say for sure. I guess it is possible that cabling may be a problem. I assume you have a proper connection, and that the wiring is not causing data corruption. If so, you may actually see an improvement in overall throughput by reducing the bitrate. 115200 bps is encroaching on the limit of RS-232 with full-on slew rate limiting in the line drivers. High capacitance cabling will be a problem at those speeds, especially if the cable is long.
I have now tested the communication with a standard application, picocom, which used Zmodem protocol for ftp transfer. I was able to get appreciable speeds (above 105kbps) between picocom on ARM linux and hyperterminal on windows x86.
Is it possible that I can use ftp with zmodem protocol for my custom applications. Is there any third party libraries with source code available?
I'm sure there is source code out there for all of the various file transfer protocols. I would suggest building a non-GUI version first, and see if your GUI is either sucking up too much CPU, or you may have some inefficiencies built in, in the way you are doing the serial IO.
The source code should not(edit) be hard to track down, but I'm sorry I can't point to anything off the top of my head.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.