Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
04-17-2009, 09:52 AM
|
#1
|
LQ Newbie
Registered: Apr 2009
Posts: 13
Rep:
|
Serial issues on an embedded Linux platform
I've written an application which deals with NMEA sentences for my 5HZ GPS module.
It worked for a while, but now it doesn't.
When I run the GPS module through Minicom I receive the correct results:
Code:
$GPVTG,51.99,T,,M,0.48,N,0.88,K,A*05
$GPGGA,133837.000,5130.9991,N,00232.4986,W,1,7,1.01,68.2,M,48.9,M,,*72
$GPRMC,133837.000,A,5130.9991,N,00232.4986,W,0.53,51.99,170409,,,A*47
$GPVTG,51.99,T,,M,0.53,N,0.97,K,A*01
$GPGGA,133837.200,5130.9991,N,00232.4985,W,1,7,1.01,68.2,M,48.9,M,,*73
$GPRMC,133837.200,A,5130.9991,N,00232.4985,W,0.51,51.99,170409,,,A*44
$GPVTG,51.99,T,,M,0.51,N,0.94,K,A*00
$GPGGA,133837.400,5130.9991,N,00232.4985,W,1,7,1.01,68.2,M,48.9,M,,*75
$GPGSA,A,3,08,04,25,02,10,24,13,,,,,,1.37,1.01,0.92*00
$GPGSV,3,1,11,07,61,116,,25,54,073,19,02,48,240,35,13,45,065,18*70
$GPGSV,3,2,11,08,39,175,17,10,38,296,39,04,29,193,25,23,14,070,*72
$GPGSV,3,3,11,24,11,324,21,16,10,027,,29,09,321,*48
$GPRMC,133837.400,A,5130.9991,N,00232.4985,W,0.60,51.99,170409,,,A*40
$GPVTG,51.99,T,,M,0.60,N,1.11,K,A*0E
So I'm happy that everything is working correctly from the GPS module to the end of the serial cable.
However when I run it on my development board, I receive mostly garbage.
Code:
fORGSV,;.:,qs.q0nvr,��i+�7�5sn�v7<>1<,:=-3{r.2;-2<-9,OXRMSn1;6�99n<84,I,=1sA
6W�GS��s<sl31n2sn9p<0w2.,r;,19�397,����v-8:n�rs<*�w
$GPRMC,134911.600,A,5130.9997,N,00232.5056,W,0.00,51.99,170409,,,A*46
$GPVTG,51.99,T,,M,0.00,N,0.00,K,A*09
$GPGGA,134911.800,5130.9997,N,00232.5056,W,1,7,1.22,66.2,M,48.9,M,,*74
$GPRMC,134911.800,A,5130.9997,N,00232.5056,W,0.00,51.99,170409,,,A*48
$GPVTG,51.99,T,,M,0.00,N,0.00,K,A*09
&GtggE,n&ڊ�v���t,Ol&d����fv.006&�����b���f�f��nv7$v6.2lD,<<.=,M,,.7e 9
�4GROOAlssv�srn6�8l=9;8.999?-O,8prs25rw�nW-q,7n1n:rn�R.�~O�vz>{.].nj7BC#�V 7
RG�O�V<3l3n11,3s.11,�7�nn2{<r9n{9?l22nsR-0x��K%OOC!YV��]Cn334{1r�5p0,I,53s�?
I wouldn't mind so much if it printed garbage ALL the time, but it doesn't.
Every now and again it churns out perfectly viable data.
I am running Linux and a bare-bones system i.e. compiled kernel and Busybox on my Olimex EP9302.
I have been playing around with the getty settings in /etc/inittab, but to no avail.
I've tried each of these:
Code:
console::respawn:/sbin/getty -L 38400 /dev/ttyAM1 vt100
console::once:/sbin/getty -L 38400 /dev/ttyAM1 vt100
console::once:/sbin/getty -L 38400 /dev/ttyAM1 vt102
getty -L -n 38400 /dev/ttyAM1 vt100
getty -L -l /home/username/null_login 38400 /dev/ttyAM1 vt102
Some work better than others, some do not work at all.
As I say, it's very annoying because all this worked not long ago and I can't think what I might have changed to upset it.
Does anyone have any ideas to poke me in the right direction, for I'm all out!
|
|
|
04-17-2009, 06:09 PM
|
#2
|
Member
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493
Rep:
|
not totally sure, you didn't run minicom from your development board, isn't it? If so try to run it from your development board. If minicom print garbage char too, maybe there's a hardware problem on the UART.
Try to check NMEA checksum, to be sure it's not the console displaying...
If there's parity check (but I don't think so in NMEA format), enable it to with "set_iflag (port, IGNPAR, 0)".
Pull and shake the cable since a bad connection is possible too.
|
|
|
04-17-2009, 07:33 PM
|
#3
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,196
|
This looks like a hardware problem.
Either the cable, voltage levels, grounding or the UART, OR the clock rate is off.
In the early days we used to have crystals on the board which sometimes started to oscillate in 3rd overtone, and that made all clock frequencies off by a factor 3.
Try to compare the ASCII codes from erraneous bytes or characters against the characters which should have been received. Maybe you can discover a pattern, for example, the 7th bit is always high, or instead of 01010101 the character you received is 10101010 (start bit problem) or 00110011 (clock problem)
It is about as much fun as sudoku.
jlinkels
|
|
|
04-18-2009, 01:53 AM
|
#4
|
LQ Newbie
Registered: Apr 2009
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by jf.argentino
not totally sure, you didn't run minicom from your development board, isn't it? If so try to run it from your development board. If minicom print garbage char too, maybe there's a hardware problem on the UART.
Try to check NMEA checksum, to be sure it's not the console displaying...
If there's parity check (but I don't think so in NMEA format), enable it to with "set_iflag (port, IGNPAR, 0)".
Pull and shake the cable since a bad connection is possible too.
|
This is a much more productive reply from yourself, thank you!
No, I didn't run Minicom from the development board, it wouldn't be able to support it.
I have, however, run Microcom and the same issue surfaces.
I'm reasonably certain that my application is sound anyway; as I have compiled an x86 version which works swimmingly on my development machine.
With regard to the NMEA sentence, it does provide a checksum and I do check for it, but it fails.
No parity checking unfortunately.
Quote:
Originally Posted by jlinkels
This looks like a hardware problem.
Either the cable, voltage levels, grounding or the UART, OR the clock rate is off.
In the early days we used to have crystals on the board which sometimes started to oscillate in 3rd overtone, and that made all clock frequencies off by a factor 3.
Try to compare the ASCII codes from erraneous bytes or characters against the characters which should have been received. Maybe you can discover a pattern, for example, the 7th bit is always high, or instead of 01010101 the character you received is 10101010 (start bit problem) or 00110011 (clock problem)
It is about as much fun as sudoku.
jlinkels
|
I like Sudoku! =;-)
After further investigation, I'm fairly sure this issue lies in the configuration of the UART's AMBA driver.
Depending on how I call getty in inittab has a huge effect on just how much of the sentence is displayed as it should be.
Since this issue, I have installed serial->USB->serial drivers within the kernel - things are looking up. =:-)
|
|
|
All times are GMT -5. The time now is 08:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|