LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-20-2012, 11:59 PM   #1
linxquest
LQ Newbie
 
Registered: Dec 2012
Posts: 6

Rep: Reputation: Disabled
Asynchronous Serial communication throwing "over fram error"


Tx source is transmitting data at 1200 baud rate, and my application is receiving data at 1200 baud rate,
my application reads correct data, but it throws over fram error in between, I am not able to find out why?
Anyone has solution for this problem?
 
Old 12-21-2012, 03:07 AM   #2
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by linxquest View Post
it throws over fram error in between
I program serial comms for my work, and I have to be honest - I have no idea what the above statement means. Post the error you get/some code that generates the error/the error number you get from whatever function you're calling that fails.
 
Old 12-21-2012, 06:40 AM   #3
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
Do you mean the UART reports a framing error?

One thing that could cause that is disabling the transmitting UART between packets while it's attempting to transmit whatever padding or filler bytes you might be sending (or maybe even during the final stop bit). Or even more likely, disabling whatever logic is between the transmitting and receiving UARTs.

If that's what's happening, it can be solved by putting a short delay after the packet is transmitted but before anything is disabled.

But if you're transmitting a frame-check value (CRC or checksum) with each packet, you can safely ignore all UART errors. If the receiving process recalculates the frame-check and it matches, then the packet is good regardless of what the UART gripes about.
 
Old 12-21-2012, 03:41 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Framing errors generally mean that a stop bit was expected, but not found. There can be a number of causes, most of which are configuration errors. If the sender and receiver do not agree about the format of the data, it is easy to cause framing errors. You have stated a bitrate (1200 bps), but not the rest of the data format. There is word size, (almost always 8 or 7 bits), parity type, if any, and number stop bits. Make sure both ends of the communications channel are using the same configuration.
It is also possible that the data actually is getting corrupted on the wire. This can result from improper cabling, failing transmitter or receiver electronics, or external noise sources. Do you have a ground pin connecting the two hosts/devices? One of the devices may have a faulty timing source (usually a crystal, or an oscillator on-board the CPU). The clocks of both transmitter & receiver must be in agreement or the receiver will see an invalid bit where it expects to see a stop bit. If this is the case, it should be easier to reproduce the fault when sending certain bytes, but not so easy with other bytes. If you are able to control the byte stream in both directions, try sending streams of data and compile some statistics about which bytes cause more errors. If there is a big spike in the number of occurrences for certain bytes, it could point to timing problems.
--- rod.
 
Old 12-23-2012, 10:33 PM   #5
linxquest
LQ Newbie
 
Registered: Dec 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by KenJackson View Post
Do you mean the UART reports a framing error?

One thing that could cause that is disabling the transmitting UART between packets while it's attempting to transmit whatever padding or filler bytes you might be sending (or maybe even during the final stop bit). Or even more likely, disabling whatever logic is between the transmitting and receiving UARTs.

If that's what's happening, it can be solved by putting a short delay after the packet is transmitted but before anything is disabled.

But if you're transmitting a frame-check value (CRC or checksum) with each packet, you can safely ignore all UART errors. If the receiving process recalculates the frame-check and it matches, then the packet is good regardless of what the UART gripes about.
Yes, I meant UART reports a framing error!....transmission application is not supposed to be changed, and it does not have any CRC included, and there is around 300ms of delay for every 200 bytes of transmission!
 
Old 12-23-2012, 10:39 PM   #6
linxquest
LQ Newbie
 
Registered: Dec 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by theNbomr View Post
Framing errors generally mean that a stop bit was expected, but not found. There can be a number of causes, most of which are configuration errors. If the sender and receiver do not agree about the format of the data, it is easy to cause framing errors. You have stated a bitrate (1200 bps), but not the rest of the data format. There is word size, (almost always 8 or 7 bits), parity type, if any, and number stop bits. Make sure both ends of the communications channel are using the same configuration.
It is also possible that the data actually is getting corrupted on the wire. This can result from improper cabling, failing transmitter or receiver electronics, or external noise sources. Do you have a ground pin connecting the two hosts/devices? One of the devices may have a faulty timing source (usually a crystal, or an oscillator on-board the CPU). The clocks of both transmitter & receiver must be in agreement or the receiver will see an invalid bit where it expects to see a stop bit. If this is the case, it should be easier to reproduce the fault when sending certain bytes, but not so easy with other bytes. If you are able to control the byte stream in both directions, try sending streams of data and compile some statistics about which bytes cause more errors. If there is a big spike in the number of occurrences for certain bytes, it could point to timing problems.
--- rod.
Hello rod, firstly, the data format has 10 bits, i.e 1 startbit,8 data bits,1 stopbit...in total 10 bits...both transmitting and receiving side
has 1200 baud rate, infact i am receiving the exact data,but sometimes in between receiving UART throws "over fram error"...I don't think in this case
there might be a problem with cables, because same cables i've been using for testing purpose, it is not giving
any problem!
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need another pair of eyes (BASH script throwing a "s-e-n-u-t" error) SilversleevesX Linux - Newbie 6 11-17-2011 09:52 AM
Sendmail unable to start "throwing Error Messeges" sachin_shetty Linux - Server 9 04-08-2011 01:45 PM
LXer: Sheep-Throwing Marsupial in the "Yo Frankie" Game LXer Syndicated Linux News 0 11-20-2008 10:20 PM
kernel compilation:throwing error related with sound during "make bzImage" b0nd Linux - Newbie 1 08-19-2005 09:16 AM
How do I get "Fram Relay"? RHLinuxGUY Linux - Networking 3 08-29-2004 03:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:17 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration