UART2 is busy. UART4 does not works

Today I get this powerful computer and I must say that works so far so good except one thing. I use RockPi as companion computer which communicates over UART with a microcontroller. I installed these packages:

 $ sudo apt-get update
 $ sudo apt-get install rockchip-fstab
 $ sudo apt-get install rockpi4-dtbo

then I edited /boot/hw_intfc.conf:

# Hardware Interface Config

# For more details, check https://wiki.radxa.com/Rockpi4/hardware/devtree_overlays.

# Set "on" to enable the optional hardware interfaces while set "off" to disable.

intfc:pwm0=off

intfc:pwm1=off

intfc:uart2=on

intfc:uart4=off

intfc:spi1=off

intfc:spi2=off

intfc:i2c2=off

intfc:i2c6=off

intfc:i2c7=off

# Devicetree Overlay Enable, uncomment to enable .dtbo under /boot/overlays/.

# EEPROM on I2C2

intfc:dtoverlay=at24c02

# Serial console on UART2

#intfc:dtoverlay=console-on-ttyS2

# Serial console on UART4

#intfc:dtoverlay=console-on-ttyS4

# Dummy spi device on SPI1 for test. Need set: intfc:spi1=on

#intfc:dtoverlay=devspi1

# Dummy spi device on SPI2 for test. Need set: intfc:spi2=on

#intfc:dtoverlay=devspi2

# PCIE running on GEN2 mode

#intfc:dtoverlay=pcie-gen2

# ALLNET 4duino B10/B11 two-coloe-led module on 40-pin Header Pin#35 and Pin#36

#intfc:dtoverlay=two-color-led

# waveshare 3.5inch lcd (B v2) on SPI1. Need set: intfc:uart4=off and intfc:spi1=on

#intfc:dtoverlay=spi1-waveshare35b-v2

# waveshare 3.5inch lcd (C) on SPI1. Need set: intfc:uart4=off and intfc:spi1=on

#intfc:dtoverlay=spi1-waveshare35c

problem is that python throws this error. I think that debug on uart2 is still active.

serial.serialutil.SerialException: [Errno 16] could not open port /dev/ttyS2: [Errno 16] Device or resource busy: ‘/dev/ttyS2’

Maybe the console shifts after uboot but uboot is fixed to ttyS2.
I am sure I saw a dtc overlay to turn the console off but just been looking and can find it.
I am running manjaro at the moment but seem to remember the kernel parameter was ttys0 and is part of the boot config so maybe check there also.

I have a serial console but manjaro do have it set to ttyS2

Hi, I would suggest you to update these packages including rockchip-overlay, u-boot, kernel and rockpi4-dtbo, etc.

Hi! I solved this problem.
We can enable uart function in startup settings, enable uart overlay you want to use.

I believe this works for all rock cards.

Find all available uart peripherals executing this command:

find /boot/dtbs/4.4.143-55-rockchip-g6b7accbc999b/rockchip/ | grep uart

the output is similiars with this:
root@rockpis:/# find /boot/dtbs/4.4.143-55-rockchip-g6b7accbc999b/rockchip/ | grep uart
/boot/dtbs/4.4.143-55-rockchip-g6b7accbc999b/rockchip/overlay/rk3308-console-on-uart0.dtbo
/boot/dtbs/4.4.143-55-rockchip-g6b7accbc999b/rockchip/overlay/rk3308-console-on-uart1.dtbo
/boot/dtbs/4.4.143-55-rockchip-g6b7accbc999b/rockchip/overlay/rk3308-console-on-uart2.dtbo
/boot/dtbs/4.4.143-55-rockchip-g6b7accbc999b/rockchip/overlay/rk3308-uart0.dtbo
/boot/dtbs/4.4.143-55-rockchip-g6b7accbc999b/rockchip/overlay/rk3308-uart1.dtbo
/boot/dtbs/4.4.143-55-rockchip-g6b7accbc999b/rockchip/overlay/rk3308-uart2.dtbo

And the available ports is:
rk3308-uart0.dtbo
rk3308-uart1.dtbo
rk3308-uart2.dtbo

if that doesn’t work, find the folder avaiable into /boot/dtbs and replace it in command directory path ( /boot/dtbs/{AVAILABLE FOLDER}/rockchip/)

Now whe can edit the /boot/uEnv.txt file:

verbosity=7
fdtfile=rockchip/rk3308-rock-pi-s.dtb
console=ttyS0,1500000n8
overlays=rk3308-uart0, rk3308-uart2 <====== Your uart ports can write on this line separated by a comma
rootuuid=ee60d2e1-358c-467c-acc8-a147c5b38695
initrdsize=0x5c96f8
kernelversion=4.4.143-55-rockchip-g6b7accbc999b
initrdimg=initrd.img-4.4.143-55-rockchip-g6b7accbc999b
kernelimg=vmlinuz-4.4.143-55-rockchip-g6b7accbc999b

Save it and reboot the system.