UART ttyS2 on RockPro64 for custom communication
#1
I am looking to attach a custom PCB to the RockPro64 board, a simple extension board with custom firmware that communicates over UART.

Up until now I have no luck getting even a basic two-way communication over UART2 working.

Steps taken:
* The RockPro64 runs on Armbian Ubuntu 18.04
* The RP64 is connected to a Ubuntu Laptop with the Pine64 UART-USB adapter. Due to voltage issues, we regulated the TXD and RTX pins to exactly 3.3V (see schematic attached). Bidirectional communication works fine for the serial login prompt.
* Serial console on ttyS2 is now disabled. We get some Uboot messages on boot, after that the port is silent
* picocom is running both on the RP64 (over SSH) and on the Ubuntu laptop

Expected result:
* Both machines should be able to communicate usint picocom, if started e.g. like `picocom -b 1500000 /dev/ttyS2`

Actual result:
* The RP64 is able to output some characters unreliably to the laptop
* The laptop cannot send any characaters to the RP64, instead mirroring some <?> characters despite local echo off

Some status logs:
Code:
$ dmesg | grep tty
[    0.000000] Kernel command line: earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1 no_console_suspend=1 usbcore.autosuspend=-1 root=UUID=4e0c7993-7cbb-46f7-acd0-2e3acdfa20ef rootwait rootfstype=ext4 console=tty1 panic=10 consoleblank=0 loglevel=1 ubootpart=350ce75a-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u   cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
[    0.001397] console [tty1] enabled
[    0.328959] Registered FIQ tty driver
[    1.945780] ff180000.serial: ttyS0 at MMIO 0xff180000 (irq = 36, base_baud = 1500000) is a 16550A
[    1.946282] ff1a0000.serial: ttyS2 at MMIO 0xff1a0000 (irq = 37, base_baud = 1500000) is a 16550A
[    4.946846] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   15.681434] ttyS2 - failed to request DMA, use interrupt mode

$ sudo setserial -g /dev/ttyS[0123]
/dev/ttyS0, UART: 16550A, Port: 0x0000, IRQ: 36
/dev/ttyS2, UART: 16550A, Port: 0x0000, IRQ: 37

Does anyone have an idea what I am doing wrong?

Best,
Meier


Attached Files
.png   voltage_decrease_diagram_UART_1.png (Size: 56.46 KB / Downloads: 386)
#2
1) > We get some Uboot messages on boot, after that the port is silent.

There may be a bug.
You should try to another image from the location shown in the following url.
If it works as expected, the problem you pointed out is a kernel bug.

For example,
https://dl.armbian.com/rockpro64/archive/
Armbian_5.67_Rockpro64_Ubuntu_bionic_default_4.4.166.7z
or
https://github.com/ayufan-rock64/linux-b...oad/0.8.3/
bionic-minimal-rockpro64-0.8.3-1141-arm64.img.xz
or etc.

2) > Due to voltage issues, we regulated the TXD and RTX pins to exactly 3.3V (see schematic attached).

Is the product that you pointed out the problem listed below ?
https://store.pine64.org/?product=padi-serial-console

If it is not a defective product and the output signal of a good product is 3.8v, it is a terrible product.

In the presented schematic, you can use resistor splitting to solve the problem,
but if you choose a resistor value that is higher than necessary, the problem arises.
The presence or absence of harmful effects depends on the parasitic capacitance due to the wiring length.
I think it is better to choose a value (220Ω / 1KΩ) that is about 1/100 of the resistance value of the circuit diagram that you presented.
#3
Thumbs Up 
Quote:1) > We get some Uboot messages on boot, after that the port is silent.

There may be a bug.
You should try to another image from the location shown in the following url.
If it works as expected, the problem you pointed out is a kernel bug.

Thanks for the quick answer. Seems like it works as expected after all, I just forgot to stop "agetty" from launching and creating a login-prompt on ttyS2, eating up all the packets... We did "systemctl stop serial-getty@ttyS2" to disable it temporarily and then picocom worked as expected.

Do you think there's more to it than that?

Quote:2) > Due to voltage issues, we regulated the TXD and RTX pins to exactly 3.3V (see schematic attached).

Is the product that you pointed out the problem listed below ?

Yes, that is the product and judging by the problems people describe in forums, with the board crashing on boot when connected (exactly what we experienced), this does not seem to be an exception. See picture attached.

Thanks again, will take a closer look at your electronics details as well with some colleagues.


Attached Files
.jpg   voltage_reading_pine64_uart_usb_adapter.jpg (Size: 171.79 KB / Downloads: 378)


Possibly Related Threads…
Thread Author Replies Views Last Post
  Powering on the Rockpro64 JPT223 1 826 09-24-2023, 12:23 PM
Last Post: hoarfrosty
  ROCKPro64 Battery Power Supply hoarfrosty 11 1,631 09-23-2023, 04:17 PM
Last Post: hoarfrosty
  ROCKPro64 with 16 ports SATA controller ZeblodS 19 25,271 12-18-2022, 06:25 PM
Last Post: heyghoge
  Using RPI hat on RockPro64? misterc 0 798 12-16-2022, 02:05 PM
Last Post: misterc
  GPIO on the RockPro64 - all pins high? colinmarc 2 1,524 11-18-2022, 10:20 AM
Last Post: colinmarc
  ROCKPro64 DOA ajtravis 8 6,358 11-08-2022, 03:40 AM
Last Post: ajtravis
  RockPro64 not booting up mvicha@gmail.com 0 1,093 09-19-2022, 07:35 AM
Last Post: mvicha@gmail.com
  GPIO Expander HAT for ROCKPro64 and Quartz64 CounterPillow 7 5,193 07-18-2022, 10:05 PM
Last Post: zer0sig
  RockPro64 premium aluminium casing justwantin 2 2,073 05-27-2022, 06:51 PM
Last Post: justwantin
  charging 3 rockpro64 from single source rpt312 1 1,667 05-16-2022, 02:34 AM
Last Post: dukla2000

Forum Jump:


Users browsing this thread: 1 Guest(s)