I have found out that there is a script serial-getty@.service which is starting agetty on ttyS2. But after i have removed this file still there is no send/receive on ttyS2
I have also noticed this:
[ 0.876663] ff1a0000.serial: ttyS2 at MMIO 0xff1a0000 (irq = 44, base_baud = 1500000) is a 16550A
[ 0.987061] printk: console [ttyS2] enabled
which makes me thinking that this is set by kernel command line (?) or where ?
[ 0.000000] Kernel command line: storagemedia=emmc androidboot.storagemedia=emmc androidboot.mode=normal androidboot.dtbo_idx=0 swiotlb=1 coherent_pool=1m rw root=/dev/mmcblk2p8 rootfstype=ext4 data=/dev/mmcblk2p9 consoleblank=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
And it is also weird that the
gpio readall
| 40 | 12 | GPIO1_B0 | ALT | | 19 || 20 | | | GND(0V) | | |
| 39 | 13 | GPIO1_A7 | ALT | | 21 || 22 | 0 | IN | GPIO1_D0 | 6 | 56 |
shows ALT and GPIO1_B0 and GPIO1_A7 where should be UART4_TX and UART4_RX
I have found out that /dev/ttyS2 becomes the debug port so... I messed up..
But than how I enable the UART4 to ttyS4 ?
The emmc flasher SD card image has enabled the ttyS4 non UART4 and it works like it should be...Now just how to find out what is the difference between the installer image and the installed image
Ok! I found out I have to rebuild the kernel and reinstall it!
In the 5.15.y kernel the uart4 is disabled and you have to add the rk3399-nanopi4.dtsi the following:
&uart4 {
status = "okay";
};
I have added this after the 'uart2' definition...
It will be nice if I do not have to rebuild the whole image, only the kernel...but after installing with dd the kernel.img and the resources.img the SDS card will not boot