| <!-- |
| 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.18.1: http://docutils.sourceforge.net/" /> |
| |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| <title>/tools Host Tools — NuttX latest documentation</title> |
| <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> |
| <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> |
| <link rel="stylesheet" href="../../_static/copybutton.css" type="text/css" /> |
| <link rel="stylesheet" href="../../_static/tabs.css" type="text/css" /> |
| <link rel="stylesheet" href="../../_static/custom.css" type="text/css" /> |
| <link rel="shortcut icon" href="../../_static/favicon.ico"/> |
| <!--[if lt IE 9]> |
| <script src="../../_static/js/html5shiv.min.js"></script> |
| <![endif]--> |
| |
| <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="Architecture-Specific Code" href="../arch/index.html" /> |
| <link rel="prev" title="Syscall Layer" href="../syscall.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> |
| |
| </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 current"><a class="reference internal" href="../index.html">OS Components</a><ul class="current"> |
| <li class="toctree-l2"><a class="reference internal" href="../binfmt.html">Binary Loader</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../drivers/index.html">Device Drivers</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../nxflat.html">NXFLAT</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../nxgraphics/index.html">NX Graphics Subsystem</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../paging.html">On-Demand Paging</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../audio/index.html">Audio Subsystem</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../filesystem/index.html">NuttX File System</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../libs/index.html">NuttX libraries</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../net/index.html">Network Support</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../mm/index.html">Memory Management</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../syscall.html">Syscall Layer</a></li> |
| <li class="toctree-l2 current"><a class="current reference internal" href="#"><code class="docutils literal notranslate"><span class="pre">/tools</span></code> Host Tools</a><ul> |
| <li class="toctree-l3"><a class="reference internal" href="#cmpconfig-c">cmpconfig.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#config-mk">Config.mk</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#checkpatch-sh">checkpatch.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#configure-sh-configure-bat-configure-c-cfgparser-c-and-cfgparser-h">configure.sh configure.bat configure.c, cfgparser.c, and cfgparser.h</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#convert-comments-c">convert-comments.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#detab-c">detab.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#discover-py">discover.py</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#gencromfs-c">gencromfs.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#initialconfig-c">initialconfig.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#kconfig2html-c">kconfig2html.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#libraries-mk-flatlibs-mk-protectedlibs-mk-and-kernellib-mk">Libraries.mk, FlatLibs.mk, ProtectedLibs.mk, and KernelLib.mk</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#lowhex-c">lowhex.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#makefile-unix-win">Makefile.[unix|win]</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mkconfig-c-cfgdefine-c-and-cfgdefine-h">mkconfig.c, cfgdefine.c, and cfgdefine.h</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mkconfigvars-sh">mkconfigvars.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mkexport-sh-and-export-mk">mkexport.sh and Export.mk</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mkfsdata-pl">mkfsdata.pl</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mkversion-c-cfgdefine-c-and-cfgdefine-h">mkversion.c, cfgdefine.c, and cfgdefine.h</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mksyscall-c-cvsparser-c-and-cvsparser-h">mksyscall.c, cvsparser.c, and cvsparser.h</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mksymtab-c-cvsparser-c-and-cvsparser-h">mksymtab.c, cvsparser.c, and cvsparser.h</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mkctags-sh">mkctags.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#nxstyle-c">nxstyle.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#pic32mx">pic32mx</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#bdf-convert-c">bdf-convert.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#define-sh-and-define-bat">define.sh and define.bat</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#flash-writer-py">flash_writer.py</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#ide-exporter-py">ide_exporter.py</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#incdir-sh-incdir-bat-and-incdir-c">incdir.sh, incdir.bat, and incdir.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#indent-sh">indent.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#kconfig-bat">kconfig.bat</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#link-sh-link-bat-copydir-sh-copydir-bat-unlink-sh-and-unlink-bat">link.sh, link.bat, copydir.sh, copydir.bat, unlink.sh, and unlink.bat</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#makefile-host">Makefile.host</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mkromfsimg-sh">mkromfsimg.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#mkdeps-c-cnvwindeps-c-mkwindeps-sh-and-mknulldeps-sh">mkdeps.c, cnvwindeps.c, mkwindeps.sh, and mknulldeps.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#netusb-sh">netusb.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#refresh-sh">refresh.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#rmcr-c">rmcr.c</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#sethost-sh">sethost.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#simhostroute-sh">simhostroute.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#simbridge-sh">simbridge.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#showsize-sh">showsize.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#testbuild-sh">testbuild.sh</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#uncrustify-cfg">uncrustify.cfg</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#zds">zds</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#zipme-sh">zipme.sh</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l2"><a class="reference internal" href="../arch/index.html">Architecture-Specific Code</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../boards.html">Boards Support</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../cmake.html">CMake Support</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../openamp.html">OpenAMP Support</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../video.html">Video Subsystem</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../crypto.html">Crypto API Subsystem</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../wireless.html">Wireless Subsystem</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l1"><a class="reference internal" href="../../applications/index.html">Applications</a></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> |
| </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">OS Components</a></li> |
| <li class="breadcrumb-item active"><code class="docutils literal notranslate"><span class="pre">/tools</span></code> Host Tools</li> |
| <li class="wy-breadcrumbs-aside"> |
| <a href="../../_sources/components/tools/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="tools-host-tools"> |
| <h1><code class="docutils literal notranslate"><span class="pre">/tools</span></code> Host Tools<a class="headerlink" href="#tools-host-tools" title="Permalink to this heading"></a></h1> |
| <p>This page discusses the contents of the NuttX tools/ directory.</p> |
| <p>The tools/ directory contains miscellaneous scripts and host C programs |
| that are necessary parts of the NuttX build system.</p> |
| <section id="cmpconfig-c"> |
| <h2>cmpconfig.c<a class="headerlink" href="#cmpconfig-c" title="Permalink to this heading"></a></h2> |
| <p>This C file can be used to build a utility for comparing two NuttX |
| configuration files.</p> |
| </section> |
| <section id="config-mk"> |
| <h2>Config.mk<a class="headerlink" href="#config-mk" title="Permalink to this heading"></a></h2> |
| <p>Config.mk contains common definitions used by many configuration files. |
| This file (along with <nuttx>/.config) must be included at the top of |
| each configuration-specific Make.defs file like:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>include $(TOPDIR)/.config |
| include $(TOPDIR)/tools/Config.mk |
| </pre></div> |
| </div> |
| <p>Subsequent logic within the configuration-specific Make.defs file may then |
| override these default definitions as necessary.</p> |
| </section> |
| <section id="checkpatch-sh"> |
| <h2>checkpatch.sh<a class="headerlink" href="#checkpatch-sh" title="Permalink to this heading"></a></h2> |
| <p><code class="docutils literal notranslate"><span class="pre">checkpatch.sh</span></code> is a bash script that make use of nxstyle and codespell tools |
| to format patches and files conform to NuttX coding standard. For example, |
| it has been used in NuttX github action PR check build</p> |
| <p>Help message:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/checkpatch.sh -h |
| USAGE: ./tools/checkpatch.sh [options] [list|-] |
| |
| Options: |
| -h |
| -c spell check with codespell(install with: pip install codespell) |
| -r range check only (coupled with -p or -g) |
| -p <patch list> (default) |
| -g <commit list> |
| -f <file list> |
| - read standard input mainly used by git pre-commit hook as below: |
| git diff --cached | ./tools/checkpatch.sh - |
| Where a <commit list> is any syntax supported by git for specifying git revision, see GITREVISIONS(7) |
| Where a <patch file names> is a space separated list of patch file names or wildcard. or *.patch |
| </pre></div> |
| </div> |
| </section> |
| <section id="configure-sh-configure-bat-configure-c-cfgparser-c-and-cfgparser-h"> |
| <h2>configure.sh configure.bat configure.c, cfgparser.c, and cfgparser.h<a class="headerlink" href="#configure-sh-configure-bat-configure-c-cfgparser-c-and-cfgparser-h" title="Permalink to this heading"></a></h2> |
| <p>configure.sh is a bash script that is used to configure NuttX for a given |
| target board in a environment that supports POSIX paths (Linux, Cygwin, |
| macOS, or similar). See <a class="reference internal" href="../boards.html"><span class="doc">Boards Support</span></a> or Documentation/NuttXPortingGuide.html |
| for a description of how to configure NuttX with this script.</p> |
| <p>configure.c, cfgparser.c, and cfgparser.h can be used to build a work-alike |
| program as a replacement for configure.sh. This work-alike program would be |
| used in environments that do not support Bash scripting (such as the Windows |
| native environment).</p> |
| <p>configure.bat is a small Windows batch file that can be used as a replacement |
| for configure.sh in a Windows native environment. configure.bat is actually |
| just a thin layer that executes configure.exe if it is available. If |
| configure.exe is not available, then configure.bat will attempt to build it |
| first.</p> |
| <p>In order to build configure.exe from configure.c in the Windows native |
| environment, two assumptions are made:</p> |
| <ol class="arabic simple"> |
| <li><p>You have installed the MinGW GCC toolchain. This toolchain can be |
| downloaded from <a class="reference external" href="http://www.mingw.org/">http://www.mingw.org/</a>. It is recommended that you not |
| install the optional MSYS components as there may be conflicts.</p></li> |
| <li><p>That path to the bin/ directory containing mingw-gcc.exe must be |
| included in the PATH variable.</p></li> |
| </ol> |
| </section> |
| <section id="convert-comments-c"> |
| <h2>convert-comments.c<a class="headerlink" href="#convert-comments-c" title="Permalink to this heading"></a></h2> |
| <p>Convert C++-style comments to C89 C-style comments. Usage:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>convert-comments <source-file> <out-file> |
| </pre></div> |
| </div> |
| </section> |
| <section id="detab-c"> |
| <h2>detab.c<a class="headerlink" href="#detab-c" title="Permalink to this heading"></a></h2> |
| <p>Convert tabs to spaces in a file. Usage:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>detab [-4] <source-file> <out-file> |
| </pre></div> |
| </div> |
| <p>Default <source-file> tab size is 8 spaces; -4 selects 4 space tab size.</p> |
| </section> |
| <section id="discover-py"> |
| <h2>discover.py<a class="headerlink" href="#discover-py" title="Permalink to this heading"></a></h2> |
| <p>Example script for discovering devices in the local network. |
| It is the counter part to apps/netutils/discover</p> |
| </section> |
| <section id="gencromfs-c"> |
| <h2>gencromfs.c<a class="headerlink" href="#gencromfs-c" title="Permalink to this heading"></a></h2> |
| <p>This is a C program that is used to generate CROMFS file system images. |
| Usage is simple:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>gencromfs <dir-path> <out-file> |
| </pre></div> |
| </div> |
| <p>Where:</p> |
| <ul class="simple"> |
| <li><p><dir-path> is the path to the directory will be at the root of the |
| new CROMFS file system image.</p></li> |
| <li><p><out-file> the name of the generated, output C file. This file must |
| be compiled in order to generate the binary CROMFS file system |
| image.</p></li> |
| </ul> |
| </section> |
| <section id="initialconfig-c"> |
| <h2>initialconfig.c<a class="headerlink" href="#initialconfig-c" title="Permalink to this heading"></a></h2> |
| <p>This is a C file that can be used to create an initial configuration. |
| This permits creating a new configuration from scratch, without |
| relying on any existing board configuration in place. This utility |
| will create a barebones .config file sufficient only for |
| instantiating the symbolic links necessary to do a real configuration.</p> |
| </section> |
| <section id="kconfig2html-c"> |
| <h2>kconfig2html.c<a class="headerlink" href="#kconfig2html-c" title="Permalink to this heading"></a></h2> |
| <p>This is a C file that can be used to build a utility for converting the |
| NuttX configuration in the Kconfig files to an HTML document. This |
| auto-generated documentation will, eventually, replace the manually |
| updated configuration documentation that is falling woefully behind:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/kconfig2html.exe -h |
| USAGE: tools/kconfig2html [-d] [-a <apps directory>] {-o <out file>] [<Kconfig root>] |
| tools/kconfig2html [-h] |
| </pre></div> |
| </div> |
| <p>Where:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>-a : Select relative path to the apps/ directory. This path is relative |
| to the <Kconfig directory>. Default: ../apps |
| -o : Send output to <out file>. Default: Output goes to stdout |
| -d : Enable debug output |
| -h : Prints this message and exits |
| <Kconfig root> is the directory containing the root Kconfig file. |
| Default <Kconfig directory>: . |
| </pre></div> |
| </div> |
| <p>NOTE: In order to use this tool, some configuration must be in-place with |
| all necessary symbolic links. You can establish the configured symbolic |
| links with:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>make context |
| </pre></div> |
| </div> |
| <p>or more quickly with:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>make .dirlinks |
| </pre></div> |
| </div> |
| </section> |
| <section id="libraries-mk-flatlibs-mk-protectedlibs-mk-and-kernellib-mk"> |
| <h2>Libraries.mk, FlatLibs.mk, ProtectedLibs.mk, and KernelLib.mk<a class="headerlink" href="#libraries-mk-flatlibs-mk-protectedlibs-mk-and-kernellib-mk" title="Permalink to this heading"></a></h2> |
| <p>Libraries.mk has the build rules for all NuttX libraries.</p> |
| <p>FlatLibs.mk, ProtectedLibs.mk, and KernelLib.mk: These control the |
| selection of libraries to be built, depending on the selected build mode.</p> |
| </section> |
| <section id="lowhex-c"> |
| <h2>lowhex.c<a class="headerlink" href="#lowhex-c" title="Permalink to this heading"></a></h2> |
| <p>Convert hexadecimal representation in a file from upper- to lower-case. |
| Usage:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>lowhex <source-file> <out-file> |
| </pre></div> |
| </div> |
| </section> |
| <section id="makefile-unix-win"> |
| <h2>Makefile.[unix|win]<a class="headerlink" href="#makefile-unix-win" title="Permalink to this heading"></a></h2> |
| <p>Unix.mk is the Makefile used when building NuttX in Unix-like systems. |
| It is selected from the top-level Makefile.</p> |
| <p>Win.mk is the Makefile used when building natively under Windows. |
| It is selected from the top-level Makefile.</p> |
| </section> |
| <section id="mkconfig-c-cfgdefine-c-and-cfgdefine-h"> |
| <h2>mkconfig.c, cfgdefine.c, and cfgdefine.h<a class="headerlink" href="#mkconfig-c-cfgdefine-c-and-cfgdefine-h" title="Permalink to this heading"></a></h2> |
| <p>These are C files that are used to build mkconfig program. The mkconfig |
| program is used during the initial NuttX build.</p> |
| <p>When you configure NuttX, you will copy a configuration file called .config |
| in the top level NuttX directory (See <a class="reference internal" href="../boards.html"><span class="doc">Boards Support</span></a> or |
| Documentation/NuttXPortingGuide.html). The first time you make NuttX, |
| the top-level makefile will build the mkconfig executable from mkconfig.c |
| (using Makefile.host). The top-level Makefile will then execute the mkconfig |
| program to convert the .config file in the top level directory into |
| include/nuttx/config.h. config.h is a another version of the NuttX |
| configuration that can be included by C files.</p> |
| </section> |
| <section id="mkconfigvars-sh"> |
| <h2>mkconfigvars.sh<a class="headerlink" href="#mkconfigvars-sh" title="Permalink to this heading"></a></h2> |
| <p>The HTML documentation expects to have a copy of the auto-generated |
| configuration variable documentation Documentation/NuttXConfigVariables.html. |
| The script mkconfigvars.sh is a simple script that can be used to |
| re-generated that file as needed.</p> |
| <p>Help:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/mkconfigvars.sh -h |
| tools/mkconfigvars.sh is a tool for generation of configuration variable documentation |
| </pre></div> |
| </div> |
| <p>USAGE: tools/mkconfigvars.sh [-d|h] [-v <major.minor.patch>]</p> |
| <p>Where:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>-v <major.minor.patch> |
| The NuttX version number expressed as a major, minor and patch number separated |
| by a period |
| -d |
| Enable script debug |
| -h |
| show this help message and exit |
| </pre></div> |
| </div> |
| </section> |
| <section id="mkexport-sh-and-export-mk"> |
| <h2>mkexport.sh and Export.mk<a class="headerlink" href="#mkexport-sh-and-export-mk" title="Permalink to this heading"></a></h2> |
| <p>These implement part of the top-level Makefile’s ‘export’ target. That |
| target will bundle up all of the NuttX libraries, header files, and the |
| startup object into an export-able, binary NuttX distribution. The |
| Export.mk is used only by the mkexport.sh script to parse out options |
| from the top-level Make.defs file.</p> |
| <p>USAGE: tools/mkexport.sh [-d] [-z] [-u] -t <top-dir> [-x <lib-ext>] -l “lib1 [lib2 [lib3 …]]”</p> |
| <p>This script also depends on the environment variable MAKE which is set |
| in the top-level Makefile before starting mkexport.sh. If MAKE is not |
| defined, the script will set it to <cite>which make</cite>.</p> |
| </section> |
| <section id="mkfsdata-pl"> |
| <h2>mkfsdata.pl<a class="headerlink" href="#mkfsdata-pl" title="Permalink to this heading"></a></h2> |
| <p>This perl script is used to build the “fake” file system and CGI support |
| as needed for the apps/netutils/webserver. It is currently used only |
| by the Makefile at apps/examples/uip. That example serves as an example |
| of how to configure the uIP webserver “fake” file system.</p> |
| <p>NOTE: This perl script comes from uIP and was (probably) written |
| by Adam Dunkels. uIP has a license that is compatible with NuttX.</p> |
| </section> |
| <section id="mkversion-c-cfgdefine-c-and-cfgdefine-h"> |
| <h2>mkversion.c, cfgdefine.c, and cfgdefine.h<a class="headerlink" href="#mkversion-c-cfgdefine-c-and-cfgdefine-h" title="Permalink to this heading"></a></h2> |
| <p>This is C file that is used to build mkversion program. The mkversion |
| program is used during the initial NuttX build.</p> |
| <p>When you build NuttX there should be a version file called .version in |
| the top level NuttX directory (See Documentation/NuttXPortingGuide.html). |
| The first time you make NuttX, the top-level makefile will build the |
| mkversion executable from mkversion.c (using Makefile.host). The top-level |
| Makefile will then execute the mkversion program to convert the |
| .version file in the top level directory into include/nuttx/version.h. |
| version.h provides version information that can be included by C files.</p> |
| </section> |
| <section id="mksyscall-c-cvsparser-c-and-cvsparser-h"> |
| <h2>mksyscall.c, cvsparser.c, and cvsparser.h<a class="headerlink" href="#mksyscall-c-cvsparser-c-and-cvsparser-h" title="Permalink to this heading"></a></h2> |
| <p>This is a C file that is used to build mksyscall program. The mksyscall |
| program is used during the initial NuttX build by the logic in the top- |
| level syscall/ directory.</p> |
| <p>If you build NuttX as a separately compiled, monolithic kernel and separate |
| applications, then there is a syscall layer that is used to get from the |
| user application space to the NuttX kernel space. In the user application |
| “proxies” for each of the kernel functions are provided. The proxies have |
| the same function signature as the kernel function, but only execute a |
| system call.</p> |
| <p>Within the kernel, there are “stubs” for each of the system calls. The |
| stubs receive the marshalled system call data, and perform the actually |
| kernel function call (in kernel-mode) on behalf of the proxy function.</p> |
| <p>Information about the stubs and proxies is maintained in a comma separated |
| value (CSV) file in the syscall/ directory. The mksyscall program will |
| accept this CVS file as input and generate all of the required proxy or |
| stub files as output. See <a class="reference internal" href="../syscall.html"><span class="doc">Syscall Layer</span></a> for additional information.</p> |
| </section> |
| <section id="mksymtab-c-cvsparser-c-and-cvsparser-h"> |
| <h2>mksymtab.c, cvsparser.c, and cvsparser.h<a class="headerlink" href="#mksymtab-c-cvsparser-c-and-cvsparser-h" title="Permalink to this heading"></a></h2> |
| <p>This is a C file that is used to build symbol tables from comma separated |
| value (CSV) files. This tool is not used during the NuttX build, but |
| can be used as needed to generate files.</p> |
| <p>USAGE: ./mksymtab [-d] <cvs-file> <symtab-file> [<symtab-name> [<nsymbols-name>]]</p> |
| <p>Where:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span><cvs-file> : The path to the input CSV file (required) |
| <symtab-file> : The path to the output symbol table file (required) |
| <symtab-name> : Optional name for the symbol table variable |
| Default: "g_symtab" |
| <nsymbols-name> : Optional name for the symbol table variable |
| Default: "g_nsymbols" |
| -d : Enable debug output |
| </pre></div> |
| </div> |
| <p>Example:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cd nuttx/tools |
| cat ../syscall/syscall.csv ../lib/libc.csv | sort >tmp.csv |
| ./mksymtab.exe tmp.csv tmp.c |
| </pre></div> |
| </div> |
| </section> |
| <section id="mkctags-sh"> |
| <h2>mkctags.sh<a class="headerlink" href="#mkctags-sh" title="Permalink to this heading"></a></h2> |
| <p>A script for creating ctags from Ken Pettit. See <a class="reference external" href="http://en.wikipedia.org/wiki/Ctags">http://en.wikipedia.org/wiki/Ctags</a> |
| and <a class="reference external" href="http://ctags.sourceforge.net/">http://ctags.sourceforge.net/</a></p> |
| </section> |
| <section id="nxstyle-c"> |
| <h2>nxstyle.c<a class="headerlink" href="#nxstyle-c" title="Permalink to this heading"></a></h2> |
| <p>I am embarrassed that this is here. This program is a complete hack |
| but, unfortunately, it has become so useful to me that I need to keep |
| it here.</p> |
| <p>A little background: I have tinkered with pretty printers for some |
| time and have not been happy with the results. An alternative that |
| occurred to me would be just a standard checker that examines a C |
| file that gives warnings for violations of the coding standard.</p> |
| <p>This turns out to be more difficult that you might think. A pretty |
| printer understands C syntax: They break the file up into its C |
| components then reassembles the output in the format. But parsing the |
| C loses the original file layout and so it not useful in this case.</p> |
| <p>This program instead, uses a collection of heuristics (i.e., hacks and |
| bandaids) to examine the C file for obvious violations of the coding |
| standard. This program is completely ignorant of C syntax; it simply |
| performs crude pattern matching to check the file.</p> |
| <p>Prints formatted messages that are classified as info, warn, error, |
| fatal. In a parsable format that can be used by editors and IDEs.</p> |
| <p>Usage:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>nxstyle [-m <excess>] [-v <level>] [-r <start,count>] <filename> |
| nxstyle -h this help |
| nxstyle -v <level> where level is |
| 0 - no output |
| 1 - PASS/FAIL |
| 2 - output each line (default) |
| </pre></div> |
| </div> |
| <p>See also indent.sh and uncrustify.cfg</p> |
| </section> |
| <section id="pic32mx"> |
| <h2>pic32mx<a class="headerlink" href="#pic32mx" title="Permalink to this heading"></a></h2> |
| <p>This directory contains build tools used only for PIC32MX/Z platforms</p> |
| </section> |
| <section id="bdf-convert-c"> |
| <h2>bdf-convert.c<a class="headerlink" href="#bdf-convert-c" title="Permalink to this heading"></a></h2> |
| <p>This C file is used to build the bdf-converter program. The bdf-converter |
| program can be used to convert fonts in Bitmap Distribution Format (BDF) |
| into fonts that can be used in the NX graphics system.</p> |
| <p>Below are general instructions for creating and installing a new font |
| in the NX graphic system:</p> |
| <ol class="arabic simple"> |
| <li><p>Locate a font in BDF format,</p></li> |
| <li><p>Use the bdf-converter program to convert the BDF font to the NuttX |
| font format. This will result in a C header file containing |
| definitions. That header file should be installed at, for example, |
| libnx/nxfonts/nxfonts_myfont.h.</p></li> |
| </ol> |
| <p>Create a new NuttX configuration variable. For example, suppose |
| you define the following variable: CONFIG_NXFONT_MYFONT. Then |
| you would need to:</p> |
| <ol class="arabic simple" start="3"> |
| <li><p>Define CONFIG_NXFONT_MYFONT=y in your NuttX configuration file.</p></li> |
| </ol> |
| <p>A font ID number has to be assigned for each new font. The font ID |
| is defined in the file include/nuttx/nx/nxfonts.h. Those definitions |
| have to be extended to support your new font. Look at how the font ID |
| enabled by CONFIG_NXFONT_SANS23X27 is defined and add an ID for your |
| new font in a similar fashion:</p> |
| <ol class="arabic" start="4"> |
| <li><p>include/nuttx/nx/nxfonts.h. Add your new font as a possible system |
| default font:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>#if defined(CONFIG_NXFONT_SANS23X27) |
| # define NXFONT_DEFAULT FONTID_SANS23X27 |
| #elif defined(CONFIG_NXFONT_MYFONT) |
| # define NXFONT_DEFAULT FONTID_MYFONT |
| #endif |
| </pre></div> |
| </div> |
| </li> |
| </ol> |
| <p>Then define the actual font ID. Make sure that the font ID value |
| is unique:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>enum nx_fontid_e |
| { |
| FONTID_DEFAULT = 0 /* The default font */ |
| #ifdef CONFIG_NXFONT_SANS23X27 |
| , FONTID_SANS23X27 = 1 /* The 23x27 sans serif font */ |
| #endif |
| #ifdef CONFIG_NXFONT_MYFONT |
| , FONTID_MYFONT = 2 /* My shiny, new font */ |
| #endif |
| ... |
| </pre></div> |
| </div> |
| <p>Now add the font to the NX build system. There are several files that |
| you have to modify to do this. Look how the build system uses the |
| font CONFIG_NXFONT_SANS23X27 for examples:</p> |
| <ol class="arabic" start="5"> |
| <li><p>nuttx/graphics/Makefile. This file needs logic to auto-generate |
| a C source file from the header file that you generated with the |
| the bdf-converter program. Notice NXFONTS_FONTID=2; this must be |
| set to the same font ID value that you defined in the |
| include/nuttx/nx/nxfonts.h file:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>genfontsources: |
| ifeq ($(CONFIG_NXFONT_SANS23X27),y) |
| @$(MAKE) -C nxfonts -f Makefile.sources NXFONTS_FONTID=1 EXTRAFLAGS=$(EXTRAFLAGS) |
| endif |
| ifeq ($(CONFIG_NXFONT_MYFONT),y) |
| @$(MAKE) -C nxfonts -f Makefile.sources NXFONTS_FONTID=2 EXTRAFLAGS=$(EXTRAFLAGS) |
| endif |
| </pre></div> |
| </div> |
| </li> |
| <li><p>nuttx/libnx/nxfonts/Make.defs. Set the make variable NXFSET_CSRCS. |
| NXFSET_CSRCS determines the name of the font C file to build when |
| NXFONTS_FONTID=2:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>ifeq ($(CONFIG_NXFONT_SANS23X27),y) |
| NXFSET_CSRCS += nxfonts_bitmaps_sans23x27.c |
| endif |
| ifeq ($(CONFIG_NXFONT_MYFONT),y) |
| NXFSET_CSRCS += nxfonts_bitmaps_myfont.c |
| endif |
| </pre></div> |
| </div> |
| </li> |
| <li><p>nuttx/libnx/nxfonts/Makefile.sources. This is the Makefile used |
| in step 5 that will actually generate the font C file. So, given |
| your NXFONTS_FONTID=2, it needs to determine a prefix to use for |
| auto-generated variable and function names and (again) the name of |
| the auto-generated file to create (this must be the same name that |
| was used in nuttx/libnx/nxfonts/Make.defs):</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>ifeq ($(NXFONTS_FONTID),1) |
| NXFONTS_PREFIX := g_sans23x27_ |
| GEN_CSRC = nxfonts_bitmaps_sans23x27.c |
| endif |
| ifeq ($(NXFONTS_FONTID),2) |
| NXFONTS_PREFIX := g_myfont_ |
| GEN_CSRC = nxfonts_bitmaps_myfont.c |
| endif |
| </pre></div> |
| </div> |
| </li> |
| <li><p>graphics/libnx/nxfonts_bitmaps.c. This is the file that contains |
| the generic font structures. It is used as a “template” file by |
| nuttx/libnx/nxfonts/Makefile.sources to create your customized |
| font data set:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>#if NXFONTS_FONTID == 1 |
| # include "nxfonts_sans23x27.h" |
| #elif NXFONTS_FONTID == 2 |
| # include "nxfonts_myfont.h" |
| #else |
| # error "No font ID specified" |
| #endif |
| </pre></div> |
| </div> |
| <p>Where nxfonts_myfont.h is the NuttX font file that we generated in |
| step 2 using the bdf-converter tool.</p> |
| </li> |
| <li><p>libnx/nxfonts/nxfonts_getfont.c. Finally, we need to extend the |
| logic that does the run-time font lookups so that can find our new |
| font. The lookup function is NXHANDLE nxf_getfonthandle(enum nx_fontid_e fontid). |
| The new font information needs to be added to data structures used by |
| that function:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>#ifdef CONFIG_NXFONT_SANS23X27 |
| extern const struct nx_fontpackage_s g_sans23x27_package; |
| #endif |
| #ifdef CONFIG_NXFONT_MYFONT |
| extern const struct nx_fontpackage_s g_myfont_package; |
| #endif |
| |
| static FAR const struct nx_fontpackage_s *g_fontpackages[] = |
| { |
| #ifdef CONFIG_NXFONT_SANS23X27 |
| &g_sans23x27_package, |
| #endif |
| #ifdef CONFIG_NXFONT_MYFONT |
| &g_myfont_package, |
| #endif |
| NULL |
| }; |
| </pre></div> |
| </div> |
| </li> |
| </ol> |
| </section> |
| <section id="define-sh-and-define-bat"> |
| <h2>define.sh and define.bat<a class="headerlink" href="#define-sh-and-define-bat" title="Permalink to this heading"></a></h2> |
| <p>Different compilers have different conventions for specifying pre- |
| processor definitions on the compiler command line. This bash |
| script allows the build system to create command line definitions |
| without concern for the particular compiler in use.</p> |
| <p>The define.bat script is a counterpart for use in the native Windows |
| build.</p> |
| </section> |
| <section id="flash-writer-py"> |
| <h2>flash_writer.py<a class="headerlink" href="#flash-writer-py" title="Permalink to this heading"></a></h2> |
| <p>This flash writer is using the xmodem for firmware transfer on |
| boards based on cxd56 chip (Ex. Spresense). This tool depends on |
| the xmodem package (<a class="reference external" href="https://pypi.org/project/xmodem/">https://pypi.org/project/xmodem/</a>).</p> |
| <p>for flashing the .spk image to the board please use: |
| tools/flash_writer.py -s -c /dev/ttyUSB0 -d -b 115200 -n nuttx.spk</p> |
| </section> |
| <section id="ide-exporter-py"> |
| <h2>ide_exporter.py<a class="headerlink" href="#ide-exporter-py" title="Permalink to this heading"></a></h2> |
| <p>This Python script will help to create NuttX project in the IAR and |
| uVision IDEs. These are few simple the steps to export the IDE |
| workspaces.</p> |
| <ol class="arabic"> |
| <li><p>Start the NuttX build from the Cygwin command line before trying to |
| create your project by running:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>make V=1 |& tee build_log |
| </pre></div> |
| </div> |
| <p>This is necessary to certain auto-generated files and directories that |
| will be needed. This will provide the build log to construct the IDE |
| project also.</p> |
| </li> |
| <li><p>Export the IDE project base on that make log. The script usage:</p> |
| <p>usage: ide_exporter.py [-h] [-v] [-o OUT_DIR] [-d] build_log {iar,uvision_armcc,uvision_gcc} template_dir</p> |
| <p>positional arguments:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>build_log Log file from make V=1 |
| {iar,uvision_armcc,uvision_gcc} |
| The target IDE: iar, uvision_gcc, (uvision_armcc is experimental) |
| template_dir Directory that contains IDEs template projects |
| </pre></div> |
| </div> |
| <p>optional arguments:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>-h, --help show this help message and exit |
| -v, --version show program's version number and exit |
| -o OUT_DIR, --output OUT_DIR |
| Output directory |
| -d, --dump Dump project structure tree |
| </pre></div> |
| </div> |
| <p>Example:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cd nuttx |
| make V=1 |& tee build_log |
| |
| ./tools/ide_exporter.py makelog_f2nsh_c iar ./boards/<arch>/<chip>/<board>/ide/template/iar -o ./boards/<arch>/<chip>/<board>/ide/nsh/iar |
| </pre></div> |
| </div> |
| <p>or:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>./tools/ide_exporter.py makelog_f2nsh_c uvision_gcc ./boards/<arch>/<chip>/<board>/ide/template/uvision_gcc/ -o ./boards/<arch>/<chip>/<board>/ide/nsh/uvision |
| </pre></div> |
| </div> |
| </li> |
| <li><p>Limitations:</p> |
| <blockquote> |
| <div><ul> |
| <li><p>IAR supports C only. Iar C++ does not compatible with g++ so disable |
| C++ if you want to use IAR.</p></li> |
| <li><p>uvision_armcc : nuttx asm (inline and .asm) can’t be compiled with |
| armcc so do not use this option.</p></li> |
| <li><p>uvision_gcc : uvision project that uses gcc. Need to specify path to |
| gnu toolchain. |
| In uVison menu, select:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Project/Manage/Project Items.../FolderExtension/Use GCC compiler/ PreFix, Folder |
| </pre></div> |
| </div> |
| </li> |
| </ul> |
| </div></blockquote> |
| </li> |
| <li><p>Template projects’ constrains:</p> |
| <blockquote> |
| <div><ul> |
| <li><p>mcu, core, link script shall be configured in template project</p></li> |
| <li><p>Templates’ name are fixed:</p> |
| <blockquote> |
| <div><ul class="simple"> |
| <li><p>template_nuttx.eww : IAR nuttx workspace template</p></li> |
| <li><p>template_nuttx_lib.ewp : IAR nuttx library project template</p></li> |
| <li><p>template_nuttx_main.ewp : IAR nuttx main project template</p></li> |
| <li><p>template_nuttx.uvmpw : uVision workspace</p></li> |
| <li><p>template_nuttx_lib.uvproj : uVision library project</p></li> |
| <li><p>template_nuttx_main.uvproj : uVision main project</p></li> |
| </ul> |
| </div></blockquote> |
| </li> |
| <li><p>iar:</p> |
| <blockquote> |
| <div><ul class="simple"> |
| <li><dl class="simple"> |
| <dt>Library option shall be set to ‘None’ so that IAR could use nuttx</dt><dd><p>libc</p> |
| </dd> |
| </dl> |
| </li> |
| <li><p>__ASSEMBLY__ symbol shall be defined in assembler</p></li> |
| </ul> |
| </div></blockquote> |
| </li> |
| <li><p>uVision_gcc:</p> |
| <blockquote> |
| <div><ul class="simple"> |
| <li><p>There should be one fake .S file in projects that has been defined |
| __ASSEMBLY__ in assembler.</p></li> |
| <li><p>In Option/CC tab : disable warning</p></li> |
| <li><p>In Option/CC tab : select Compile thump code (or Misc control = |
| -mthumb)</p></li> |
| <li><p>template_nuttx_lib.uvproj shall add ‘Post build action’ to copy .a |
| file to .lib</p></li> |
| <li><p>template_nuttx_main.uvproj Linker:</p> |
| <ul> |
| <li><p>Select ‘Do not use Standard System Startup Files’ and ‘Do not |
| use Standard System Libraries’</p></li> |
| <li><p>Do not select ‘Use Math libraries’</p></li> |
| <li><p>Misc control = –entry=__start</p></li> |
| </ul> |
| </li> |
| </ul> |
| </div></blockquote> |
| </li> |
| </ul> |
| </div></blockquote> |
| </li> |
| <li><p>How to create template for other configurations:</p> |
| <blockquote> |
| <div><ol class="arabic"> |
| <li><p>uVision with gcc toolchain:</p> |
| <blockquote> |
| <div><ul class="simple"> |
| <li><p>Copy 3 uVision project files</p></li> |
| <li><p>Select the MCU for main and lib project</p></li> |
| <li><p>Correct the path to ld script if needed</p></li> |
| </ul> |
| </div></blockquote> |
| </li> |
| <li><p>iar:</p> |
| <blockquote> |
| <div><ul class="simple"> |
| <li><p>Check if the arch supports IAR (only armv7-m is support IAR |
| now)</p></li> |
| <li><p>Select the MCU for main and lib project</p></li> |
| <li><p>Add new ld script file for IAR</p></li> |
| </ul> |
| </div></blockquote> |
| </li> |
| </ol> |
| </div></blockquote> |
| </li> |
| </ol> |
| <p>NOTE: Due to bit rot, the template files for the stm3220g-eval and for |
| the stm32f429-disco have been removed from the NuttX repository. For |
| reference, they can be found in the Obsoleted repository at |
| Obsoleted/stm32f429i_disco/ltcd/template and at |
| Obsoleted/stm3220g-eval/template.</p> |
| </section> |
| <section id="incdir-sh-incdir-bat-and-incdir-c"> |
| <h2>incdir.sh, incdir.bat, and incdir.c<a class="headerlink" href="#incdir-sh-incdir-bat-and-incdir-c" title="Permalink to this heading"></a></h2> |
| <p>Different compilers have different conventions for specifying lists |
| of include file paths on the compiler command line. This incdir.sh |
| bash script allows the build system to create include file paths without |
| concern for the particular compiler in use.</p> |
| <p>The incdir.bat script is a counterpart for use in the native Windows |
| build. However, there is currently only one compiler supported in |
| that context: MinGW-GCC.</p> |
| <p>incdir.c is a higher performance version of incdir.sh, converted to C.</p> |
| </section> |
| <section id="indent-sh"> |
| <h2>indent.sh<a class="headerlink" href="#indent-sh" title="Permalink to this heading"></a></h2> |
| <p>This script can be used to indent .c and .h files in a manner similar |
| to the NuttX coding style. It doesn’t do a really good job, however |
| (see below and the comments at the top of the indent.sh file).</p> |
| <p>USAGE:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>tools/indent.sh [-d] [-p] -o <out-file> <in-file> |
| tools/indent.sh [-d] [-p] <in-file-list> |
| tools/indent.sh [-d] -h |
| </pre></div> |
| </div> |
| <p>Where:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>-<in-file> |
| A single, unformatted input file |
| -<in-file-list> |
| A list of unformatted input files that will be reformatted in place. |
| -o <out-file> |
| Write the single, reformatted <in-file> to <out-file>. <in-file> |
| will not be modified. |
| -d |
| Enable script debug |
| -p |
| Comments are pre-formatted. Do not reformat. |
| -h |
| Show this help message and exit |
| </pre></div> |
| </div> |
| <p>The conversions make by the indent.sh script differs from the NuttX coding |
| style in that:</p> |
| <ol class="arabic simple"> |
| <li><p>The coding standard requires that the trailing <code class="docutils literal notranslate"><span class="pre">*/</span></code> of a multi-line |
| comment be on a separate line. By default, indent.sh will put the |
| final <code class="docutils literal notranslate"><span class="pre">*/</span></code> on the same line as the last comment text. If your C file |
| already has properly formatted comments then using the <code class="docutils literal notranslate"><span class="pre">-p</span></code> option will |
| eliminate that bad behavior</p></li> |
| <li><p>If your source file has highly formatted comments containing things |
| such as tables or lists, then use the -p option to preserve those |
| pre-formatted comments.</p></li> |
| <li><p>I usually align things vertically (like ‘=’ in assignments),</p></li> |
| <li><p>indent.sh puts a bogus blank line at the top of the file,</p></li> |
| <li><p>I don’t like the way it handles nested conditional compilation |
| intermixed with code. I prefer the preprocessor conditional tests |
| be all right justified in that case.</p></li> |
| <li><p>I also indent brackets differently on structures than does this script.</p></li> |
| <li><p>I normally use no spaces in casts. indent.sh adds spaces in casts like |
| <code class="docutils literal notranslate"><span class="pre">(FAR</span> <span class="pre">void</span> <span class="pre">*)&foo</span></code> becomes <code class="docutils literal notranslate"><span class="pre">(FAR</span> <span class="pre">void</span> <span class="pre">*)</span> <span class="pre">&</span> <span class="pre">foo</span></code>.</p></li> |
| <li><p>When used with header files, the initial idempotence conditional test |
| causes all preprocessor directives to be indented in the file. So for |
| header files, you will need to substitute “^# ” with “#” in the |
| converted header file.</p></li> |
| </ol> |
| <p>You will manually need to check for the issues listed above after |
| performing the conversions. nxstyle.c provides a good test that will |
| catch most of the indent.sh screw-ups. Together, they do a pretty good |
| job of formatting.</p> |
| <p>See also nxstyle.c and uncrustify.cfg</p> |
| </section> |
| <section id="kconfig-bat"> |
| <h2>kconfig.bat<a class="headerlink" href="#kconfig-bat" title="Permalink to this heading"></a></h2> |
| <p>Recent versions of NuttX support building NuttX from a native Windows |
| CMD.exe shell. But kconfig-frontends is a Linux tool and is not yet |
| available in the pure CMD.exe environment. At this point, there are |
| only a few options for the Windows user (see the top-level README.txt |
| file).</p> |
| <p>You can, with some effort, run the Cygwin kconfig-mconf tool directly |
| in the CMD.exe shell. In this case, you do not have to modify the |
| .config file, but there are other complexities: You need to |
| temporarily set the Cygwin directories in the PATH variable and |
| then run kconfig-mconf outside of the Make system.</p> |
| <p>kconfig.bat is a Windows batch file at tools/kconfig.bat that automates |
| these steps. It is used from the top-level NuttX directory like:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>tools/kconfig menuconfig |
| </pre></div> |
| </div> |
| <p>NOTE: There is currently an issue with accessing DOS environment |
| variables from the Cygwin kconfig-mconf running in the CMD.exe shell. |
| The following change to the top-level Kconfig file seems to work around |
| these problems:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>config APPSDIR |
| string |
| - option env="APPSDIR" |
| + default "../apps" |
| </pre></div> |
| </div> |
| </section> |
| <section id="link-sh-link-bat-copydir-sh-copydir-bat-unlink-sh-and-unlink-bat"> |
| <h2>link.sh, link.bat, copydir.sh, copydir.bat, unlink.sh, and unlink.bat<a class="headerlink" href="#link-sh-link-bat-copydir-sh-copydir-bat-unlink-sh-and-unlink-bat" title="Permalink to this heading"></a></h2> |
| <p>Different file systems have different capabilities for symbolic links. |
| Some Windows file systems have no native support for symbolic links. |
| Cygwin running under Windows has special links built in that work with |
| all cygwin tools. However, they do not work when Windows native tools |
| are used with cygwin. In that case something different must be done.</p> |
| <p>If you are building under Linux or under cygwin with a cygwin tool |
| chain, then your Make.defs file may have definitions like the |
| following:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>DIRLINK = $(TOPDIR)/tools/link.sh |
| DIRUNLINK = (TOPDIR)/tools/unlink.sh |
| </pre></div> |
| </div> |
| <p>The first definition is not always present because link.sh is the |
| default. link.sh is a bash script that performs a normal, Linux-style |
| symbolic link; unlink.sh is a do-it-all unlinking script.</p> |
| <p>But if you are building under cygwin using a Windows native toolchain |
| within a POSIX framework (such as Cygwin), then you will need something |
| like the following in you Make.defs file:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>DIRLINK = $(TOPDIR)/tools/copydir.sh |
| DIRUNLINK = (TOPDIR)/tools/unlink.sh |
| </pre></div> |
| </div> |
| <p>copydir.sh will copy the whole directory instead of linking it.</p> |
| <p>Finally, if you are running in a pure native Windows environment with |
| a CMD.exe shell, then you will need something like this:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>DIRLINK = $(TOPDIR)/tools/copydir.bat |
| DIRUNLINK = (TOPDIR)/tools/unlink.bat |
| </pre></div> |
| </div> |
| <p>Note that this will copy directories. link.bat might also be used in |
| this case. link.bat will attempt to create a symbolic link using the |
| NTFS mklink.exe command instead of copying files. That logic, however, |
| has not been verified as of this writing.</p> |
| </section> |
| <section id="makefile-host"> |
| <h2>Makefile.host<a class="headerlink" href="#makefile-host" title="Permalink to this heading"></a></h2> |
| <p>This is the makefile that is used to make the mkconfig program from |
| the mkconfig.c C file, the cmpconfig program from cmpconfig.c C file, |
| the mkversion program from the mkconfig.c C file, or the mksyscall |
| program from the mksyscall.c file. Usage:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cd tools/ |
| make -f Makefile.host <program> |
| </pre></div> |
| </div> |
| </section> |
| <section id="mkromfsimg-sh"> |
| <h2>mkromfsimg.sh<a class="headerlink" href="#mkromfsimg-sh" title="Permalink to this heading"></a></h2> |
| <p>This script may be used to automate the generation of a ROMFS file system |
| image. It accepts an rcS script “template” and generates an image that |
| may be mounted under /etc in the NuttX pseudo file system.</p> |
| <p>TIP: Edit the resulting header file and mark the generated data values |
| as ‘const’ so that they will be stored in FLASH.</p> |
| </section> |
| <section id="mkdeps-c-cnvwindeps-c-mkwindeps-sh-and-mknulldeps-sh"> |
| <h2>mkdeps.c, cnvwindeps.c, mkwindeps.sh, and mknulldeps.sh<a class="headerlink" href="#mkdeps-c-cnvwindeps-c-mkwindeps-sh-and-mknulldeps-sh" title="Permalink to this heading"></a></h2> |
| <p>NuttX uses the GCC compiler’s capabilities to create Makefile dependencies. |
| The program mkdeps is used to run GCC in order to create the dependencies. |
| If a NuttX configuration uses the GCC toolchain, its Make.defs file (see |
| <a class="reference internal" href="../boards.html"><span class="doc">Boards Support</span></a>) will include a line like:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>MKDEP = $(TOPDIR)/tools/mkdeps[.exe] (See NOTE below) |
| </pre></div> |
| </div> |
| <p>If the NuttX configuration does not use a GCC compatible toolchain, then |
| it cannot use the dependencies and instead it uses mknulldeps.sh:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>MKDEP = $(TOPDIR)/tools/mknulldeps.sh |
| </pre></div> |
| </div> |
| <p>The mknulldeps.sh is a stub script that does essentially nothing.</p> |
| <p>mkwindeps.sh is a version that creates dependencies using the Windows |
| native toolchain. That generates Windows native paths in the dependency |
| file. But the mkwindeps.sh uses cnvwindeps.c to convert the Windows |
| paths to POSIX paths. This adds some time to the Windows dependency |
| generation but is generally the best option available for that mixed |
| environment of Cygwin with a native Windows GCC toolchain.</p> |
| <p>mkdeps.c generates mkdeps (on Linux) or mkdeps.exe (on Windows). |
| However, this version is still under-development. It works well in |
| the all POSIX environment or in the all Windows environment but also |
| does not work well in mixed POSIX environment with a Windows toolchain. |
| In that case, there are still issues with the conversion of things like |
| ‘c:Program Files’ to ‘c:program files’ by bash. Those issues may, |
| eventually be solvable but for now continue to use mkwindeps.sh in |
| that mixed environment.</p> |
| </section> |
| <section id="netusb-sh"> |
| <h2>netusb.sh<a class="headerlink" href="#netusb-sh" title="Permalink to this heading"></a></h2> |
| <p>Helper script used to set up the CDC ECM Ethernet Over USB driver, |
| host routes, and IP Tables rules to support networking with a NuttX |
| system that has a CDC ECM Ethernet Over USB driver configured. Only |
| supported on Linux.</p> |
| <p>General usage:</p> |
| <blockquote> |
| <div><p>$ ./tools/netusb.sh |
| Usage: tools/netusb.sh <main-interface> <usb-net-interface> <on|off></p> |
| </div></blockquote> |
| <p>This has been tested on the SAMA5D3-Xplained board; see |
| <cite>Documentation/platforms/arm/sama5/boards/sama5d3-xplained/README.txt</cite> |
| for more information on how to configure the CDC ECM driver for that board.</p> |
| </section> |
| <section id="refresh-sh"> |
| <h2>refresh.sh<a class="headerlink" href="#refresh-sh" title="Permalink to this heading"></a></h2> |
| <p>[NOTE: This script with –silent is really obsolete. refresh with the |
| silent option really adds default values. However, as of 217-07-09, |
| defconfig files are retained in a compressed format, i.e., with default |
| values removed. So the –silent option will accomplish nothing. |
| Without –silent, you will have the opportunity over override the default |
| value from the command line and, in that case, the script may still have |
| some minimal value.]</p> |
| <p>This is a bash script that automatics refreshing of board default |
| configuration (defconfig) files. It does not do anything special |
| that you cannot do manually, but is useful for me when I have to |
| update dozens of configuration files.</p> |
| <p>Configuration files have to be updated because over time, the |
| configuration settings change: New configurations are added and |
| new dependencies are added. So an old configuration file may |
| not be usable anymore until it is refreshed.</p> |
| <p>Help is also available:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/refresh.sh --help |
| tools/refresh.sh is a tool for refreshing board configurations |
| </pre></div> |
| </div> |
| <p>USAGE: <code class="docutils literal notranslate"><span class="pre">./refresh.sh</span> <span class="pre">[options]</span> <span class="pre"><board>/<config>+</span></code></p> |
| <p>Where [options] include:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>--debug |
| Enable script debug |
| --silent |
| Update board configuration without interaction |
| --defaults |
| Do not prompt for new default selections; accept all recommended default values |
| --help |
| Show this help message and exit |
| <board> |
| The board directory under nuttx/boards |
| <config> |
| The board configuration directory under nuttx/boards/<arch>/<chip>/<board> |
| </pre></div> |
| </div> |
| <p>The steps to refresh the file taken by refresh.sh are:</p> |
| <ol class="arabic simple"> |
| <li><p>Make tools/cmpconfig if it is not already built.</p></li> |
| <li><p>Copy the defconfig file to the top-level NuttX |
| directory as .config (being careful to save any previous |
| .config file that you might want to keep!).</p></li> |
| <li><p>Execute ‘make oldconfig’ to update the configuration. |
| ‘make oldconfig’ will prompt you for each change in the |
| configuration that requires that you make some decision. |
| With the –silent option, the script will use ‘make |
| oldefconfig’ instead and you won’t have to answer any |
| questions; the refresh will simply accept the default |
| value for any new configuration settings.</p></li> |
| <li><p>Then it runs tools/cmpconfig to show the real differences |
| between the configuration files. Configuration files are |
| complex and things can move around so a simple ‘diff’ between |
| two configuration files is often not useful. But tools/cmpconfig |
| will show only the meaningful differences between the two |
| configuration files.</p></li> |
| <li><p>It will edit the .config file to comment out the setting |
| of the CONFIG_APPS_DIR= setting. This setting should not |
| be in checked-in defconfig files because the actually must |
| be determined at the next time that the configuration is |
| installed.</p></li> |
| <li><p>Finally, the refreshed defconfig file is copied back in |
| place where it can be committed with the next set of |
| difference to the command line. If you select the –silent |
| option, this file copy will occur automatically. Otherwise, |
| refresh.sh will prompt you first to avoid overwriting the |
| defconfig file with changes that you may not want.</p></li> |
| </ol> |
| </section> |
| <section id="rmcr-c"> |
| <h2>rmcr.c<a class="headerlink" href="#rmcr-c" title="Permalink to this heading"></a></h2> |
| <p>Removes all white space from the end of lines. Whitespace here |
| includes space characters, TAB characters, horizontal and vertical |
| TABs, and carriage returns. Lines will be terminated with the |
| newline character only.</p> |
| </section> |
| <section id="sethost-sh"> |
| <h2>sethost.sh<a class="headerlink" href="#sethost-sh" title="Permalink to this heading"></a></h2> |
| <p>Saved configurations may run on Linux, Cygwin (32- or 64-bit), or other |
| platforms. The platform characteristics can be changed use ‘make |
| menuconfig’. Sometimes this can be confusing due to the differences |
| between the platforms. Enter sethost.sh</p> |
| <p>sethost.sh is a simple script that changes a configuration to your |
| host platform. This can greatly simplify life if you use many different |
| configurations. For example, if you are running on Linux and you |
| configure like this:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/configure.sh board:configuration |
| </pre></div> |
| </div> |
| <p>The you can use the following command to both (1) make sure that the |
| configuration is up to date, AND (2) the configuration is set up |
| correctly for Linux:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/sethost.sh -l |
| </pre></div> |
| </div> |
| <p>Or, if you are on a Windows/Cygwin 64-bit platform:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/sethost.sh -c |
| </pre></div> |
| </div> |
| <p>Other options are available:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ ./sethost.sh -h |
| |
| USAGE: ./sethost.sh [-l|m|c|g|n] [make-opts] |
| ./sethost.sh -h |
| |
| Where: |
| -l|m|c|g|n selects Linux (l), macOS (m), Cygwin (c), |
| MSYS/MSYS2 (g) or Windows native (n). Default Linux |
| make-opts directly pass to make |
| -h will show this help test and terminate |
| </pre></div> |
| </div> |
| </section> |
| <section id="simhostroute-sh"> |
| <h2>simhostroute.sh<a class="headerlink" href="#simhostroute-sh" title="Permalink to this heading"></a></h2> |
| <p>Helper script used to set up the tap driver, host routes, |
| and IP Tables rules to support networking with the |
| simulator under Linux. General usage:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/simhostroute.sh |
| Usage: tools/simhostroute.sh <interface> <on|off> |
| </pre></div> |
| </div> |
| <p>See boards/sim/sim/sim/NETWORK-LINUX.txt for further information</p> |
| </section> |
| <section id="simbridge-sh"> |
| <h2>simbridge.sh<a class="headerlink" href="#simbridge-sh" title="Permalink to this heading"></a></h2> |
| <p>Helper script used to set up a bridge to support networking with the |
| simulator under Linux. General usage:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/simbridge.sh |
| Usage: tools/simbridge.sh <interface> <on|off> |
| </pre></div> |
| </div> |
| <p>See boards/sim/sim/sim/NETWORK-LINUX.txt for further information</p> |
| </section> |
| <section id="showsize-sh"> |
| <h2>showsize.sh<a class="headerlink" href="#showsize-sh" title="Permalink to this heading"></a></h2> |
| <p>Show the top 10 biggest memory hogs in code and data spaces. This |
| must be executed from the top-level NuttX directory like:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ tools/showsize.sh |
| TOP 10 BIG DATA |
| ... |
| TOP 10 BIG CODE |
| ... |
| </pre></div> |
| </div> |
| </section> |
| <section id="testbuild-sh"> |
| <h2>testbuild.sh<a class="headerlink" href="#testbuild-sh" title="Permalink to this heading"></a></h2> |
| <p>This script automates building of a set of configurations. The intent is |
| simply to assure that the set of configurations build correctly. The -h |
| option shows the usage:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ ./testbuild.sh -h |
| |
| USAGE: ./testbuild.sh [-l|m|c|g|n] [-d] [-e <extraflags>] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p] [-G] <testlist-file> |
| ./testbuild.sh -h |
| |
| Where: |
| -l|m|c|g|n selects Linux (l), macOS (m), Cygwin (c), |
| MSYS/MSYS2 (g) or Windows native (n). Default Linux |
| -d enables script debug output |
| -e pass extra c/c++ flags such as -Wno-cpp via make command line |
| -x exit on build failures |
| -j <ncpus> passed on to make. Default: No -j make option. |
| -a <appsdir> provides the relative path to the apps/ directory. Default ../apps |
| -t <topdir> provides the absolute path to top nuttx/ directory. Default ../nuttx |
| -p only print the list of configs without running any builds |
| -A store the build executable artifact in ARTIFACTDIR (defaults to ../buildartifacts |
| -C Skip tree cleanness check. |
| -G Use "git clean -xfdq" instead of "make distclean" to clean the tree. |
| This option may speed up the builds. However, note that: |
| * This assumes that your trees are git based. |
| * This assumes that only nuttx and apps repos need to be cleaned. |
| * If the tree has files not managed by git, they will be removed |
| as well. |
| -R execute "run" script in the config directories if exists. |
| -h will show this help test and terminate |
| <testlist-file> selects the list of configurations to test. No default |
| |
| Your PATH variable must include the path to both the build tools and the |
| kconfig-frontends tools |
| </pre></div> |
| </div> |
| <p>These script needs two pieces of information.</p> |
| <ol class="loweralpha simple"> |
| <li><p>A description of the platform that you are testing on. This description |
| is provided by the optional -l, -m, -c, -g and -n options.</p></li> |
| <li><p>A list of configurations to build. That list is provided by a test |
| list file. The final, non-optional parameter, <testlist-file>, |
| provides the path to that file.</p></li> |
| </ol> |
| <p>The test list file is a sequence of build descriptions, one per line. One |
| build descriptions consists of two comma separated values. For example:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>stm32f429i-disco:nsh |
| arduino-due:nsh |
| /arm |
| /risc-v |
| </pre></div> |
| </div> |
| <p>The first value is the usual configuration description of the form |
| <code class="docutils literal notranslate"><span class="pre"><board-name>:<configuration-name></span></code> or <code class="docutils literal notranslate"><span class="pre">/<folder-name></span></code> and must correspond to a |
| configuration or folder in the nuttx/boards directory.</p> |
| <p>The second value is valid name for a toolchain configuration to use |
| when building the configuration. The set of valid toolchain |
| configuration names depends on the underlying architecture of the |
| configured board.</p> |
| <p>The prefix <code class="docutils literal notranslate"><span class="pre">-</span></code> can be used to skip a configuration:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>-stm32f429i-disco/nsh |
| </pre></div> |
| </div> |
| <p>or skip a configuration on a specific host(e.g. Darwin):</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>-Darwin,sim:rpserver |
| </pre></div> |
| </div> |
| </section> |
| <section id="uncrustify-cfg"> |
| <h2>uncrustify.cfg<a class="headerlink" href="#uncrustify-cfg" title="Permalink to this heading"></a></h2> |
| <p>This is a configuration script for the uncrustify code beautifier. |
| Uncrustify does well with forcing braces into “if” statements and |
| indenting per the NuttX C coding standard. It correctly does things |
| like placing all braces on separate lines at the proper indentation |
| level. It cannot handle certain requirements of the coding standard |
| such as</p> |
| <ul class="simple"> |
| <li><p>FAR attributes in pointer declarations.</p></li> |
| <li><p>The NuttX standard function header block comments.</p></li> |
| <li><p>Naming violations such as use of CamelCase variable names, |
| lower case pre-processor definitions, etc.</p></li> |
| </ul> |
| <p>Comment blocks, function headers, files headers, etc. must be formatted |
| manually.</p> |
| <p>Its handling of block comments is fragile. If the comment is perfect, |
| it leaves it alone, but if the block comment is deemed to need a fix |
| it starts erroneously indenting the continuation lines of the comment.</p> |
| <ul> |
| <li><p>uncrustify.cfg messed up the indent of most block comments. |
| cmt_sp_before_star_cont is applied inconsistently. I added:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cmt_indent_multi = false # disable all multi-line comment changes |
| </pre></div> |
| </div> |
| <p>to the .cfg file to limit its damage to block comments.</p> |
| </li> |
| <li><p>It is very strict at wrapping lines at column 78. Even when column 79 |
| just contained the <code class="docutils literal notranslate"><span class="pre">/</span></code> of a closing <code class="docutils literal notranslate"><span class="pre">*/</span></code>. That created many |
| bad continuation lines.</p></li> |
| <li><p>It moved ‘{’ that opened a struct to the line defining the struct. |
| nl_struct_brace = add (or force) seemed to be ignored.</p></li> |
| <li><p>It also aligned variable names in declarations and ‘=’ signs in |
| assignment statements in a seemingly arbitrary manner. Making changes |
| that were not necessary.</p></li> |
| </ul> |
| <p>NOTE: uncrustify.cfg should <strong>ONLY</strong> be used with new files that have an |
| inconsistent coding style. uncrustify.cfg should get you in the ballpark, |
| but you should expect to review and hand-edit the files to assume 100% |
| compliance.</p> |
| <p>WARNING: <strong>NEVER</strong> use uncrustify.cfg for modifications to existing NuttX |
| files. It will probably corrupt the style in subtle ways!</p> |
| <p>This was last verified against uncrustify 0.66.1 by Bob Feretich.</p> |
| <p>About uncrustify: Uncrustify is a highly configurable, easily modifiable |
| source code beautifier. To learn more about uncrustify:</p> |
| <blockquote> |
| <div><p><a class="reference external" href="http://uncrustify.sourceforge.net/">http://uncrustify.sourceforge.net/</a></p> |
| </div></blockquote> |
| <p>Source code is available on GitHub:</p> |
| <blockquote> |
| <div><p><a class="reference external" href="https://github.com/uncrustify/uncrustify">https://github.com/uncrustify/uncrustify</a></p> |
| </div></blockquote> |
| <p>Binary packages are available for Linux via command line installers. |
| Binaries for both Windows and Linux are available at:</p> |
| <blockquote> |
| <div><p><a class="reference external" href="https://sourceforge.net/projects/uncrustify/files/">https://sourceforge.net/projects/uncrustify/files/</a></p> |
| </div></blockquote> |
| <p>See also indent.sh and nxstyle.c</p> |
| </section> |
| <section id="zds"> |
| <h2>zds<a class="headerlink" href="#zds" title="Permalink to this heading"></a></h2> |
| <p>This directory contains build tools used only with the ZDS-II |
| platforms (z8, ez80, zNeo).</p> |
| </section> |
| <section id="zipme-sh"> |
| <h2>zipme.sh<a class="headerlink" href="#zipme-sh" title="Permalink to this heading"></a></h2> |
| <p>I use this script to create the nuttx-xx.yy.tar.gz tarballs for |
| release. It is handy because it also does the kind of clean up |
| that you need to do to make a clean code release. |
| It can also PGP sign the final tarballs and create their SHA512 hash. |
| Any VCS files or directories are excluded from the final tarballs.</p> |
| <p>Help:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ ./tools/zipme.sh -h |
| USAGE="USAGE: ./tools/zipme.sh [-d|h|v|s] [-b <build]> [-e <exclude>] [-k <key-id>] [<major.minor.patch>]" |
| </pre></div> |
| </div> |
| <p>Examples:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>./tools/zipme.sh -s 9.0.0 |
| Create version 9.0.0 tarballs and sign them. |
| ./tools/zipme.sh -s -k XXXXXX 9.0.0 |
| Same as above but use the key-id XXXXXX to sign the tarballs |
| ./tools/zipme.sh -e "*.swp tmp" 9.0.0 |
| Create the tarballs but exclude any .swp file and the "tmp" directory. |
| </pre></div> |
| </div> |
| </section> |
| </section> |
| |
| |
| </div> |
| </div> |
| <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> |
| <a href="../syscall.html" class="btn btn-neutral float-left" title="Syscall Layer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> |
| <a href="../arch/index.html" class="btn btn-neutral float-right" title="Architecture-Specific Code" 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> |