Hi,
I use BPI-M2-zero with Armbian (latest from download section, archive folder). There is my CLI tool that uses libmodbus over UART3 (RTU mode) for communication with some modbus device.
I enabled debug mode in libmodbus and I often observe errornous reception of 5 zeros on that uart instead of correct message:
Opening /dev/ttyS3 at 115200 bauds (N, 8, 1)
[01][11][C0][2C]
Sending request using RTS signal
Waiting for a confirmation...
<00><00><00><00><00>
ERROR CRC received 0x0 != CRC calculated 0x71C0
I checked the input on UART3_Rx with logic analyser and the contents is correct. In the digital signal domain there is no differences in codes or timings comparing to the correct reception.
I also performed the same test on Raspberry-Pi Zero W and there is no such problems.
I browsed libmodbus source code and there is nothing special, just writing to file, here /dev/ttyS3 device, so probably the problem comes from kernel module that is responsible for serial devices.
Before I dig into kernel I would like to ask:
does anyone experience similar issues?
are there any reports of hardware issues with UARTs in Allwinner H2+ that is a base of Banana Pi M2 zero?
Today I found that sometimes output data has different baudrate (9600) and changed contents to “^\r” (5E 0D). It looks like something else is using this uart too [?]
I am surprised by the solution (or something that removes unwanted behavior):
just added to /boot/armbianEnv.txt:
param_uart3_rtscts=1
It is the configruation line that enables usage RTS and CTS in uart driver.
No extra zeros, or 5E0D.
I observed that problem does not apper when I execute commands from serial console (ttyS0) but when I use ssh (i.e. virtual console) or start commands from PHP it was present.
Regards,
Piotr Romaniuk
PS
Please don’t forget to connect uart3cts line to uart3rts! Otherwise no characters will be transmitted.
Thanks for reply, It works now.
Another question, how can I make a overlay-fs on m2z? On Raspiberry zero there is a overlay fs option in the raspi-config tool, I tried many third-party scripts but none of them works…
hello friend romaniuk,
could you tell me the image Armbian Ubuntu Minimal stable without bug on the UART3 serial port?
Here is what happened on my Modbus UART3 Slave after 1 day of operation using an Armbian Ubuntu image.
After almost 1 day of serial communication functioning test with my slave machine (I still use the old Armbian Minimal Focal image - 21.11.0-trunk for now) the UART3 serial port on the banana pi M2 Zero - UART3 /dev/ttyS3 port not there is more track (GPIO pin: 8,10).
Python Serial Exception Raised:
serial.serialutil.SerialException: Could not configure port: (5, ‘Input / output error’)
I restarted the banana pi Zero, tried all the commands:
dmesg | grep tty
lsof /dev/ttys3
sudo ls -l /proc/[0-9]/fd/ |grep /dev/ttyS3
…
but no more traces of the ttyS3 UART3 port yet, the other serial ports have all suddenly broken as well.
Working now only my UART0 port /dev/ttyS0 which is the programming port of the banana pi zero.
After formatting and rewriting the Armbian Focal Mininmal image on the microSD again the ttyS3 UART3 port has started working again but I’m afraid it will soon break again.
Do you have any information on this? How to solve this problem?
Armbian Focal Trunk Realise image used:
Armbian 21.11.0-trunk Focal with Linux 5.15.25-sunxi