Configure UART for Ubuntu Server 20.04 on Raspberry Pi 3 B+
If you want to transfer data over the onboard UART connection, you will need to disable the serial console which is enabled by default on the Raspberry Pi version of Ubuntu Server 20.04. Otherwise, the serial device will already be in use, meaning you won't be able to use it for other data transfer.
The serial console is configured by the Linux kernel during boot. The configuration can be changed by modifying the the cmdline.txt file in the boot partition.
Note
In previous versions of Ubuntu Server for the Raspberry Pi was located in
the /boot
directory but has since been move to /boot/firmware
.
Open /boot/firmware/cmdline.txt
file, and remove
console=serial0,115200
console=tty1
If you are editing this file directory on the Raspberry Pi (as opposed to modifying the file on another computer), you will need to reboot for the settings to take effect. For more information on the kernel configuration, check out The Kernel Command Line.
To test everything out, you can connect the Raspberry Pi to another computer with a 3.3 V FTDI breakout board. On the computer, open a serial connection with the breakout board using
screen /dev/ttyUSB1 115200.
Note
The device file name may be different on your system.
On the Raspberry Pi, open a serial connection with the onboard serial device with
screen /dev/ttyS0 115200
Now you should be able to type in one screen window and see the output on the other.
April 25, 2021 • February 26, 2024