Skip to content

Commit e1beee6

Browse files
aescolarMaureenHelm
authored andcommitted
docs boards native_sim: Clarify that *uart_cmd can be anything
Clarify that the uart "attach commands" can be really anything the shell can run. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent c64702a commit e1beee6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

boards/native/native_sim/doc/index.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,13 +547,23 @@ where :file:`/dev/{<ptyn>}` should be replaced with the actual PTY device.
547547

548548
You may also chose to automatically attach a terminal emulator to any of these UARTs.
549549
To automatically attach one to all these UARTs, pass the command line option ``-attach_uart`` to the
550-
executable. To automatically attach one to a single UART use ``-<uart_name>_attach_uart``
550+
executable. To automatically attach one to a single UART use ``-<uart_name>_attach_uart``.
551551
The command used for attaching to the new shell can be set for all UARTs with the command line
552552
option ``-attach_uart_cmd=<"cmd">``, or for each individual UART with
553553
``-<uart_name>_attach_uart_cmd``. Where the default command is given by
554554
:kconfig:option:`CONFIG_UART_NATIVE_PTY_AUTOATTACH_DEFAULT_CMD`.
555555
Note that the default command assumes both ``xterm`` and ``screen`` are installed in the system.
556556

557+
Note that these ``uart_cmd`` commands can be effectively any shell command including lists of
558+
commands. Therefore it is possible to invoke any other script or program from it.
559+
Those commands will be run right after the PTY is created.
560+
For example, if one wanted to create a link to the newly created PTY, and have it removed when the
561+
program ends, one could do:
562+
563+
.. code-block:: console
564+
565+
$ zephyr.exe --uart_attach_uart_cmd='ln -s %s /tmp/somename' ; rm /tmp/somename
566+
557567
This driver supports poll mode or async mode with :kconfig:option:`CONFIG_UART_ASYNC_API`.
558568
Interrupt mode is not supported.
559569
Neither runtime configuration or line control are supported.

0 commit comments

Comments
 (0)