Accessing UART4 on RockPro64 (Armbian)
Hi there! I am trying to set up communication between an Attiny85 and my RockPro64 over UART (running Armbian, kernel `Linux rockpro64 5.7.15-rockchip64 #20.08 SMP PREEMPT Mon Aug 17 00:26:28 CEST 2020 aarch64 aarch64 aarch64 GNU/Linux`). The issue is that I can't connect to the serial port:

rock64@rockpro64:~$ sudo picocom -b 115200 /dev/ttyS4
[sudo] password for rock64:
picocom v3.1

port is        : /dev/ttyS4
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
hangup is      : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        :
omap is        :
emap is        : crcrlf,delbs,
logfile is     : none
initstring     : none
exit_after is  : not set
exit is        : no

FATAL: failed to add port: Filedes is not a tty

I can see that UART4 is not initialized on boot:

rock64@rockpro64:~$ dmesg | grep tty
[    0.000000] Kernel command line: mmc_cmdqueue=0 earlycon=uart8250,mmio32,0xff1a0000 root=UUID=73fac48d-4f73-4ac1-b899-e67dc98b5794 rootwait rootfstype=ext4 console=ttyS2,1500000 console=tty1 consoleblank=0 loglevel=1 ubootpart=f499ef85-01 usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u   cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
[    0.001600] printk: console [tty1] enabled
[    4.089584] ff180000.serial: ttyS0 at MMIO 0xff180000 (irq = 38, base_baud = 1500000) is a 16550A
[    4.089974] serial serial0: tty port ttyS0 registered
[    4.091686] ff1a0000.serial: ttyS2 at MMIO 0xff1a0000 (irq = 39, base_baud = 1500000) is a 16550A
[    4.092153] printk: console [ttyS2] enabled
[   10.755654] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   14.723780] systemd[1]: Found device /dev/ttyS2.
Even though it is enabled as an overlay:

rock64@rockpro64:~$ cat /boot/armbianEnv.txt

If this is helpful - here are some details about my setup:

An Attiny85 is powered from a 3V coin cell. Here is the wiring:
  • Battery positive - Attiny85 pin 8
  • Battery negative - Attiny85 pin 4 - RockPro64 ground on GPIO pin 6
  • Attiny85 pin 6 (PB1) - RockPro64 UART4_RX on GPIO pin 21 (connected through a 1K current-limiting resistor)
  • UART4_TX is not connected because currently I only need unidirectional communication
I used Arduino IDE with a USBtinyISP programmer to program my Attiny85 with the following test code:

#include <SoftwareSerial.h>

#define RX 0
#define TX 1

SoftwareSerial serial(RX, TX);

void setup() {
  // put your setup code here, to run once:

void loop() {
  // put your main code here, to run repeatedly:

Is there any way I can fix this issue? Are there any other easy-to-use alternatives to UART for establishing bidirectional communication? Any help is appreciated!


I have just found a solution. In case anyone is interested, here is the link:
- In order to make the UART4 overlay load, I had to erase the SPI flash and boot directly from the eMMC because SPI1 and UART4 share the same pins
- If you are using the SoftwareSerial library on an Arduino or something similar, you need to use lower baud rates (e. g. 9600) to make the communication reliable

Possibly Related Threads…
Thread Author Replies Views Last Post
  slarm64 (unofficial slackware) ROCKPro64 RK3399 (aarch64) mara 44 24,040 06-20-2021, 06:09 AM
Last Post: mara
  New OS for RockPro64 is here, TwisterOS Armbian jtremblant 82 16,784 06-17-2021, 04:14 PM
Last Post: jtremblant
  RockPro64 CRUX-ARM (aarch64) mara 0 126 06-05-2021, 11:29 AM
Last Post: mara
  Power supply underpowered for Rockpro64, deficient PCIe SATA card, or something else? daffy 8 457 05-20-2021, 10:04 PM
Last Post: t4_4t
  Armbian images available Luke 52 31,731 04-26-2021, 03:16 AM
Last Post: Wizzard
Question My Rockpro64 stopped booting with these error messages please help seaurchin 4 689 02-18-2021, 04:27 PM
Last Post: TRS-80
  Rockpro64 not stable... crashes now and then. Pineapple 18 6,951 02-16-2021, 02:45 PM
Last Post: TRS-80
Question Mainline Debian Buster on RockPro64 ? chrestomanci 36 14,423 02-14-2021, 02:37 PM
Last Post: foresto
  with armbian. my boad seems alive LMM 0 290 02-11-2021, 03:24 PM
Last Post: LMM
  Alpine on RockPro64 mutemule 0 417 02-05-2021, 10:10 AM
Last Post: mutemule

Forum Jump:

Users browsing this thread: 1 Guest(s)