| <!-- |
| 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>Installing — 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/tabs.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/tabs.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="Compiling with Make" href="compiling_make.html" /> |
| <link rel="prev" title="Getting Started" href="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 current"><a class="reference internal" href="index.html">Getting Started</a><ul class="current"> |
| <li class="toctree-l2 current"><a class="current reference internal" href="#">Installing</a><ul> |
| <li class="toctree-l3"><a class="reference internal" href="#prerequisites">Prerequisites</a><ul> |
| <li class="toctree-l4"><a class="reference internal" href="#kconfig-frontend">KConfig frontend</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l3"><a class="reference internal" href="#toolchain">Toolchain</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#download-nuttx">Download NuttX</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l2"><a class="reference internal" href="compiling_make.html">Compiling with Make</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="compiling_cmake.html">Compiling with CMake</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="running.html">Running</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="configuring.html">Configuring</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="debugging.html">Debugging</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="organization.html">Directory Structure</a></li> |
| </ul> |
| </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"><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> |
| <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">Getting Started</a></li> |
| <li class="breadcrumb-item active">Installing</li> |
| <li class="wy-breadcrumbs-aside"> |
| <a href="../_sources/quickstart/install.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="installing"> |
| <span id="install"></span><h1>Installing<a class="headerlink" href="#installing" title="Permalink to this heading"></a></h1> |
| <p>The first step to get started with NuttX is to install a series of required tools, |
| a toolchain for the architecture you will be working with and, finally, download |
| NuttX source code itself.</p> |
| <section id="prerequisites"> |
| <h2>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this heading"></a></h2> |
| <p>First, install the following set of system dependencies according to your Operating System:</p> |
| <div class="sphinx-tabs docutils container"> |
| <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-0-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-0-0-0" name="0-0" role="tab" tabindex="0">Linux (debian based)</button><button aria-controls="panel-0-0-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-0-0-1" name="0-1" role="tab" tabindex="-1">Linux (Fedora / RPM based)</button><button aria-controls="panel-0-0-2" aria-selected="false" class="sphinx-tabs-tab" id="tab-0-0-2" name="0-2" role="tab" tabindex="-1">macOS</button><button aria-controls="panel-0-0-3" aria-selected="false" class="sphinx-tabs-tab" id="tab-0-0-3" name="0-3" role="tab" tabindex="-1">Windows / WSL</button><button aria-controls="panel-0-0-4" aria-selected="false" class="sphinx-tabs-tab" id="tab-0-0-4" name="0-4" role="tab" tabindex="-1">Windows/Cygwin</button></div><div aria-labelledby="tab-0-0-0" class="sphinx-tabs-panel" id="panel-0-0-0" name="0-0" role="tabpanel" tabindex="0"><p>Run the following command to install packages:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span><span class="se">\</span> |
| <span class="gp">$ </span>bison<span class="w"> </span>flex<span class="w"> </span>gettext<span class="w"> </span>texinfo<span class="w"> </span>libncurses5-dev<span class="w"> </span>libncursesw5-dev<span class="w"> </span>xxd<span class="w"> </span><span class="se">\</span> |
| <span class="gp">$ </span>git<span class="w"> </span>gperf<span class="w"> </span>automake<span class="w"> </span>libtool<span class="w"> </span>pkg-config<span class="w"> </span>build-essential<span class="w"> </span>gperf<span class="w"> </span>genromfs<span class="w"> </span><span class="se">\</span> |
| <span class="gp">$ </span>libgmp-dev<span class="w"> </span>libmpc-dev<span class="w"> </span>libmpfr-dev<span class="w"> </span>libisl-dev<span class="w"> </span>binutils-dev<span class="w"> </span>libelf-dev<span class="w"> </span><span class="se">\</span> |
| <span class="gp">$ </span>libexpat1-dev<span class="w"> </span>gcc-multilib<span class="w"> </span>g++-multilib<span class="w"> </span>picocom<span class="w"> </span>u-boot-tools<span class="w"> </span>util-linux |
| </pre></div> |
| </div> |
| </div><div aria-labelledby="tab-0-0-1" class="sphinx-tabs-panel" hidden="true" id="panel-0-0-1" name="0-1" role="tabpanel" tabindex="0"><p>Run the following command to install packages:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>dnf<span class="w"> </span>install<span class="w"> </span><span class="se">\</span> |
| <span class="gp">$ </span>bison<span class="w"> </span>flex<span class="w"> </span>gettext<span class="w"> </span>texinfo<span class="w"> </span>ncurses-devel<span class="w"> </span>ncurses<span class="w"> </span>ncurses-compat-libs<span class="w"> </span><span class="se">\</span> |
| <span class="gp">$ </span>git<span class="w"> </span>gperf<span class="w"> </span>automake<span class="w"> </span>libtool<span class="w"> </span>pkgconfig<span class="w"> </span>@development-tools<span class="w"> </span>gperf<span class="w"> </span>genromfs<span class="w"> </span><span class="se">\</span> |
| <span class="gp">$ </span>gmp-devel<span class="w"> </span>mpfr-devel<span class="w"> </span>libmpc-devel<span class="w"> </span>isl-devel<span class="w"> </span>binutils-devel<span class="w"> </span>elfutils-libelf-devel<span class="w"> </span><span class="se">\</span> |
| <span class="gp">$ </span>expat-devel<span class="w"> </span>gcc-c++<span class="w"> </span>g++<span class="w"> </span>picocom<span class="w"> </span>uboot-tools<span class="w"> </span>util-linux |
| </pre></div> |
| </div> |
| </div><div aria-labelledby="tab-0-0-2" class="sphinx-tabs-panel" hidden="true" id="panel-0-0-2" name="0-2" role="tabpanel" tabindex="0"><p>Run the following command to install packages:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>brew<span class="w"> </span>tap<span class="w"> </span>discoteq/discoteq |
| <span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>flock |
| <span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>x86_64-elf-gcc<span class="w"> </span><span class="c1"># Used by simulator</span> |
| <span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>u-boot-tools<span class="w"> </span><span class="c1"># Some platform integrate with u-boot</span> |
| </pre></div> |
| </div> |
| </div><div aria-labelledby="tab-0-0-3" class="sphinx-tabs-panel" hidden="true" id="panel-0-0-3" name="0-3" role="tabpanel" tabindex="0"><p>If you are are building Apache NuttX on Windows and using WSL follow |
| that installation guide for Linux. This has been verified against the |
| Ubuntu 18.04 version.</p> |
| <p>There may be complications interacting with |
| programming tools over USB. Recently support for USBIP was added to WSL 2 |
| which has been used with the STM32 platform, but it is not trivial to configure: |
| <a class="reference external" href="https://learn.microsoft.com/en-us/windows/wsl/connect-usb">https://learn.microsoft.com/en-us/windows/wsl/connect-usb</a></p> |
| </div><div aria-labelledby="tab-0-0-4" class="sphinx-tabs-panel" hidden="true" id="panel-0-0-4" name="0-4" role="tabpanel" tabindex="0"><p>Download and install <a class="reference external" href="https://www.cygwin.com/">Cygwin</a> using the minimal |
| installation in addition to these packages:</p> |
| <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>make bison libmpc-devel |
| gcc-core byacc automake-1.15 |
| gcc-g++ gperf libncurses-devel |
| flex gdb libmpfr-devel |
| git unzip zlib-devel |
| </pre></div> |
| </div> |
| </div></div> |
| <section id="kconfig-frontend"> |
| <h3>KConfig frontend<a class="headerlink" href="#kconfig-frontend" title="Permalink to this heading"></a></h3> |
| <p>NuttX configuration system uses <a class="reference external" href="https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt">KConfig</a> |
| which is exposed via a series of interactive menu-based <em>frontends</em>, part of the |
| <code class="docutils literal notranslate"><span class="pre">kconfig-frontends</span></code> package. Depending on your OS you may use a precompiled |
| package or you will have to build it from source, which is available in the |
| <a class="reference external" href="https://bitbucket.org/nuttx/tools/src/master/kconfig-frontends/">NuttX tools repository</a>:</p> |
| <div class="sphinx-tabs docutils container"> |
| <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-1-VWJ1bnR1IDIwLjA0IExUUyBhbmQgbGF0ZXI=" aria-selected="true" class="sphinx-tabs-tab code-tab group-tab" id="tab-1-VWJ1bnR1IDIwLjA0IExUUyBhbmQgbGF0ZXI=" name="VWJ1bnR1IDIwLjA0IExUUyBhbmQgbGF0ZXI=" role="tab" tabindex="0">Ubuntu 20.04 LTS and later</button><button aria-controls="panel-1-VWJ1bnR1IDE4LjA0IExUUyBhbmQgZWFybGllcg==" aria-selected="false" class="sphinx-tabs-tab code-tab group-tab" id="tab-1-VWJ1bnR1IDE4LjA0IExUUyBhbmQgZWFybGllcg==" name="VWJ1bnR1IDE4LjA0IExUUyBhbmQgZWFybGllcg==" role="tab" tabindex="-1">Ubuntu 18.04 LTS and earlier</button><button aria-controls="panel-1-RmVkb3Jh" aria-selected="false" class="sphinx-tabs-tab code-tab group-tab" id="tab-1-RmVkb3Jh" name="RmVkb3Jh" role="tab" tabindex="-1">Fedora</button><button aria-controls="panel-1-bWFjT1M=" aria-selected="false" class="sphinx-tabs-tab code-tab group-tab" id="tab-1-bWFjT1M=" name="bWFjT1M=" role="tab" tabindex="-1">macOS</button></div><div aria-labelledby="tab-1-VWJ1bnR1IDIwLjA0IExUUyBhbmQgbGF0ZXI=" class="sphinx-tabs-panel code-tab group-tab" id="panel-1-VWJ1bnR1IDIwLjA0IExUUyBhbmQgbGF0ZXI=" name="VWJ1bnR1IDIwLjA0IExUUyBhbmQgbGF0ZXI=" role="tabpanel" tabindex="0"><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>kconfig-frontends |
| </pre></div> |
| </div> |
| </div><div aria-labelledby="tab-1-VWJ1bnR1IDE4LjA0IExUUyBhbmQgZWFybGllcg==" class="sphinx-tabs-panel code-tab group-tab" hidden="true" id="panel-1-VWJ1bnR1IDE4LjA0IExUUyBhbmQgZWFybGllcg==" name="VWJ1bnR1IDE4LjA0IExUUyBhbmQgZWFybGllcg==" role="tabpanel" tabindex="0"><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>git<span class="w"> </span>clone<span class="w"> </span>https://bitbucket.org/nuttx/tools.git |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>tools/kconfig-frontends |
| <span class="gp">$ </span>./configure<span class="w"> </span>--enable-mconf<span class="w"> </span>--disable-nconf<span class="w"> </span>--disable-gconf<span class="w"> </span>--disable-qconf |
| <span class="gp">$ </span>make |
| <span class="gp">$ </span>make<span class="w"> </span>install |
| </pre></div> |
| </div> |
| </div><div aria-labelledby="tab-1-RmVkb3Jh" class="sphinx-tabs-panel code-tab group-tab" hidden="true" id="panel-1-RmVkb3Jh" name="RmVkb3Jh" role="tabpanel" tabindex="0"><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>git<span class="w"> </span>clone<span class="w"> </span>https://bitbucket.org/nuttx/tools.git |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>tools/kconfig-frontends |
| <span class="gp">$ </span>./configure<span class="w"> </span>--enable-mconf<span class="w"> </span>--disable-nconf<span class="w"> </span>--disable-gconf<span class="w"> </span>--disable-qconf |
| <span class="gp">$ </span>aclocal |
| <span class="gp">$ </span>automake |
| <span class="gp">$ </span>make |
| <span class="gp">$ </span>sudo<span class="w"> </span>make<span class="w"> </span>install |
| </pre></div> |
| </div> |
| </div><div aria-labelledby="tab-1-bWFjT1M=" class="sphinx-tabs-panel code-tab group-tab" hidden="true" id="panel-1-bWFjT1M=" name="bWFjT1M=" role="tabpanel" tabindex="0"><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>git<span class="w"> </span>clone<span class="w"> </span>https://bitbucket.org/nuttx/tools.git |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>tools/kconfig-frontends |
| <span class="gp">$ </span>patch<span class="w"> </span><<span class="w"> </span>../kconfig-macos.diff<span class="w"> </span>-p<span class="w"> </span><span class="m">1</span> |
| <span class="gp">$ </span>./configure<span class="w"> </span>--enable-mconf<span class="w"> </span>--disable-shared<span class="w"> </span>--enable-static<span class="w"> </span>--disable-gconf<span class="w"> </span>--disable-qconf<span class="w"> </span>--disable-nconf |
| <span class="gp">$ </span>make |
| <span class="gp">$ </span>sudo<span class="w"> </span>make<span class="w"> </span>install |
| </pre></div> |
| </div> |
| </div></div> |
| <p>NuttX also supports <a class="reference external" href="https://github.com/ulfalizer/Kconfiglib">kconfiglib</a> by |
| default, which is a Kconfig tool implemented in Python 2/3. Compared with |
| <code class="docutils literal notranslate"><span class="pre">kconfig-frontends</span></code>, kconfiglib provides NuttX with the possibility of |
| multi-platform support(configure NuttX in Windows native/Visual Studio), and also |
| <code class="docutils literal notranslate"><span class="pre">kconfiglib</span></code> has a stronger Kconfig syntax check, this will help developers to avoid |
| some Kconfig syntax errors. Install kconfiglib via following command:</p> |
| <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>kconfiglib |
| </pre></div> |
| </div> |
| <p>If you are a working on Windows, which also need the support of windows-curses:</p> |
| <div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>windows-curses |
| </pre></div> |
| </div> |
| </section> |
| </section> |
| <section id="toolchain"> |
| <h2>Toolchain<a class="headerlink" href="#toolchain" title="Permalink to this heading"></a></h2> |
| <p>To build Apache NuttX you need the appropriate toolchain |
| according to your target platform. Some Operating Systems |
| such as Linux distribute toolchains for various architectures. |
| This is usually an easy choice however you should be aware |
| that in some cases the version offered by your OS may have |
| problems and it may be better to use a widely used build from |
| another source.</p> |
| <p>The following example shows how to install a toolchain for |
| ARM architecture:</p> |
| <div class="sphinx-tabs docutils container"> |
| <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-2-VWJ1bnR1IChkZWIp" aria-selected="true" class="sphinx-tabs-tab code-tab group-tab" id="tab-2-VWJ1bnR1IChkZWIp" name="VWJ1bnR1IChkZWIp" role="tab" tabindex="0">Ubuntu (deb)</button><button aria-controls="panel-2-2-0" aria-selected="false" class="sphinx-tabs-tab" id="tab-2-2-0" name="2-0" role="tab" tabindex="-1">macOS</button><button aria-controls="panel-2-2-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-2-2-1" name="2-1" role="tab" tabindex="-1">From arm.com</button></div><div aria-labelledby="tab-2-VWJ1bnR1IChkZWIp" class="sphinx-tabs-panel code-tab group-tab" id="panel-2-VWJ1bnR1IChkZWIp" name="VWJ1bnR1IChkZWIp" role="tabpanel" tabindex="0"><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>gcc-arm-none-eabi<span class="w"> </span>binutils-arm-none-eabi |
| </pre></div> |
| </div> |
| </div><div aria-labelledby="tab-2-2-0" class="sphinx-tabs-panel" hidden="true" id="panel-2-2-0" name="2-0" role="tabpanel" tabindex="0"><p>For 32 bit ARM targets, such as STM32:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>--cask<span class="w"> </span>gcc-arm-embedded |
| </pre></div> |
| </div> |
| <p>For 64 bit ARM targets, such as Allwinner A64:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>--cask<span class="w"> </span>gcc-aarch64-embedded |
| </pre></div> |
| </div> |
| </div><div aria-labelledby="tab-2-2-1" class="sphinx-tabs-panel" hidden="true" id="panel-2-2-1" name="2-1" role="tabpanel" tabindex="0"><p>First, create a directory to hold the toolchain:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>usermod<span class="w"> </span>-a<span class="w"> </span>-G<span class="w"> </span>users<span class="w"> </span><span class="nv">$USER</span> |
| <span class="gp">$ </span><span class="c1"># get a login shell that knows we're in this group:</span> |
| <span class="gp">$ </span>su<span class="w"> </span>-<span class="w"> </span><span class="nv">$USER</span> |
| <span class="gp">$ </span>sudo<span class="w"> </span>mkdir<span class="w"> </span>/opt/gcc |
| <span class="gp">$ </span>sudo<span class="w"> </span>chgrp<span class="w"> </span>-R<span class="w"> </span>users<span class="w"> </span>/opt/gcc |
| <span class="gp">$ </span>sudo<span class="w"> </span>chmod<span class="w"> </span>-R<span class="w"> </span>u+rw<span class="w"> </span>/opt/gcc |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>/opt/gcc |
| </pre></div> |
| </div> |
| <p>Download and extract toolchain:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nv">HOST_PLATFORM</span><span class="o">=</span>x86_64-linux<span class="w"> </span><span class="c1"># use 'aarch64-linux' for ARM64 Linux, or 'mac' for Intel macOS</span> |
| <span class="gp">$ </span><span class="c1"># For Windows there is a zip instead (gcc-arm-none-eabi-10.3-2021.10-win32.zip)</span> |
| <span class="gp">$ </span>curl<span class="w"> </span>-L<span class="w"> </span>-O<span class="w"> </span>https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-<span class="si">${</span><span class="nv">HOST_PLATFORM</span><span class="si">}</span>.tar.bz2 |
| <span class="gp">$ </span>tar<span class="w"> </span>xf<span class="w"> </span>gcc-arm-none-eabi-10.3-2021.10-<span class="si">${</span><span class="nv">HOST_PLATFORM</span><span class="si">}</span>.tar.bz2 |
| </pre></div> |
| </div> |
| <p>Add the toolchain to your <cite>PATH</cite>:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">echo</span><span class="w"> </span><span class="s2">"export PATH=/opt/gcc/gcc-arm-none-eabi-10.3-2021.10/bin:</span><span class="nv">$PATH</span><span class="s2">"</span><span class="w"> </span>>><span class="w"> </span>~/.bashrc |
| </pre></div> |
| </div> |
| <p>You can edit your shell’s rc files if you don’t use bash.</p> |
| </div></div> |
| <div class="admonition tip"> |
| <p class="admonition-title">Tip</p> |
| <p>There are hints on how to get the latest tool chains for most supported |
| architectures in the Apache NuttX CI helper |
| <a class="reference external" href="https://github.com/apache/nuttx/tree/master/tools/ci/cibuild.sh">script</a> |
| and Docker <a class="reference external" href="https://github.com/apache/nuttx/tree/master/tools/ci/docker/linux/Dockerfile">container</a></p> |
| </div> |
| <div class="admonition-todo admonition" id="id1"> |
| <p class="admonition-title">Todo</p> |
| <p>Required toolchain should be part of each arch documentation (see <a class="reference external" href="https://github.com/apache/nuttx/issues/2409">relevant issue</a>).</p> |
| </div> |
| </section> |
| <section id="download-nuttx"> |
| <h2>Download NuttX<a class="headerlink" href="#download-nuttx" title="Permalink to this heading"></a></h2> |
| <p>Apache NuttX is actively developed on GitHub. There are two main repositories, |
| <a class="reference external" href="https://github.com/apache/nuttx">nuttx</a> and <a class="reference external" href="https://github.com/apache/nuttx-apps">apps</a>, |
| where the latter is technically optional (but recommended for complete set of |
| features). If you intend to contribute changes, you need the absolute latest |
| version or you simply prefer to work using git, you should clone these |
| repositories (recommended). Otherwise you can choose to download any |
| <a class="reference external" href="https://nuttx.apache.org/download/">stable release</a> archive.</p> |
| <div class="sphinx-tabs docutils container"> |
| <div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-3-3-0" aria-selected="true" class="sphinx-tabs-tab" id="tab-3-3-0" name="3-0" role="tab" tabindex="0">Clone git repositories</button><button aria-controls="panel-3-3-1" aria-selected="false" class="sphinx-tabs-tab" id="tab-3-3-1" name="3-1" role="tab" tabindex="-1">Download stable release</button></div><div aria-labelledby="tab-3-3-0" class="sphinx-tabs-panel" id="panel-3-3-0" name="3-0" role="tabpanel" tabindex="0"><div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>mkdir<span class="w"> </span>nuttxspace |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>nuttxspace |
| <span class="gp">$ </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/apache/nuttx.git<span class="w"> </span>nuttx |
| <span class="gp">$ </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/apache/nuttx-apps<span class="w"> </span>apps |
| </pre></div> |
| </div> |
| <p>The development source code is also available as a compressed archive, should you need it:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>mkdir<span class="w"> </span>nuttxspace |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>nuttxspace |
| <span class="gp">$ </span>curl<span class="w"> </span>-L<span class="w"> </span>https://github.com/apache/nuttx/tarball/master<span class="w"> </span>-o<span class="w"> </span>nuttx.tar.gz |
| <span class="gp">$ </span>curl<span class="w"> </span>-L<span class="w"> </span>https://github.com/apache/nuttx-apps/tarball/master<span class="w"> </span>-o<span class="w"> </span>apps.tar.gz |
| <span class="gp">$ </span>tar<span class="w"> </span>zxf<span class="w"> </span>nuttx.tar.gz<span class="w"> </span>--one-top-level<span class="o">=</span>nuttx<span class="w"> </span>--strip-components<span class="w"> </span><span class="m">1</span> |
| <span class="gp">$ </span>tar<span class="w"> </span>zxf<span class="w"> </span>apps.tar.gz<span class="w"> </span>--one-top-level<span class="o">=</span>apps<span class="w"> </span>--strip-components<span class="w"> </span><span class="m">1</span> |
| </pre></div> |
| </div> |
| <p>There are also <code class="docutils literal notranslate"><span class="pre">.zip</span></code> archives available (useful for Windows users): just replace <code class="docutils literal notranslate"><span class="pre">tarball</span></code> with |
| <code class="docutils literal notranslate"><span class="pre">zipball</span></code>.</p> |
| </div><div aria-labelledby="tab-3-3-1" class="sphinx-tabs-panel" hidden="true" id="panel-3-3-1" name="3-1" role="tabpanel" tabindex="0"><p>Go to <a class="reference external" href="https://nuttx.apache.org/download/">releases</a> and choose a version to download. The following |
| example uses version 12.2.1:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>mkdir<span class="w"> </span>nuttxspace |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>nuttxspace |
| <span class="gp">$ </span>curl<span class="w"> </span>-L<span class="w"> </span>https://www.apache.org/dyn/closer.lua/nuttx/12.2.1/apache-nuttx-12.2.1.tar.gz?action<span class="o">=</span>download<span class="w"> </span>-o<span class="w"> </span>nuttx.tar.gz |
| <span class="gp">$ </span>curl<span class="w"> </span>-L<span class="w"> </span>https://www.apache.org/dyn/closer.lua/nuttx/12.2.1/apache-nuttx-apps-12.2.1.tar.gz?action<span class="o">=</span>download<span class="w"> </span>-o<span class="w"> </span>apps.tar.gz |
| <span class="gp">$ </span>tar<span class="w"> </span>zxf<span class="w"> </span>nuttx.tar.gz |
| <span class="gp">$ </span>tar<span class="w"> </span>zxf<span class="w"> </span>apps.tar.gz |
| </pre></div> |
| </div> |
| </div></div> |
| </section> |
| </section> |
| |
| |
| </div> |
| </div> |
| <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> |
| <a href="index.html" class="btn btn-neutral float-left" title="Getting Started" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> |
| <a href="compiling_make.html" class="btn btn-neutral float-right" title="Compiling with Make" 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> |