Unexpected zeros on UART3 in BPI-M2 Zero

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:

  1. does anyone experience similar issues?
  2. are there any reports of hardware issues with UARTs in Allwinner H2+ that is a base of Banana Pi M2 zero?

Kind regards,

Piotr Romaniuk

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.

I’m using raspbian but the uart3 not working at all… Any suggestion?

Hi,

is it enabled in /boot/config.txt?

Regards,

Piotr Romaniuk

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…

Please create another thread about overlay-fs in this forum with your question, it is not related to uart3 discussion issue.

Another programmers would read it then, and maybe help.

OK, thank you very much.