Enabling/using secondary UART

Hi,

I am trying to use secondary UART on the 5B. I have done this with the RPi and I have a little bit of experience working with ATmega MCUs (inside and outside of Arduinos). But I’m having trouble getting this to work on the 5B.

I am using the Debian image. I noticed that it has /dtbs/5.10.66-27-rockchip-gea60d388902d/rockchip/overlay/rk3588-uart7-m2.dtbo as the default DT overlay; not sure if that has anything to do with things.

ls /dev/tty* shows ttyS6 and ttyS7 in addition to the ttyFIQ0 being used by Linux as the terminal.

I used a USB-to-UART dongle bought from allchinanet (the same one shown in the various documentations) and it works fine with ttyFIQ0 on the Rock5 as a linux terminal, as well as my RPi, the Rock4B, and my 5V ATmega (with a zener voltage clamp).

But when I plug it into pin 24 & 26 (UART7_RX_M2, UART7_TX_M2) and run screen on both my laptop and the rock5 (on /dev/ttyS7), the rock5 seems to be receiving characters sent from the laptop just fine, but anything sent from the rock5 to the laptop is all garbled.

I tried baud rate of 9600, 19200, 115200, all made no difference.

Am I doing something wrong here?

1.5M (1500000) bud rate?

Tried 1500000 too.

I have this problem too, did you solve it now?

Interestingly enough, using BAUD rate of 57600 worked fine for me so I’ve been using that as a workaround.

I fixup it by this way:

install dtc in you OS, and edit dtb:

    cd /boot/dtbs/xxxxx/rockchip/
    sudo cp rk3588-rock-5b.dtb rk3588-rock-5b.bak.dtb
    sudo dtc -O dts -I dtb rk3588-rock-5b.dtb -o rk3588-rock-5b.dts
    sudo vim rk3588-rock-5b.dts

find node “serial@feba0000” change (only dma-names and pinctrl-0) to:

	serial@feba0000 {
		compatible = "rockchip,rk3588-uart","snps,dw-apb-uart";
		reg = <0x00 0xfeba0000 0x00 0x100>;
		interrupts = <0x00 0x152 0x04>;
		clocks = <0x02 0xcf 0x02 0xb1>;
		clock-names = "baudclk","apb_pclk";
		reg-shift = <0x02>;
		reg-io-width = <0x04>;
		dmas = <0xd4 0x07 0xd4 0x08>;
		dma-names = "!tx","!rx";
		pinctrl-names = "default";
		pinctrl-0 = <0x14f>;
		status = "okay";
		phandle = <0x297>;
	};

if you using uart7-m2, don’t modify pinctrl-0 then build dtb:

    sudo dtc -O dtb -I dts rk3588-rock-5b.dts -o rk3588-rock-5b.dtb
    sudo reboot

well, if you change pinctrl-0 to pinctrl-0 = <0x14f>, you need to remove uart7-m2 in /boot/extlinux/extlinux.conf and using uart7-m1:
image
this behavior is not best, but I don’t have other way…