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
  Reply
#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
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  New OS for RockPro64 is here, Armbian-Reforged V1.0 jtremblant 37 2,955 Yesterday, 04:31 AM
Last Post: jtremblant
Question Mainline Debian Buster on RockPro64 ? chrestomanci 31 7,145 01-09-2021, 03:07 PM
Last Post: kuleszdl
  Chromium OS for the RockPro64 is now available! Luke 9 3,858 01-09-2021, 12:13 PM
Last Post: Ruben
  slarm64 (unofficial slackware) ROCKPro64 RK3399 (aarch64) mara 39 15,416 01-08-2021, 01:45 PM
Last Post: mara
  slave mode on Rockpro64 Radhika.gabani 0 180 01-07-2021, 03:31 AM
Last Post: Radhika.gabani
  Armbian images available Luke 44 21,425 12-28-2020, 04:14 AM
Last Post: NightCrawler504
  DietPi OS for ROCKPro64 MichaIng 6 441 12-25-2020, 03:24 PM
Last Post: MichaIng
Question Help getting a GPU running on my RockPro64 Ceazer 0 238 11-23-2020, 04:05 PM
Last Post: Ceazer
  RockPro64 eMMC mrfixit to 5.9 rthorntn 1 450 10-27-2020, 07:09 PM
Last Post: rthorntn
Question Ayufan RockPro64 updates? hemertje 3 871 10-22-2020, 01:16 PM
Last Post: dukla2000

Forum Jump:


Users browsing this thread: 1 Guest(s)