| <!-- |
| Documentation/_templates/layout.html |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. The |
| ASF licenses this file to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance with the |
| License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| License for the specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| |
| |
| <!DOCTYPE html> |
| <html class="writer-html5" lang="en"> |
| <head> |
| <meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" /> |
| |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <title>nxwidgets NXWidgets — NuttX latest documentation</title> |
| <link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" /> |
| <link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css" /> |
| <link rel="stylesheet" type="text/css" href="../../../_static/copybutton.css" /> |
| <link rel="stylesheet" type="text/css" href="../../../_static/custom.css" /> |
| |
| |
| <link rel="shortcut icon" href="../../../_static/favicon.ico"/> |
| <script src="../../../_static/jquery.js"></script> |
| <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script> |
| <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script> |
| <script src="../../../_static/doctools.js"></script> |
| <script src="../../../_static/sphinx_highlight.js"></script> |
| <script src="../../../_static/clipboard.min.js"></script> |
| <script src="../../../_static/copybutton.js"></script> |
| <script src="../../../_static/js/theme.js"></script> |
| <link rel="index" title="Index" href="../../../genindex.html" /> |
| <link rel="search" title="Search" href="../../../search.html" /> |
| <link rel="next" title="nxwm NuttX Tiny Window Manager (NxWM)" href="../nxwm/index.html" /> |
| <link rel="prev" title="lvgl LVGL" href="../lvgl/index.html" /> |
| </head> |
| |
| <body class="wy-body-for-nav"> |
| <div class="wy-grid-for-nav"> |
| <nav data-toggle="wy-nav-shift" class="wy-nav-side"> |
| <div class="wy-side-scroll"> |
| <div class="wy-side-nav-search" > |
| |
| <a href="../../../index.html" class="icon icon-home"> NuttX |
| |
| |
| |
| </a> |
| |
| <!-- this version selector is quite ugly, should be probably replaced by something |
| more modern --> |
| |
| <div class="version-selector"> |
| <select onchange="javascript:location.href = this.value;"> |
| |
| <option value="../../../../latest" selected="selected">latest</option> |
| |
| <option value="../../../../10.0.0" >10.0.0</option> |
| |
| <option value="../../../../10.0.1" >10.0.1</option> |
| |
| <option value="../../../../10.1.0" >10.1.0</option> |
| |
| <option value="../../../../10.2.0" >10.2.0</option> |
| |
| <option value="../../../../10.3.0" >10.3.0</option> |
| |
| <option value="../../../../11.0.0" >11.0.0</option> |
| |
| <option value="../../../../12.0.0" >12.0.0</option> |
| |
| <option value="../../../../12.1.0" >12.1.0</option> |
| |
| <option value="../../../../12.2.0" >12.2.0</option> |
| |
| <option value="../../../../12.2.1" >12.2.1</option> |
| |
| <option value="../../../../12.3.0" >12.3.0</option> |
| |
| <option value="../../../../12.4.0" >12.4.0</option> |
| |
| <option value="../../../../12.5.0" >12.5.0</option> |
| |
| <option value="../../../../12.5.1" >12.5.1</option> |
| |
| <option value="../../../../12.6.0" >12.6.0</option> |
| |
| <option value="../../../../12.7.0" >12.7.0</option> |
| |
| <option value="../../../../12.8.0" >12.8.0</option> |
| |
| <option value="../../../../12.9.0" >12.9.0</option> |
| |
| <option value="../../../../12.10.0" >12.10.0</option> |
| |
| <option value="../../../../12.11.0" >12.11.0</option> |
| |
| </select> |
| </div> |
| |
| |
| <div role="search"> |
| <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> |
| <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" /> |
| <input type="hidden" name="check_keywords" value="yes" /> |
| <input type="hidden" name="area" value="default" /> |
| </form> |
| </div> |
| |
| </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> |
| <p class="caption" role="heading"><span class="caption-text">Table of Contents</span></p> |
| <ul class="current"> |
| <li class="toctree-l1"><a class="reference internal" href="../../../index.html">Home</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../introduction/index.html">Introduction</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../quickstart/index.html">Getting Started</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../contributing/index.html">Contributing</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../introduction/inviolables.html">The Inviolable Principles of NuttX</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../platforms/index.html">Supported Platforms</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../components/index.html">OS Components</a></li> |
| <li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Applications</a><ul class="current"> |
| <li class="toctree-l2"><a class="reference internal" href="../../audioutils/index.html">Audio Utility libraries</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../boot/index.html">Bootloader Utilities</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../benchmarks/index.html">Benchmark Applications</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../canutils/index.html">CAN Utilities</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../crypto/index.html">Cryptography Library Support</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../fsutils/index.html">File System Utilities</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../games/index.html">Games</a></li> |
| <li class="toctree-l2 current"><a class="reference internal" href="../index.html">Graphics Support</a><ul class="current"> |
| <li class="toctree-l3"><a class="reference internal" href="../ft80x/index.html"><code class="docutils literal notranslate"><span class="pre">ft80x</span></code> FTDI/BridgeTek FT80x library</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../libjpeg/index.html"><code class="docutils literal notranslate"><span class="pre">libjpeg</span></code> libjpeg JPEG image encoding</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../libyuv/index.html"><code class="docutils literal notranslate"><span class="pre">libyuv</span></code> libyuv</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../lvgl/index.html"><code class="docutils literal notranslate"><span class="pre">lvgl</span></code> LVGL</a></li> |
| <li class="toctree-l3 current"><a class="current reference internal" href="#"><code class="docutils literal notranslate"><span class="pre">nxwidgets</span></code> NXWidgets</a><ul> |
| <li class="toctree-l4"><a class="reference internal" href="#nxwidgets-doxygen-documentation">NXWidgets Doxygen Documentation</a><ul> |
| <li class="toctree-l5"><a class="reference internal" href="#directory-structure">Directory Structure</a></li> |
| <li class="toctree-l5"><a class="reference internal" href="#doxygen">Doxygen</a></li> |
| <li class="toctree-l5"><a class="reference internal" href="#unit-tests">Unit Tests</a></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| <li class="toctree-l3"><a class="reference internal" href="../nxwm/index.html"><code class="docutils literal notranslate"><span class="pre">nxwm</span></code> NuttX Tiny Window Manager (NxWM)</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../pdcurs34/index.html"><code class="docutils literal notranslate"><span class="pre">pdcurs34</span></code> pdcurses Text User Interface (TUI)</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../screenshot/index.html"><code class="docutils literal notranslate"><span class="pre">screenshot</span></code> TIFF screenshot utility</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../slcd/index.html"><code class="docutils literal notranslate"><span class="pre">slcd</span></code> Segment LCD Emulaton</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../tiff/index.html"><code class="docutils literal notranslate"><span class="pre">tiff</span></code> TIFF Creation Library</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../twm4nx/index.html"><code class="docutils literal notranslate"><span class="pre">twm4nx</span></code> Tab Window Manager (TWM)</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l2"><a class="reference internal" href="../../industry/index.html">Industrial Applications</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../inertial/index.html">Inertial Libraries Support</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../interpreters/index.html">Interpreters</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../logging/index.html">Logging Utilities</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../lte/index.html">LTE Libraries and NSH Add-Ons</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../math/index.html">Math Library Support</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../mlearing/index.html">Machine Learning Support</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../netutils/index.html">Network Utilities</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../nsh/index.html">NuttShell (NSH)</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../sdr/index.html">Software Define Radio Libraries</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../system/index.html">System Libraries and NSH Add-Ons</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../testing/index.html">Testing</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../tools/index.html">Host Side Tools</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../wireless/index.html">Wireless Libraries and NSH Add-Ons</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../examples/index.html">Examples</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../implementation/index.html">Implementation Details</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../reference/index.html">API Reference</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../faq/index.html">FAQ</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../guides/index.html">Guides</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../glossary.html">Glossary</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../logos/index.html">NuttX Logos</a></li> |
| </ul> |
| |
| </div> |
| </div> |
| </nav> |
| |
| <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > |
| <i data-toggle="wy-nav-top" class="fa fa-bars"></i> |
| <a href="../../../index.html">NuttX</a> |
| </nav> |
| |
| <div class="wy-nav-content"> |
| <div class="rst-content"> |
| <div role="navigation" aria-label="Page navigation"> |
| <ul class="wy-breadcrumbs"> |
| <li><a href="../../../index.html" class="icon icon-home" aria-label="Home"></a></li> |
| <li class="breadcrumb-item"><a href="../../index.html">Applications</a></li> |
| <li class="breadcrumb-item"><a href="../index.html">Graphics Support</a></li> |
| <li class="breadcrumb-item active"><code class="docutils literal notranslate"><span class="pre">nxwidgets</span></code> NXWidgets</li> |
| <li class="wy-breadcrumbs-aside"> |
| <a href="../../../_sources/applications/graphics/nxwidgets/index.rst.txt" rel="nofollow"> View page source</a> |
| </li> |
| </ul> |
| <hr/> |
| </div> |
| <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> |
| <div itemprop="articleBody"> |
| |
| <section id="nxwidgets-nxwidgets"> |
| <span id="nxwidgets"></span><h1><code class="docutils literal notranslate"><span class="pre">nxwidgets</span></code> NXWidgets<a class="headerlink" href="#nxwidgets-nxwidgets" title="Permalink to this heading"></a></h1> |
| <p>In order to better support NuttX based platforms, a special graphical |
| userinterface has been created called NXWidgets. NXWidgets is written in |
| C++ and integrates seamlessly with the NuttX <a class="reference internal" href="../../../components/nxgraphics/index.html#nxgraphics"><span class="std std-ref">NX graphics |
| subsystem</span></a> in order to provide graphic |
| objects, or “widgets,” in the NX Graphics Subsystem</p> |
| <p>Some of the features of NXWidgets include:</p> |
| <ul class="simple"> |
| <li><p><strong>Conservative C++</strong>. NXWidgets is written entirely in C++ but using |
| only selected “embedded friendly” C++ constructs that are fully |
| supported under NuttX. No additional C++ support libraries are |
| required.</p></li> |
| <li><p><strong>NX Integration</strong>. NXWidgets integrate seamlessly with the |
| <a class="reference internal" href="../../../components/nxgraphics/index.html#nxgraphics"><span class="std std-ref">NX graphics subsystem</span></a>. Think of the X |
| server under Linux … the NX graphics system is like a tiny X server |
| that provides windowing under NuttX. By adding NXWidgets, you can |
| support graphics objects like buttons and text boxes in the NX |
| windows and toolbars.</p></li> |
| <li><p><strong>Small Footprint</strong>. NXWidgets is tailored for use MCUs in embedded |
| applications. It is ideally suited for mid- and upper-range of most |
| MCU families. A complete NXWidgets is possible in as little as 40K of |
| FLASH and maybe 4K of SRAM.</p></li> |
| <li><p><strong>Output Devices</strong>. NXWidgets will work on the high-end frame buffer |
| devices as well as on LCDs connected via serial or parallel ports to |
| a small MCU.</p></li> |
| <li><p><strong>Input Devices</strong>. NXWidgets will accept position and selection |
| inputs from a mouse or a touchscreen. It will also support character |
| input from a keyboard such as a USB keyboard. NXWidgets supports on |
| very special widget called CKeypad that will provide keyboard input |
| via an on-screen keypad that can be operated via mouse or touchscreen |
| inputs.</p></li> |
| <li><p><strong>Many Graphic Objects</strong>. Some of the graphic objects supported by |
| NXWidgets include labels, buttons, text boxes, button arrays, check |
| boxes, cycle buttons, images, sliders, scrollable list boxes, |
| progress bars, and more.</p></li> |
| <li><p><strong>DOxygen Documentation</strong> DOxygen documentation is available.</p></li> |
| </ul> |
| <p>Note: Many of the fundamental classed in NxWidgets derive from the |
| Antony Dzeryn’s “Woopsi” project which also has a |
| BSD style license. See the COPYING file for details.</p> |
| <section id="nxwidgets-doxygen-documentation"> |
| <h2>NXWidgets Doxygen Documentation<a class="headerlink" href="#nxwidgets-doxygen-documentation" title="Permalink to this heading"></a></h2> |
| <div class="admonition-todo admonition" id="id1"> |
| <p class="admonition-title">Todo</p> |
| <p>NXWidgets supports building HTML documentation via Doxygen. We should |
| integrate this into the Sphinx documentation build.</p> |
| </div> |
| <p>Thanks go to Jose Pablo Carballo for contributing this!</p> |
| <section id="directory-structure"> |
| <h3>Directory Structure<a class="headerlink" href="#directory-structure" title="Permalink to this heading"></a></h3> |
| <ul> |
| <li><p><code class="docutils literal notranslate"><span class="pre">Kconfig</span></code></p> |
| <p>This is a <code class="docutils literal notranslate"><span class="pre">Kconfig</span></code> file that should be provided at <code class="docutils literal notranslate"><span class="pre">apps/NxWidgets/Kconfig</span></code>. |
| When copied to that location, it will be used by the NuttX configuration |
| systems to configure settings for NxWidgets and NxWM</p> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">nxwidgets</span></code></p> |
| <p>The source code, header files, and build environment for NxWidgets is provided |
| in this directory.</p> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">UnitTests</span></code></p> |
| <p>Provides a collection of unit-level tests for many of the individual widgets |
| provided by <code class="docutils literal notranslate"><span class="pre">nxwidgets</span></code>.</p> |
| </li> |
| </ul> |
| </section> |
| <section id="doxygen"> |
| <h3>Doxygen<a class="headerlink" href="#doxygen" title="Permalink to this heading"></a></h3> |
| <section id="installing-the-necessary-packages-in-ubuntu"> |
| <h4>Installing the necessary packages in Ubuntu<a class="headerlink" href="#installing-the-necessary-packages-in-ubuntu" title="Permalink to this heading"></a></h4> |
| <ol class="arabic"> |
| <li><p>Install the following packages:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ sudo aptitude install doxygen doxygen-doc doxygen-gui dot2tex graphviz |
| </pre></div> |
| </div> |
| </li> |
| <li><p>(Optional) Install Doxygen from the latest sourcode.</p> |
| <p>The Ubuntu package is outdated. The newer the version of Doxygen, the better |
| the documentation looks.</p> |
| <p>Place yourself in some temporary folder where you can download the source, |
| and run [1]:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ svn co https://doxygen.svn.sourceforge.net/svnroot/doxygen/trunk doxygen-svn |
| $ cd doxygen-svn |
| $ ./configure |
| $ make |
| $ make install |
| </pre></div> |
| </div> |
| </li> |
| </ol> |
| </section> |
| <section id="generating-documentation"> |
| <h4>Generating documentation<a class="headerlink" href="#generating-documentation" title="Permalink to this heading"></a></h4> |
| <p>Two ways described here:</p> |
| <ol class="arabic"> |
| <li><p>Use the provided <code class="docutils literal notranslate"><span class="pre">gendoc.sh</span></code> script:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>trunk/NXWidgets/Doxygen/gendoc.sh |
| </pre></div> |
| </div> |
| <p>The script only needs the argument to the absolute path where to place the |
| generated documentation. I.e.:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ cd /path/to/nuttx/trunk/NXWidgets/Doxygen/ |
| $ mkdir doc |
| $ ./gendoc.sh $PWD/doc |
| </pre></div> |
| </div> |
| </li> |
| <li><p>Using the <code class="docutils literal notranslate"><span class="pre">Doxyfile</span></code> directly:</p> |
| <p>The file <code class="docutils literal notranslate"><span class="pre">Doxyfile</span></code> contains the configuration of the Doxygen settings for |
| the run, edit only if necessary.</p> |
| <p>To generate the documentation type:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ cd /path/to/nuttx/trunk/NXWidgets/Doxygen/ |
| $ doxygen Doxyfile |
| </pre></div> |
| </div> |
| </li> |
| </ol> |
| </section> |
| <section id="references"> |
| <h4>References<a class="headerlink" href="#references" title="Permalink to this heading"></a></h4> |
| <p>[1] <a class="reference external" href="http://www.stack.nl/~dimitri/doxygen/download.html">http://www.stack.nl/~dimitri/doxygen/download.html</a></p> |
| </section> |
| </section> |
| <section id="unit-tests"> |
| <h3>Unit Tests<a class="headerlink" href="#unit-tests" title="Permalink to this heading"></a></h3> |
| <section id="installing-and-building-the-unit-tests"> |
| <h4>Installing and Building the Unit Tests<a class="headerlink" href="#installing-and-building-the-unit-tests" title="Permalink to this heading"></a></h4> |
| <ol class="arabic"> |
| <li><p>Setup NuttX</p> |
| <ol class="arabic"> |
| <li><p>Configure NuttX</p> |
| <p>Configure NuttX to run one of the target configurations. For example, |
| let’s assume that you are using the <code class="docutils literal notranslate"><span class="pre">sim/nsh2</span></code> configuration. The |
| <code class="docutils literal notranslate"><span class="pre">sim/nsh2</span></code> configuration was specially created for use NXWidgets on the |
| simulation platform. A similar, special configuration <code class="docutils literal notranslate"><span class="pre">stm3210e-eval/nsh2</span></code> |
| is also for the <code class="docutils literal notranslate"><span class="pre">STM3210E-EVAL</span></code> available. However, the unit test can be |
| run on other configurations (see steps d and e below).</p> |
| <p><strong>Note</strong>: There are some other special configurationsrecommended for |
| unit-leveling testing of NxWM because the configuration is more complex in |
| that case. These are:</p> |
| <ol class="arabic simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">sim/nxwmm</span></code>, or the simulated platform (no touchscreen), and</p></li> |
| <li><dl class="simple"> |
| <dt><code class="docutils literal notranslate"><span class="pre">stm3240g-evel</span></code>, for the <code class="docutils literal notranslate"><span class="pre">STM3240G-EVAL</span></code> board (with the STMPE11</dt><dd><p>touchscreen)</p> |
| </dd> |
| </dl> |
| </li> |
| </ol> |
| <p>We will assume the <code class="docutils literal notranslate"><span class="pre">sim/nsh2</span></code> configuration in this discussion. The |
| <code class="docutils literal notranslate"><span class="pre">sim/nsh2</span></code> configuration is installed as follows:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cd <nuttx-directory-path> |
| make distclean |
| tools/configure.sh sim:nsh2 |
| </pre></div> |
| </div> |
| <p>Where:</p> |
| <p><code class="docutils literal notranslate"><span class="pre"><nuttx-directory-path></span></code> is the full, absolute path to the NuttX build |
| directory</p> |
| <p>If you are using the <code class="docutils literal notranslate"><span class="pre">sim/nsh2</span></code> or <code class="docutils literal notranslate"><span class="pre">stm3210e-eval</span></code> configurations, then |
| skip to step 2 (Hmmm.. better check 1d) too).</p> |
| <p>There may be certain requirements for the configuration that you select… |
| for example, certain widget tests may require touchscreen support or |
| special font selections. These test-specific requirements are addressed |
| below under “Unit Test Directories”</p> |
| </li> |
| <li><p>Enable C++ Support</p> |
| <p>If you are not using the <code class="docutils literal notranslate"><span class="pre">sim/nsh2</span></code> or <code class="docutils literal notranslate"><span class="pre">stm3210e-eval</span></code>, you will need to |
| add the following definitions to the NuttX configuration at |
| <code class="docutils literal notranslate"><span class="pre">nuttx/.config</span></code> to enable C++ support:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_HAVE_CXX=y |
| </pre></div> |
| </div> |
| <p>Check first, some configurations already have C++ support enabled (As of |
| this writing <strong>ONLY</strong> the <code class="docutils literal notranslate"><span class="pre">sim/nsh2</span></code> and <code class="docutils literal notranslate"><span class="pre">stm321-e-eval</span></code> configurations |
| have C++ support pre-enabled).</p> |
| </li> |
| <li><p>Enable Debug Options</p> |
| <p>If you are running on a simulated target, then you might also want to |
| enable debug symbols:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_DEBUG_SYMBOLS=y |
| </pre></div> |
| </div> |
| <p>Then you can run the simulation using GDB or DDD which is a very powerful |
| debugging environment!</p> |
| </li> |
| <li><p>Special configuration requirements for the nxwm unit test:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_NXTERM=y |
| </pre></div> |
| </div> |
| </li> |
| <li><p>Other <code class="docutils literal notranslate"><span class="pre">.config</span></code> file changes – NSH configurations only.</p> |
| <p>If the configuration that you are using supports NSH and NSH built-in |
| tasks then all is well. If it is an NSH configuration, then you will have |
| to define the following in your <code class="docutils literal notranslate"><span class="pre">nuttx/.config</span></code> file as well (if it is not |
| already defined):</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_NSH_BUILTIN_APPS=y |
| </pre></div> |
| </div> |
| <p><code class="docutils literal notranslate"><span class="pre">sim/nsh2</span></code> and <code class="docutils literal notranslate"><span class="pre">stm3210e-eval/nsh2</span></code> already has this setting. You do not |
| need to change anything further in the <code class="docutils literal notranslate"><span class="pre">nuttx/.config</span></code> file if you are |
| using either of these configurations.</p> |
| </li> |
| <li><p>Other <code class="docutils literal notranslate"><span class="pre">.config</span></code> file changes – NON-NSH configurations only.</p> |
| <p>Entry Point. You will need to set the entry point in the .config file. For |
| NSH configurations, the entry point will always be <code class="docutils literal notranslate"><span class="pre">nsh_main</span></code> and you will |
| see that setting like:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_INIT_ENTRYPOINT="nsh_main" |
| </pre></div> |
| </div> |
| <p>If you are not using in NSH, then each unit test has a unique entry point. |
| That entry point is the name of the unit test directory in all lower case |
| plus the suffix <code class="docutils literal notranslate"><span class="pre">_main</span></code>. So, for example, the correct entry for the |
| <code class="docutils literal notranslate"><span class="pre">UnitTests/CButton</span></code> would be:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_INIT_ENTRYPOINT="cbutton_main" |
| </pre></div> |
| </div> |
| <p>And the correct entry point for <code class="docutils literal notranslate"><span class="pre">UnitTests/nxwm</span></code> would be:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_INIT_ENTRYPOINT="nxwm_main" |
| </pre></div> |
| </div> |
| <p>etc.</p> |
| <p>For non-NSH configurations (such as the <code class="docutils literal notranslate"><span class="pre">sim/touchscreen</span></code>) you will have |
| to remove the configuration setting that provided the <code class="docutils literal notranslate"><span class="pre">main</span></code> function so |
| that you use the <code class="docutils literal notranslate"><span class="pre">main</span></code> in the unit test code instead. So, for example, |
| with the <code class="docutils literal notranslate"><span class="pre">sim/touchscreen</span></code> configuration you need to remove the following |
| from the NuttX configuration file (<code class="docutils literal notranslate"><span class="pre">.config</span></code>):</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_EXAMPLES_TOUSCHCREEN=y ## REMOVE (provided "tc_main") |
| </pre></div> |
| </div> |
| </li> |
| </ol> |
| </li> |
| <li><p>Adjust the Stack Size</p> |
| <p>If using an simulation configuration (like <code class="docutils literal notranslate"><span class="pre">sim/nsh2</span></code>) and your unit test |
| uses X11 as its display device, then you would have to increase the size of |
| unit test stack as described below under “Stack Size Issues with the X11 |
| Simulation”.</p> |
| </li> |
| <li><p>Build NuttX including the unit test and the NXWidgets library:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cd <nuttx-directory-path> |
| . ./setenv.sh |
| make |
| </pre></div> |
| </div> |
| </li> |
| </ol> |
| </section> |
| <section id="work-arounds"> |
| <h4>Work-Arounds<a class="headerlink" href="#work-arounds" title="Permalink to this heading"></a></h4> |
| <section id="build-issues"> |
| <h5>Build Issues<a class="headerlink" href="#build-issues" title="Permalink to this heading"></a></h5> |
| <ol class="arabic"> |
| <li><p>I have seen this error on Cygwin building C++ code:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>LD: nuttx.rel |
| ld: skipping incompatible /home/patacongo/projects/nuttx/nuttx/trunk/nuttx/libxx//liblibxx.a when searching for -llibxx |
| ld: cannot find -llibxx |
| </pre></div> |
| </div> |
| <p>The problem seems to be caused because <code class="docutils literal notranslate"><span class="pre">gcc</span></code> build code for 32-bit mode and |
| <code class="docutils literal notranslate"><span class="pre">g++</span></code> builds code for 64-bit mode. Add the <code class="docutils literal notranslate"><span class="pre">-m32</span></code> option to the <code class="docutils literal notranslate"><span class="pre">g++</span></code> command |
| line seems to fix the problem. In <code class="docutils literal notranslate"><span class="pre">Make.defs</span></code>:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CXXFLAGS = -m32 $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ |
| $(ARCHCXXFLAGS) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe |
| </pre></div> |
| </div> |
| </li> |
| <li><p>Stack Size Issues with the X11 Simulation</p> |
| <p>When you run the NuttX simulation, it uses stacks allocated by NuttX from the |
| NuttX heap. The memory management model is exactly the same in the simulation |
| as it is real, target system. This is good because this produces a higher |
| fidelity simulation.</p> |
| <p>However, when the simulation calls into Linux/Cygwin libraries, it will still |
| use these small simulation stacks. This happens, for example, when you call |
| into the system to get and put characters to the console window or when you |
| make x11 calls into the system. The programming model within those libraries |
| will assume a Linux/Cygwin environment where the stack size grows dynamically</p> |
| <p>As a consequence, those system libraries may allocate large data structures |
| on the stack and overflow the small NuttX stacks. X11, in particular, |
| requires large stacks. If you are using X11 in the simulation, make sure that |
| you set aside a “lot” of stack for the X11 system calls (maybe 8 or 16Kb). |
| The stack size for the thread that begins with user start is controlled by |
| the configuration setting <code class="docutils literal notranslate"><span class="pre">CONFIG_INIT_STACKSIZE</span></code>; you may need to |
| increase this value to larger number to survive the X11 system calls.</p> |
| <p>If you are running X11 applications as NSH add-on programs, then the stack |
| size of the add-on program is controlled in another way. Here are the steps |
| for increasing the stack size in that case:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cd ../apps/namedapps # Go to the namedapps directory |
| vi namedapps_list.h # Edit this file and increase the stack size of the add-on |
| rm .built *.o # This will force the namedapps logic to rebuild |
| </pre></div> |
| </div> |
| </li> |
| </ol> |
| </section> |
| </section> |
| <section id="unit-tests-directories"> |
| <h4>Unit Tests Directories<a class="headerlink" href="#unit-tests-directories" title="Permalink to this heading"></a></h4> |
| <p>The following provide simple unit tests for each of the NXWidgets. In addition, |
| these unit tests provide examples for the use of each widget type.</p> |
| <ul class="simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CButton</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CButton</span></code> widget.</p></li> |
| <li><p>Depends on <code class="docutils literal notranslate"><span class="pre">CLabel</span></code>.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CButtonArray</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CButtonArray</span></code> widget.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CCheckBox</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CCheckBox</span></code> widget.</p></li> |
| <li><p>Depends on <code class="docutils literal notranslate"><span class="pre">CLabel</span></code> and <code class="docutils literal notranslate"><span class="pre">CButton</span></code>.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CGlyphButton</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CGlyphButton</span></code> widget.</p></li> |
| <li><p>Depends on <code class="docutils literal notranslate"><span class="pre">CLabel</span></code> and <code class="docutils literal notranslate"><span class="pre">CButton</span></code>.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CImage</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CImage</span></code> widget.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CLabel</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CLabel</span></code> widget.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CProgressBar</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CProgressBar</span></code> widget.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CRadioButton</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CRadioButton</span></code> and <code class="docutils literal notranslate"><span class="pre">CRadioButtonGroup</span></code> widgets.</p></li> |
| <li><p>Depends on <code class="docutils literal notranslate"><span class="pre">CLabel</span></code> and <code class="docutils literal notranslate"><span class="pre">CButton</span></code>.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CScrollBarHorizontal</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">ScrollbarHorizontal</span></code>.</p></li> |
| <li><p>Depends on <code class="docutils literal notranslate"><span class="pre">CSliderHorizontal</span></code> and <code class="docutils literal notranslate"><span class="pre">CGlyphButton</span></code>.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CScrollBarVertical</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">ScrollbarHorizontal</span></code>.</p></li> |
| <li><p>Depends on <code class="docutils literal notranslate"><span class="pre">CSliderVertical</span></code> and <code class="docutils literal notranslate"><span class="pre">CGlyphButton</span></code>.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CSliderHorizontal</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CSliderHorizontal</span></code>.</p></li> |
| <li><p>Depends on <code class="docutils literal notranslate"><span class="pre">CSliderHorizontalGrip</span></code>.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CSliderVertical</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CSliderVertical</span></code>.</p></li> |
| <li><p>Depends on <code class="docutils literal notranslate"><span class="pre">CSliderVerticalGrip</span></code>.</p></li> |
| </ul> |
| </li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">CTextBox</span></code></p> |
| <ul> |
| <li><p>Exercises the <code class="docutils literal notranslate"><span class="pre">CTextBox</span></code> widget.</p></li> |
| <li><p>Depends on <code class="docutils literal notranslate"><span class="pre">CLabel</span></code>.</p></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </section> |
| </section> |
| </section> |
| |
| |
| </div> |
| </div> |
| <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> |
| <a href="../lvgl/index.html" class="btn btn-neutral float-left" title="lvgl LVGL" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> |
| <a href="../nxwm/index.html" class="btn btn-neutral float-right" title="nxwm NuttX Tiny Window Manager (NxWM)" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> |
| </div> |
| |
| <hr/> |
| |
| <div role="contentinfo"> |
| <p>© Copyright 2023, The Apache Software Foundation.</p> |
| </div> |
| |
| |
| |
| </footer> |
| </div> |
| </div> |
| </section> |
| </div> |
| <script> |
| jQuery(function () { |
| SphinxRtdTheme.Navigation.enable(true); |
| }); |
| </script> |
| |
| </body> |
| </html> |