Embedded Linux development practice (8): UART serial port development

The serial port can be said to be a very easy-to-use interface. Like USB, CAN, I2C, SPI and other interfaces, it has built rich interface functions for SOC/MCU. So how to build and use the UART interface in embedded Linux?

1. Console interface is ttyS0

ttyS0 is usually used as u-boot (a type of bootloader, such as Windows BIOS). It requires an interactive interface. Generally, ttyS0 is used, which can print some log output and enter u-boot or kernel through the space bar, etc. Perform some linux command operations.

chosen is not a real device. It specifies startup parameters and is used to pass the bootargs environment variable value in uboot to the Linux kernel as a command line parameter. Bootargs is specified when u-boot starts the kernel. The bootargs attribute must exist but can be set. NULL value. stdout-path is the node path of the standard terminal device. The kernel will use this as the default terminal. For example, the set serial:115200n8 is a ttyS0 serial port device.

For example, the following paragraph describes the role of ttyS0 or ttyO0 when u-boot starts:

 All tty drivers do not need to be loaded additionally&#x

Guess you like

Origin blog.csdn.net/weixin_49369227/article/details/132287212