Serial communication is a key part of modern embedded systems UI and debugging. It is a simple way enable interaction with the DUT as well as a low cost way to log data.
The Lager setup includes designating lines for use with a serial terminal. This can include either raw UART TX and RX lines, or a USB connection in the case that the DUT supports USB CDC.
Lager supports pyserial natively so getting started with interactive serial is very straightforward.
import serial s = serial.Serial('/dev/ttyUSB1', 115200, timeout=60) line = s.readline() s.write(b'hello')
A serial terminal is also supported. You can either open an interactive terminal with the DUT, which is very useful when the DUT supports a CLI, or you can open a simplex connection which only accepts data from the DUT.
~ lager serial-ports --dut 1 /dev/ttyUSB1 ~ lager uart serial-device /dev/ttyUSB1 --interactive --dut 1
The default baud is
115200 but you have the ability to set most common UART parameters.