Accessing UART4 on RockPro64 (Armbian)
#1
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:

Code:
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:

Code:
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:

Code:
rock64@rockpro64:~$ cat /boot/armbianEnv.txt
verbosity=1
bootlogo=false
overlay_prefix=rockchip
rootdev=UUID=73fac48d-4f73-4ac1-b899-e67dc98b5794
rootfstype=ext4
overlays=uart4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u




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:

Code:
#include <SoftwareSerial.h>

#define RX 0
#define TX 1

SoftwareSerial serial(RX, TX);

void setup() {
  // put your setup code here, to run once:
  serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  serial.println("ping");
}


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!



Thanks,

Anton
#2
I have just found a solution. In case anyone is interested, here is the link: https://forum.armbian.com/topic/15419-ac...rockpro64/.
TLDR:
- 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
  irradium (based on crux linux) RockPro64 riscv64, aarch64 mara 7 2,103 11-20-2024, 03:53 PM
Last Post: mara
  New OS for RockPro64 is here, TwisterOS Armbian jtremblant 92 108,399 08-17-2024, 02:32 PM
Last Post: taltamir
  OpenEuler OS on RockPro64 Yuriy Gavrilov 0 340 06-15-2024, 09:38 AM
Last Post: Yuriy Gavrilov
  yocto for RockPro64 Fide 1 1,169 01-16-2024, 10:01 AM
Last Post: Fide
  Installing Ubuntu Server on RockPro64 deutschlmao 2 3,599 10-29-2023, 04:43 PM
Last Post: brotherj4mes
  Vanilla mainline Debian 11 (Bullseye) on the RockPro64 Pete Tandy 22 22,051 08-16-2023, 01:34 AM
Last Post: varac
  slarm64 (unofficial slackware) ROCKPro64 RK3399 (aarch64) mara 54 94,339 08-11-2023, 11:13 AM
Last Post: mara
  How to enable CoreSight ETM trace on RockPro64 shpark 0 904 05-21-2023, 11:34 PM
Last Post: shpark
  Rockpro64 Dead on arrival? quixoticgeek 1 1,452 03-12-2023, 06:55 PM
Last Post: quixoticgeek
  RockPro64 boot questions misterc 3 2,421 01-13-2023, 06:21 PM
Last Post: misterc

Forum Jump:


Users browsing this thread: 1 Guest(s)