Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: schlabs on September 29, 2017, 05:51:56 PM

Title: clock stability or wrong baudrate
Post by: schlabs on September 29, 2017, 05:51:56 PM
I am using a A20 with the following features:
-Debian Linux
-Sata hard disk
-wifi adapter ( as hotspot)
-UART1: /dev/ttyS1 with a GPS module working at 9600/8/n/1 baud.
-UART2: /dev/ttyS2 with a custom hardware working at 230400/8/n/1

All working fine. but yesterday i get a problem. i get missing characters:
For example into /dev/ttyS1 i receive:
$GPGGA,030,,0,0,,,M,$GPRMC,030,,,,0.00,0,,,N*45
The right data frame is (red is the missing and \n\r are 13 and 10 ascii numbers):
$GPGGA,030810.000,,0,0,,,M,,M,,*44\n\r$GPRMC,030810.000,,,,0.00,0,,,N*45

This failure was continued on both UARTs.
The reader process take only 7% of cpu writted in perl.

All seem like the clock on A20 UARTs are running out of range, but close to the required frequency.
Any clue will be appreciated.
Title: Re: clock stability or wrong baudrate
Post by: JohnS on September 29, 2017, 10:40:41 PM
Make sure you're using an Olimex-supplied Linux and that there are for example no processes with those ports open (getty/login/etc).

John
Title: Re: clock stability or wrong baudrate
Post by: schlabs on September 30, 2017, 01:42:35 AM
Thanks you. The linux is the official Olimex debian, and:

$ ps ax |grep getty
354 tty1     Ss+    0:00 /sbin/agetty --noclear tty1 linux
360 ttyS0    Ss+    0:00 /sbin/agetty --keep-baud 115200 38400 9600 ttyS0 vt102

$ ps ax |grep login
311 ?        Ss     0:00 /lib/systemd/systemd-logind

$ lsof | grep "/dev/tty"
[nothing listed]

I start my process and:
$ lsof | grep "/dev/tty"
drv.pl    5929           gipic    4u      CHR       4,65      0t0    65 /dev/ttyS1
drv.pl    5929           gipic    5u      CHR       4,66      0t0    66 /dev/ttyS2

So i think that only i am using the ports.

Today work fine with no error and nothing changed. thanks you for the help,
Title: Re: clock stability or wrong baudrate
Post by: schlabs on October 06, 2017, 08:34:14 PM
The theme was partially solved. Seem like a bug into serialPerl module. I will search more deeply i this direction. Thanks you everyone.
Title: Re: clock stability or wrong baudrate
Post by: p0man on October 27, 2017, 01:48:36 PM
actual measured bitrate is 213675