errors when sending on 1000000 baud uart

Bug #1721462 reported by Domen Kern
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raspbian
New
Undecided
Unassigned

Bug Description

We are having problems establishing an error free serial uart communication on the Rpi 3.
The speed must be 1000000 baud.

It does not matter if you use 2 rpis or a simple loopback on one. First we received errors (ommited characters) on the receiving end. This was fixed by using RTSCTS flow control.
Now there are still errors, but only when sending data through the rpi. For test we also sent data using an st-micro board and everything was fine.
So the problem is on the tx end of the raspberry pi.
We tried this with java, c and python.

If the rpi is not doing heavy work the errors are rare, but they are there.
To increase the number of errors the simple way is to start chromium, load a javascript heavy page and hit refresh a couple of times.

Steps to reproduce on a fresh Strech install with java.

We are disabling bluetooth and using ttyAMA0.

- Disable console through raspi-config.
- copy pi3-disable-bt overlay to /boot/overlays
- edit /boot/config.txt, relevant lines:

    enable_uart=1
    dtoverlay=pi3-disable-bt
    init_uart_clock=16000000

Connect pins:
uart rx to tx and rts to cts.

install wiringpi
$sudo apt-get install wiringpi
Set pins for rtscts using wiringpi:
$gpio -g mode 16 alt3
$gpio -g mode 17 alt3

install java:

$sudo apt-get install oracle-java8-jdk librxtx-java

set alias for the rxtx library:

$sudo ln -s /dev/ttyAMA0 /dev/ttyS80

 Compile and run the file (in attachement):

$javac -cp /usr/share/java/RXTXcomm.jar:. TwoWaySerialComm.java

$java -Djava.library.path=/usr/lib/jni -cp /usr/share/java/RXTXcomm.jar:. TwoWaySerialComm

if everything is running, the output should be empty, otherwise, errors are printed.

Stop the program with ctrl-c.

This is for a loopback test, if using 2 rpis, comment out the relevant send/receive code in the java program on the corresponding pi.

Tags: uart
Revision history for this message
Domen Kern (deerage) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.