You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/06/03 05:20:08 UTC

[nuttx] 01/02: Documentation: Add nxdiag application

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 0b64f8d54e7a412902755c3af69b361a07922a4f
Author: Lucas Saavedra Vaz <lu...@espressif.com>
AuthorDate: Fri May 26 09:10:34 2023 -0300

    Documentation: Add nxdiag application
    
    Basic description of the nxdiag, its options and configurations.
---
 Documentation/applications/index.rst         |  1 +
 Documentation/applications/nxdiag/config.rst | 78 ++++++++++++++++++++++++++++
 Documentation/applications/nxdiag/index.rst  | 45 ++++++++++++++++
 3 files changed, 124 insertions(+)

diff --git a/Documentation/applications/index.rst b/Documentation/applications/index.rst
index b71ba1569a..deb86884da 100644
--- a/Documentation/applications/index.rst
+++ b/Documentation/applications/index.rst
@@ -12,5 +12,6 @@ NuttX ships a large number of applications covering a wide spectrum of functiona
    :caption: Contents:
 
    nsh/index.rst
+   nxdiag/index.rst
    wapi/index.rst
 
diff --git a/Documentation/applications/nxdiag/config.rst b/Documentation/applications/nxdiag/config.rst
new file mode 100644
index 0000000000..0e0098e117
--- /dev/null
+++ b/Documentation/applications/nxdiag/config.rst
@@ -0,0 +1,78 @@
+.. |br| raw:: html
+
+   <br/>
+
+======================
+Configuration Settings
+======================
+
+The availability of the above commands depends upon features that may or
+may not be enabled in the NuttX configuration file. The following
+:ref:`cmdtable <nxdiagcmddependencies>` indicates the dependency of each command on
+NuttX configuration settings. General configuration settings are
+discussed in the NuttX Porting Guide.
+Configuration settings specific to Nxdiag as discussed at the
+:ref:`cmdbottom <nxdiagconfiguration>` of this document.
+
+Note that the ``--vendor-specific`` or ``-v`` option will generate vendor-specific
+information and checks. The output of this option will depend on the selected
+vendors in the NuttX configuration file. For example, if the ``CONFIG_SYSTEM_NXDIAG_ESPRESSIF``
+configuration setting is enabled, then this option will provide custom
+information and checks for Espressif devices. Multiple vendors may be selected
+at the same time.
+
+.. _nxdiagcmddependencies:
+
+Option Dependencies on Configuration Settings
+=============================================
+
+========================= ===========================================
+Option                    Depends on Configuration
+========================= ===========================================
+``--help, -h``
+``--nuttx, -n``
+``--flags, -f``           ``CONFIG_SYSTEM_NXDIAG_COMP_FLAGS``
+``--config, -c``          ``CONFIG_SYSTEM_NXDIAG_CONF``
+``--host-os, -o``
+``--host-path, -p``       ``CONFIG_SYSTEM_NXDIAG_HOST_PATH``
+``--host-packages, -k``   ``CONFIG_SYSTEM_NXDIAG_HOST_PACKAGES``
+``--host-modules, -m``    ``CONFIG_SYSTEM_NXDIAG_HOST_MODULES``
+``--vendor-specific, -v``
+``--all``
+
+========================= ===========================================
+
+.. _nxdiagconfiguration:
+
+Nxdiag-Specific Configuration Settings
+======================================
+
+The behavior of Nxdiag can be modified with the following settings in the
+``boards/<arch>/<chip>/<board>/defconfig`` file:
+
+========================================  ==================================
+Configuration                             Description
+========================================  ==================================
+ ``CONFIG_SYSTEM_NXDIAG_COMP_FLAGS``      Enable the nxdiag application to list the NuttX compilation
+                                          flags. This is useful for debugging the host and target
+                                          systems. Enables the ``-f`` and ``--nuttx-flags`` options.
+
+ ``CONFIG_SYSTEM_NXDIAG_CONF``            Enable the nxdiag application to list the configuration options
+                                          used to compile NuttX. This is useful for debugging the host and
+                                          target systems. Enables the ``-c`` and ``--nuttx-config`` options.
+
+ ``CONFIG_SYSTEM_NXDIAG_HOST_PATH``       Enable the nxdiag application to list the host system PATH
+                                          variable. This is useful for debugging the host system.
+                                          Enables the ``-p`` and ``--host-path`` options.
+
+ ``CONFIG_SYSTEM_NXDIAG_HOST_PACKAGES``   Enable the nxdiag application to list the installed packages
+                                          on the host system. This is useful for debugging the host
+                                          system. Enables the ``-k`` and ``--host-packages`` options.
+
+ ``CONFIG_SYSTEM_NXDIAG_HOST_MODULES``    Enable the nxdiag application to list the installed Python
+                                          modules on the host system. This is useful for debugging the
+                                          host system. Enables the ``-m`` and ``--host-modules`` options.
+
+ ``CONFIG_SYSTEM_NXDIAG_ESPRESSIF``       Enable Espressif-specific information and checks.
+
+========================================  ==================================
diff --git a/Documentation/applications/nxdiag/index.rst b/Documentation/applications/nxdiag/index.rst
new file mode 100644
index 0000000000..009594525d
--- /dev/null
+++ b/Documentation/applications/nxdiag/index.rst
@@ -0,0 +1,45 @@
+==============================
+NuttX Diagnostic Tool (Nxdiag)
+==============================
+
+The NuttX Diagnostic Tool (Nxdiag) is a command line tool that can be used to gather information about the NuttX and host systems.
+It also can be used to run a tests to verify that the vendor's tools are properly installed and configured.
+
+Its primary purpose is to gather information that can be used to debug problems and ease the process of reporting bugs for uninexperienced users.
+
+This tool uses a Python script (``apps/tools/host_sysinfo.py``) to gather information about the host system during build and a C
+program to gather information about the NuttX system and display all available information. For more information about the python
+script, check the command line options and code comments of ``host_sysinfo.py``.
+
+.. note:: Nxdiag requires Python 3.6 or later. On Linux distributions, the ``distro`` Python module is
+          recommended as it provides more accurate information about the host system.
+
+=====
+Usage
+=====
+
+This page shows ``nxdiag`` options. Note that some options are only available if the
+respective configuration options are enabled (see :ref:`cmdtable <nxdiagcmddependencies>`).
+For a complete list of ``nxdiag`` options available to the system, just run ``nxdiag``::
+
+    Usage: nxdiag [options]
+    Options:
+            -h                                 Show this message
+            -n, --nuttx                        Output the NuttX operational system information.
+            -f, --flags                        Output the NuttX compilation and linker flags used.
+            -c, --config                       Output the NuttX configuration options used.
+            -o, --host-os                      Output the host system operational system information.
+            -p, --host-path                    Output the host PATH environment variable.
+            -k, --host-packages                Output the host installed system packages.
+            -m, --host-modules                 Output the host installed Python modules.
+            -v, --vendor-specific              Output vendor specific information.
+            --all                              Output all available information.
+
+An example output can be observed `here <https://pastebin.com/HSw1EvhR>`_.
+
+.. toctree::
+  :maxdepth: 2
+  :caption: Contents
+
+  nxdiag.rst
+  config.rst