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, Firefox OS, Sailfish OS, Maemo, MeeGo, Ubuntu Mobile, WebOS, Open Mobile Alliance and other similar projects and products.
A reminder that LQ now has a dedicated Android sister site: AndroidQuestions.org
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
rs232 communication speeds over Embedded linux ARM
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?
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.