LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile
User Name
Password
Linux - Mobile This forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, LiMo, Maemo, MeeGo, Openmoko, Ubuntu Mobile, WebOS, Firefox OS, Open Mobile Alliance and other similar projects and products.
A reminder that LQ now has a dedicated Android sister site: AndroidQuestions.org

Notices

Reply
 
LinkBack Search this Thread
Old 11-04-2010, 12:54 AM   #1
gigin
LQ Newbie
 
Registered: Nov 2010
Posts: 7

Rep: Reputation: 0
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.

Please help.

Thanks
 
Old 11-04-2010, 08:41 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,390
Blog Entries: 2

Rep: Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900
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?

--- rod.
 
Old 11-07-2010, 10:44 PM   #3
gigin
LQ Newbie
 
Registered: Nov 2010
Posts: 7

Original Poster
Rep: Reputation: 0
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.

-gigin
 
Old 11-08-2010, 09:09 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,390
Blog Entries: 2

Rep: Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900
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.

--- rod.
 
Old 11-10-2010, 11:52 PM   #5
gigin
LQ Newbie
 
Registered: Nov 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Hi rod,

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?

thanks
gigin
 
Old 11-11-2010, 01:21 AM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,390
Blog Entries: 2

Rep: Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900
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.


--- rod.

Last edited by theNbomr; 11-13-2010 at 11:26 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Serial RS232 Communication to Embedded Device on Laptop - No DB9 or DB25 idoneous Linux - General 4 09-06-2010 04:29 PM
embedded linux on ARM audiogreenie Linux - Embedded & Single-board computer 1 02-02-2009 11:52 AM
enabling ttyS for rs232 communication poonippi Linux - Hardware 7 01-23-2008 09:30 AM
USB-RS232 communication problem (I think) damip Linux - Hardware 1 10-31-2007 08:57 AM
Serial (RS232) communication is one-way anroy Linux - Hardware 5 08-25-2007 01:35 PM


All times are GMT -5. The time now is 03:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration