2019-04-06 21:08:09 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-09-23 01:19:59 +08:00
|
|
|
config UART_NATIVE_POSIX
|
2023-12-06 00:12:43 +08:00
|
|
|
bool "UART driver for native_sim/posix"
|
2022-07-21 02:46:30 +08:00
|
|
|
default y
|
|
|
|
depends on DT_HAS_ZEPHYR_NATIVE_POSIX_UART_ENABLED
|
2018-09-23 01:19:59 +08:00
|
|
|
select SERIAL_HAS_DRIVER
|
|
|
|
help
|
2019-04-15 15:10:02 +08:00
|
|
|
This enables a UART driver for the POSIX ARCH with up to 2 UARTs.
|
|
|
|
For the first UART port, the driver can be configured
|
2023-12-06 00:12:43 +08:00
|
|
|
to either connect to the terminal from which the executable was run, or into
|
2019-04-15 15:10:02 +08:00
|
|
|
one dedicated pseudoterminal for that UART.
|
2018-09-23 01:19:59 +08:00
|
|
|
|
|
|
|
if UART_NATIVE_POSIX
|
|
|
|
|
|
|
|
choice
|
|
|
|
prompt "Native UART Port 0 connection"
|
|
|
|
default NATIVE_UART_0_ON_OWN_PTY
|
|
|
|
|
|
|
|
config NATIVE_UART_0_ON_OWN_PTY
|
|
|
|
bool "Connect the UART to its own pseudo terminal"
|
|
|
|
help
|
2019-04-15 15:10:02 +08:00
|
|
|
Connect this UART to its own pseudoterminal. This is the preferred
|
|
|
|
option for users who want to use Zephyr's shell.
|
2023-12-06 00:12:43 +08:00
|
|
|
Moreover this option does not conflict with any other native
|
|
|
|
backend which may use the invoking shell standard input/output.
|
2018-09-23 01:19:59 +08:00
|
|
|
|
|
|
|
config NATIVE_UART_0_ON_STDINOUT
|
|
|
|
bool "Connect the UART to the invoking shell stdin/stdout"
|
|
|
|
help
|
2019-04-15 15:10:02 +08:00
|
|
|
Connect this UART to the stdin & stdout of the calling shell/terminal
|
2023-12-06 00:12:43 +08:00
|
|
|
which invoked the native executable. This is good enough for
|
2019-04-15 15:10:02 +08:00
|
|
|
automated testing, or when feeding from a file/pipe.
|
|
|
|
Note that other, non UART messages, will also be printed to the
|
2023-05-23 23:04:00 +08:00
|
|
|
terminal.
|
2019-04-15 15:10:02 +08:00
|
|
|
It is strongly discouraged to try to use this option with the new
|
|
|
|
shell interactively, as the default terminal configuration is NOT
|
|
|
|
appropriate for interactive use.
|
2018-09-23 01:19:59 +08:00
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2020-10-29 04:17:17 +08:00
|
|
|
config UART_NATIVE_WAIT_PTS_READY_ENABLE
|
|
|
|
bool "Support waiting for pseudo terminal client readiness"
|
|
|
|
depends on NATIVE_UART_0_ON_OWN_PTY || UART_NATIVE_POSIX_PORT_1_ENABLE
|
|
|
|
help
|
|
|
|
When this option is selected a new command line switch is provided:
|
2020-11-07 20:36:16 +08:00
|
|
|
``--wait_uart``
|
|
|
|
When ``--wait_uart`` is used, writes to the UART will be held until a
|
2020-10-29 04:17:17 +08:00
|
|
|
client has connected to the slave side of the pseudoterminal.
|
|
|
|
Otherwise writes are sent irrespectively.
|
|
|
|
|
2019-04-15 15:10:02 +08:00
|
|
|
config UART_NATIVE_POSIX_PORT_1_ENABLE
|
2022-03-09 19:05:12 +08:00
|
|
|
bool "Second UART port"
|
2019-04-15 15:10:02 +08:00
|
|
|
help
|
|
|
|
Useful if you need to have another serial connection to host.
|
|
|
|
This is used for example in PPP (Point-to-Point Protocol)
|
|
|
|
implementation.
|
|
|
|
|
2018-09-23 01:19:59 +08:00
|
|
|
config NATIVE_UART_AUTOATTACH_DEFAULT_CMD
|
|
|
|
string "Default command to attach the UART to a new terminal"
|
|
|
|
default "xterm -e screen %s &"
|
|
|
|
help
|
2023-12-06 00:12:43 +08:00
|
|
|
If the native executable is called with the --attach_uart
|
2019-04-15 15:10:02 +08:00
|
|
|
command line option, this will be the default command which will be
|
|
|
|
run to attach a new terminal to the 1st UART.
|
|
|
|
Note that this command must have one, and only one, '%s' as
|
|
|
|
placeholder for the pseudoterminal device name (e.g. /dev/pts/35)
|
|
|
|
This is only applicable if the UART_0 is configured to use its own
|
|
|
|
PTY with NATIVE_UART_0_ON_OWN_PTY.
|
|
|
|
The 2nd UART will not be affected by this option.
|
2020-08-12 16:01:11 +08:00
|
|
|
If you are using GNOME, then you can use this command string
|
|
|
|
'gnome-terminal -- screen %s'
|
2018-09-23 01:19:59 +08:00
|
|
|
|
2019-03-09 11:23:02 +08:00
|
|
|
endif # UART_NATIVE_POSIX
|