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
Question Mainline Debian Buster on RockPro64 ? chrestomanci 17 3,063 3 hours ago
Last Post: n4tter4ngell
  slarm64 (unofficial slackware) ROCKPro64 RK3399 (aarch64) mara 34 10,462 9 hours ago
Last Post: janv
Question Ayufan RockPro64 updates? hemertje 0 163 10-18-2020, 04:00 AM
Last Post: hemertje
Thumbs Up Batocera for RockPro64 Luke 11 4,440 09-18-2020, 01:52 AM
Last Post: Wizzard
  First Lakka image for ROCKPro64 Ntemis 12 4,811 09-18-2020, 01:50 AM
Last Post: Wizzard
  Armbian images available Luke 43 15,381 09-17-2020, 04:49 AM
Last Post: Wizzard
  Problems with my RockPro64 tuxd3v 0 244 08-19-2020, 11:47 AM
Last Post: tuxd3v
  Arch Linux on RockPro64 mmatyas 30 15,281 05-30-2020, 12:08 PM
Last Post: mmatyas
  Rockpro64 panfrost installation questions user12321 2 699 05-27-2020, 10:17 AM
Last Post: xmixahlx
  UART4 in Debian Desktop Release of Mrfixit2001 Gienek 1 433 05-19-2020, 02:47 AM
Last Post: Gienek

Forum Jump:

Users browsing this thread: 1 Guest(s)