UART/Serial Devices on R3Mini

Hi, I would like to use Debug UART port of the R3Mini(3 pins just next to Power-usb-c ) to access to other devices. (I can use usb-c serial port as debug). How can we disable debug mode? And how is this mapped as tty device? (this specific 3 pins, is it ttyS0/S1/S2 or smthing else?)

I can see /dev/ttyS0 ttyS1 and ttyS2, does it mean we have 3 serial on-board ports?

regards

Maybe I shall simply ask, if the debug uart can be used functionally to communicate to outside?

I have not tried it…Basicly it should be possible as it is simple uart. But disable the debug functionality (stdout in dts/cmdline) may make debugging impossible

It is ttyS0

Thanks for your reply. What about ttyS1 and ttyS2? probably one of them is usb-c console.

Uart0,the debug-uart is also connected the usb-c on r3mini with ch340e

Uart1 seems to be mapped to m.2 key-e slot

Uart2 seems not connected

is there a m.2 key-e slot on R3Mini? I know m.2 key-m(minipcie) and m.2 key-b (usb).

How can I disable debug functionality? the way pointed as → stdout in dts/cmdline (do you mean wheteher from dts file and re-build image or from cmdline) I’ve never modified a dts file but I can try to follow and figure it out.

Which image/kernel/uboot do you use?

Stdout in kernel is defined here in dts (syntax can be a bit different when using older kernel/image):

And yes dts changes require kernel recompile (or at least the fit image,but dts alone is more difficult than while compiling kernel).

Cmdline is sometimes also used for passing serial settings for debug-uart. This is how it is done in my uboot:

My uboot allows overriding this builtin environment by adding a uEnv.txt on BPI-BOOT partition setting this variable to empty value. For other systems maybe uboot needs to be recompiled.

I use upstream OpenWrt

Then you should change files (uboot env and dts in linux) created by this commit:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=b03d3644cfe9eb8db2a3441c55c84b076ba7cd08

I can see the “stdout-path” in “target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3-mini.dts”, which I shall comment-out.

But I couldnt see the uboot part? can it be at one of the below?(from “package/boot/uboot-envtools/files/mediatek_filogic” ) 9 . /lib/uboot-envtools.sh 10 . /lib/functions.sh

Looks like openwrt does not set the cmdline so only dts needs to be changed

Works great! Just modified - commented out “stdout-path” at mentioned dts file.

Verification: Loaded this new image to R3Mini (device1) At device1, debug output can be seen till the kernel starts, then no output. I reach to device1 via ssh. Connected the Debug uart of other R3Mini(device2) the device1. At device1, “screen /dev/ttyS0 115200 cs7 parenb -parodd” can get the debug output of device2.

Thanks @frank-w