Serial Console on Embedded Linux: picocom, minicom, screen
Open a serial console on an embedded Linux board with picocom, minicom or GNU Screen. Find the USB device, set the baud rate and exit each tool.
Contents
A serial console lets you see boot messages and get a login prompt on an embedded board that has no network or display yet. You connect a USB-to-serial adapter, then open the resulting device with a terminal program. This guide covers picocom, minicom and GNU Screen, and how to leave each one cleanly.
Find the serial console device
Plug in the adapter or the board’s USB serial port, then look at the kernel log. Look for a new device node such as /dev/ttyUSB0 or /dev/ttyACM0; the exact name depends on your adapter and what else is attached.
sudo dmesg | tail -n 20
ls -l /dev/ttyUSB* /dev/ttyACM*The ls -l output shows the owning group of the device node. You need read and write access to it (Screen’s manual states this requirement), so either run the tool as a user in that group or use sudo.
You also need the settings your board uses. Take the baud rate, data bits, parity and stop bits from your board’s documentation rather than assuming them.
Install the tools
apt-get update
apt-get install -y picocom minicom screendnf install -y picocom minicom screenpacman -Sy --noconfirm picocom minicom screenCheck that all three are installed:
picocom --help | head -n 5
command -v minicom screenpicocom
The picocom README calls it a minimal dumb-terminal emulator. Pass the baud rate with -b and the device as the argument:
picocom -b 115200 /dev/ttyUSB0Other settings are options too. According to the manual page, -f selects flow control (x software, h hardware, n none; none is the default), -d sets data bits (5 to 8, default 8), -y sets parity (o, e or n, default n) and -p sets stop bits (1 or 2, default 1). -g appends received data to a log file.
picocom -b 115200 -f n -d 8 -y n -p 1 -g boot.log /dev/ttyUSB0All picocom commands start with the escape character, Ctrl-A. To exit, type C-a C-x. That restores the port’s original settings. C-a C-q quits without restoring them, as if you had passed --noreset. C-a C-h shows the list of keys, and C-a C-v shows the program options and actual port settings.
minicom
minicom keeps its settings in configuration files. For a one-off connection, override the device and baud rate on the command line:
minicom -D /dev/ttyUSB0 -b 115200The man page documents -D for the device and -b for the baud rate, both overriding the configuration file. Running sudo minicom -s opens the setup menu to edit the system-wide defaults instead of starting a session.
Commands start with Ctrl-A. Ctrl-A Z shows the help screen. Ctrl-A X exits and resets the modem, while Ctrl-A Q exits without resetting it.
GNU Screen
Screen treats a tty device name as a window type. Give the device as the first argument, optionally followed by comma-separated stty-style flags such as a baud rate:
screen /dev/ttyUSB0 115200The manual lists the baud rate, cs8 or cs7 for data bits, ixon/-ixon and ixoff/-ixoff for software flow control, and istrip/-istrip. It documents no parity flag, so use picocom if you need non-default parity. Options you leave out are whatever the terminal driver currently has.
Screen’s command character is also Ctrl-A, and its keys differ from the other two:
C-a \kills all windows and terminates Screen. This is the clean exit.C-a kdestroys the current window.C-a ddetaches Screen from the terminal and leaves programs running.screen -rresumes a detached session.
Screen tries an exclusive open on the device to mark the line as busy, so detaching without quitting can leave the port in use.
Which one to use
- picocom: baud rate and line settings are command-line options, and exit is
C-a C-x. - minicom: configuration menus and saved profiles, which suit a bench with several boards.
- Screen: the device is given as an argument with a few stty-style flags, and there is no parity flag.
Only one program can use the port at a time. If you need the same terminal for other work, the tmux guide shows how to keep sessions alive. To see what a serial console would show, you can first boot an image in QEMU as described in Buildroot: Build a Minimal Linux Image and Boot It in QEMU.
Sources
This article was drafted with AI assistance, fact-checked against the sources listed above and reviewed by a human editor before publication. Spotted an error? See our corrections policy.