Skip to content

Commit 0f3e6fd

Browse files
rugeGerritsenkartben
authored andcommitted
boards: nrf_bsim: Document how to use the console with bsim
This commit describes how to build and run applications using the console. This documentation is added because it may not be obvious how this is done. That is, sometimes a user may believe that the terminal launching the application is the the console which is not the case. Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
1 parent 77de593 commit 0f3e6fd

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

boards/native/nrf_bsim/doc/nrf52_bsim.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,33 @@ Run them with ``-help`` for more information.
171171
You can find more information about how to run BabbleSim simulations in
172172
`this BabbleSim example <https://babblesim.github.io/example_2g4.html>`_.
173173

174+
Running an application using the console
175+
========================================
176+
177+
Some applications require the use of a console to interact with the user.
178+
These applications typically enable :kconfig:option:`CONFIG_CONSOLE_SUBSYS` and :kconfig:option:`CONFIG_CONSOLE_GETCHAR`.
179+
The UART console is disabled by default for BabbleSim boards, to enable it simply add the snippet :ref:`snippet-uart-console`.
180+
181+
.. code-block:: console
182+
183+
west build -S serial-console [...]
184+
185+
To view the output and interact with the application the user needs to connect a terminal to this pseudoterminal.
186+
187+
.. code-block:: console
188+
189+
# Automatically attach to the terminal
190+
./build/zephyr/zephyr.exe --uart<uart_id>_pty_attach
191+
# Use a custom command to attach to the terminal, for example 'xterm -e screen %s &'
192+
./build/zephyr/zephyr.exe --uart<uart_id>_attach_cmd=<cmd>
193+
# Use a custom way to connect to the pseudoterminal
194+
./build/zephyr/zephyr.exe --uart<uart_id>_pty --uart_pty_wait
195+
minicom -D /dev/pts/<pts_id>
196+
197+
The command line option ``--uart_list`` prints out the mapping between ``uart_id`` and the UART peripherals.
198+
The overlay files describes which UART peripheral is being used as the console output.
199+
200+
For more details about attaching to the UART output, refer to the output of the ``-help`` option of the executable.
174201

175202
C library choice
176203
****************

0 commit comments

Comments
 (0)