Have tried both with core_freq=250 using dtoverlay=pi3-miniuart-bt-overlay and also not.
Have d/l'd minicom, raspi-config'd my serial (shell no, hw enable yes), looped pins 8 & 10, and ran:
Code: Select all
minicom -D /dev/serial0
Found and saved a serial test program:
Code: Select all
#!/usr/bin/env python
# Serial port testing: Jumper GPIO14 (Pin 8) and GPIO15 (Pin 10) - you should get data received in this loopback config.
import serial
test_string = "Testing 1 2 3 4"
port_list = ["/dev/serial0", "/dev/serial0", "/dev/ttyS0", "/dev/ttyS0"]
for port in port_list:
try:
serialPort = serial.Serial(port, 115200, timeout = 2)
print "Opened port", port, "for testing:"
bytes_sent = serialPort.write(test_string)
print "Sent", bytes_sent, "bytes"
loopback = serialPort.read(bytes_sent)
if loopback == test_string:
print "Received", len(loopback), "valid bytes, Serial port", port, "working \n"
else:
print "Received incorrect data", loopback, "over Serial port", port, "loopback\n"
serialPort.close()
except IOError:
print "Failed at", port, "\n"
Code: Select all
python loopback.py
Opened port /dev/serial0 for testing:
Sent 15 bytes
Received incorrect data Testing 1 over Serial port /dev/serial0 loopback
Opened port /dev/serial0 for testing:
Sent 15 bytes
Received incorrect data Testing 1 over Serial port /dev/serial0 loopback
Opened port /dev/ttyS0 for testing:
Sent 15 bytes
Received incorrect data Testing 1 over Serial port /dev/ttyS0 loopback
Opened port /dev/ttyS0 for testing:
Sent 15 bytes
Received incorrect data Testing 1 over Serial port /dev/ttyS0 loopback
So. Minicom works. Proper pins are looped back. Results are same regardless of overlay or core_freq settings in /boot/config.txt
Puzzled...... Why would it only take PART of the data? Can anyone offer any ideas?
To further test, I edited the test string down to just "Testing 1" and ran the script. Output perfect:
Code: Select all
Opened port /dev/serial0 for testing:
Sent 9 bytes
Received 9 valid bytes, Serial port /dev/serial0 working
Opened port /dev/serial0 for testing:
Sent 9 bytes
Received 9 valid bytes, Serial port /dev/serial0 working
Opened port /dev/ttyS0 for testing:
Sent 9 bytes
Received 9 valid bytes, Serial port /dev/ttyS0 working
Opened port /dev/ttyS0 for testing:
Sent 9 bytes
Received 9 valid bytes, Serial port /dev/ttyS0 working
Dave