Console speed over uart0 change

I am using rockpis_ubuntu_bionic_minimal_arm64_20200809_0856-gpt.img and I`ve already succesfully updated it.

I am trying to use a microcontroller to communicate with the console through uart0. The microcontroller cannot transmit at 1500000 bps, so I must decrease the speed to 115200 bps. In the uEnv.txt file I find the following:

*verbosity=7
fdtfile=rockchip/rk3308-rock-pi-s.dtb
console=ttyS0,1500000n8
overlays=rk3308-uart0
rootuuid=e6cc3977-ae0c-4340-9b51-66197ebac83d
initrdsize=0x62d433
kernelversion=4.4.143-55-rockchip-g6b7accbc999b
initrdimg=initrd.img-4.4.143-55-rockchip-g6b7accbc999b
kernelimg=vmlinuz-4.4.143-55-rockchip-g6b7accbc999b
*
In the third line I have changed the speed to 115200. After restarting, the serial communication has been completely damaged. Using SSH I change the speed back to 1500000 and there is serial communication again.

Should I do something else to change the speed of the usart0?

I have also tried to enable the uart1 with the speed of 115200 by editing the same uEnv.txt file as follows:

*verbosity=7
fdtfile=rockchip/rk3308-rock-pi-s.dtb
console=ttyS0,1500000n8
overlays=rk3308-uart0 rock3308-uart1
console=ttyS1,115200n8
rootuuid=e6cc3977-ae0c-4340-9b51-66197ebac83d
initrdsize=0x62d433
kernelversion=4.4.143-55-rockchip-g6b7accbc999b
initrdimg=initrd.img-4.4.143-55-rockchip-g6b7accbc999b
kernelimg=vmlinuz-4.4.143-55-rockchip-g6b7accbc999b
~
*
but in this case when it restarts, in the console by uart0 it stops with the following warning:
WARNING: suspend_mode_handler: Not support call: 0x4
and this also appears:
*Applying kernel provided DT overlay rk3308-uart0.dtbo
** Unable to read file /dtbs/4.4.143-55-rockchip-g6b7accbc999b/rockchip/overlay/rock3308-uart1.dtbo **
*

Thank you very much for any advice you can give me.

Gonzalo Guerrero

@gguerrer

ROCK Pi S provides three UARTs(UART0, UART1, UART2).

By default, ROCK Pi S official Ubuntu/Debian system use UART0 as debug console by adding the following two lines in file /boot/uEnv.txt, which means you can not use UART0 to communicate with a MCU.

console=ttyS0,1500000n8
overlays=rk3308-uart0

For the communication with the MCU, you can use UART1 or UART2. You don’t need to set the baud rate in file /boot/uEnv.txt. Instead, you can set the baud rate in your application.

As for UART setting, please check here. https://wiki.radxa.com/RockpiS/Ubuntu#UART

Hi Steven,

According to the Docs, the console baud rate has two options. If I wish to use 115200 as debug console I will get the same problem as mentioned above. Is there a way to change debug console baud rate to 115200? The reason why I want to use 115200 is because 1500000 does not work on MacOS. Thank you.

According to this guide, https://wiki.radxa.com/RockpiS/Debian#UART, you can change kernel console baud rate to 115200 via adding console=ttyS0,1500000n8 and add rk3308-uart0 to overlays= like.

For example.

 console=ttyS0,115200n8
 overlays=rk3308-uart0

What console tool do you use?

I use tool picocom on Mac M1 and it supports 1500000 baud rate.
Try the following command to install picocom on your MacOS.

% brew install --build-from-source radxa/picocom/picocom

And start picocom via

% picocom -b 1500000 -d 8 /dev/tty.usbserial-2130

Thank you very much. It turns out screen on my macbook cannot work with 1500000 baud. I tried picocom and it works well.

1 Like