blob: b3f886a4f62bb20b09e2f234767f3f3520888d4c [file] [log] [blame]
<!--
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>Development Environments &mdash; NuttX latest documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../_static/custom.css" />
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<script src="../_static/jquery.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/clipboard.min.js"></script>
<script src="../_static/copybutton.js"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Licensing" href="licensing.html" />
<link rel="prev" title="About Apache NuttX" href="about.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 current"><a class="reference internal" href="index.html">Introduction</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="about.html">About Apache NuttX</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Development Environments</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#linux-gnu-make-gcc-binutils-for-linux">Linux + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + GCC/binutils for Linux</a></li>
<li class="toctree-l3"><a class="reference internal" href="#linux-gnu-make-sdcc-for-linux">Linux + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + SDCC for Linux</a></li>
<li class="toctree-l3"><a class="reference internal" href="#windows-with-cygwin-gnu-make-gcc-binutils-custom-built-under-cygwin">Windows with Cygwin + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + GCC/binutils (custom built under Cygwin)</a></li>
<li class="toctree-l3"><a class="reference internal" href="#windows-with-cygwin-gnu-make-sdcc-custom-built-under-cygwin">Windows with Cygwin + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + SDCC (custom built under Cygwin)</a></li>
<li class="toctree-l3"><a class="reference internal" href="#windows-with-cygwin-gnu-make-windows-native-toolchain">Windows with Cygwin + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + Windows Native Toolchain</a></li>
<li class="toctree-l3"><a class="reference internal" href="#windows-native-cmd-exe-gnuwin32-including-gnu-make-mingw-host-gcc-compiler-windows-native-toolchain">Windows Native (<code class="docutils literal notranslate"><span class="pre">CMD.exe</span></code>) + GNUWin32 (including GNU <code class="docutils literal notranslate"><span class="pre">make</span></code>) + MinGW Host GCC compiler + Windows Native Toolchain</a></li>
<li class="toctree-l3"><a class="reference internal" href="#wine-gnu-make-windows-native-toolchain">Wine + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + Windows Native Toolchain</a></li>
<li class="toctree-l3"><a class="reference internal" href="#other-environments">Other Environments</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="licensing.html">Licensing</a></li>
<li class="toctree-l2"><a class="reference internal" href="trademarks.html">Trademarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="resources.html">Resources</a></li>
</ul>
</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="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">Introduction</a></li>
<li class="breadcrumb-item active">Development Environments</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/introduction/development_environments.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">
<div class="admonition-todo admonition" id="id1">
<p class="admonition-title">Todo</p>
<p>revise and update links</p>
</div>
<section id="development-environments">
<h1>Development Environments<a class="headerlink" href="#development-environments" title="Permalink to this heading"></a></h1>
<section id="linux-gnu-make-gcc-binutils-for-linux">
<h2>Linux + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + GCC/binutils for Linux<a class="headerlink" href="#linux-gnu-make-gcc-binutils-for-linux" title="Permalink to this heading"></a></h2>
<p>The is the most natural development environment for NuttX. Any version
of the GCC/binutils toolchain may be used. There is a highly modified
<a class="reference external" href="http://buildroot.uclibc.org/">buildroot</a> available for download from
the <a class="reference external" href="https://bitbucket.org/nuttx/buildroot/downloads/">NuttX
Bitbucket.org</a>
page. This download may be used to build a NuttX-compatible ELF
toolchain under Linux or Cygwin. That toolchain will support ARM, m68k,
m68hc11, m68hc12, and SuperH ports. The buildroot GIT may be accessed in
the NuttX <a class="reference external" href="https://bitbucket.org/nuttx/buildroot">buildroot GIT</a>.</p>
</section>
<section id="linux-gnu-make-sdcc-for-linux">
<h2>Linux + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + SDCC for Linux<a class="headerlink" href="#linux-gnu-make-sdcc-for-linux" title="Permalink to this heading"></a></h2>
<p>Also very usable is the Linux environment using the
<a class="reference external" href="http://sdcc.sourceforge.net/">SDCC</a> compiler. The SDCC compiler
provides support for the 8051/2, z80, hc08, and other microcontrollers.
The SDCC-based logic is less well exercised and you will likely find
some compilation issues if you use parts of NuttX with SDCC that have
not been well-tested.</p>
</section>
<section id="windows-with-cygwin-gnu-make-gcc-binutils-custom-built-under-cygwin">
<h2>Windows with Cygwin + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + GCC/binutils (custom built under Cygwin)<a class="headerlink" href="#windows-with-cygwin-gnu-make-gcc-binutils-custom-built-under-cygwin" title="Permalink to this heading"></a></h2>
<p>This combination works well too. It works just as well as the native
Linux environment except that compilation and build times are a little
longer. The custom NuttX
<a class="reference external" href="https://bitbucket.org/nuttx/buildroot/downloads/">buildroot</a>
referenced above may be build in the Cygwin environment as well.</p>
</section>
<section id="windows-with-cygwin-gnu-make-sdcc-custom-built-under-cygwin">
<h2>Windows with Cygwin + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + SDCC (custom built under Cygwin)<a class="headerlink" href="#windows-with-cygwin-gnu-make-sdcc-custom-built-under-cygwin" title="Permalink to this heading"></a></h2>
<p>I have never tried this combination, but it would probably work just
fine.</p>
</section>
<section id="windows-with-cygwin-gnu-make-windows-native-toolchain">
<h2>Windows with Cygwin + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + Windows Native Toolchain<a class="headerlink" href="#windows-with-cygwin-gnu-make-windows-native-toolchain" title="Permalink to this heading"></a></h2>
<p>This is a tougher environment. In this case, the Windows native
toolchain is unaware of the Cygwin <em>sandbox</em> and, instead, operates in
the native Windows environment. The primary difficulties with this are:</p>
<ul class="simple">
<li><p><strong>Paths</strong>. Full paths for the native toolchain must follow Windows
standards. For example, the path <code class="docutils literal notranslate"><span class="pre">/home/my\</span> <span class="pre">name/nuttx/include</span></code> my
have to be converted to something like
<code class="docutils literal notranslate"><span class="pre">'C:\cygwin\home\my</span> <span class="pre">name\nuttx\include'</span></code> to be usable by the
toolchain.</p></li>
<li><p><strong>Symbolic Links</strong> NuttX depends on symbolic links to install
platform-specific directories in the build system. On Linux, true
symbolic links are used. On Cygwin, emulated symbolic links are used.
Unfortunately, for native Windows applications that operate outside
of the Cygwin <em>sandbox</em>, these symbolic links cannot be used.</p></li>
<li><p><strong>Dependencies</strong> NuttX uses the GCC compiler’s <code class="docutils literal notranslate"><span class="pre">-M</span></code> option to
generate make dependencies. These dependencies are retained in files
called <code class="docutils literal notranslate"><span class="pre">Make.deps</span></code> throughout the system. For compilers other than
GCC, there is no support for making dependencies in this way.</p></li>
</ul>
<p><strong>Supported Windows Native Toolchains</strong>. At present, the following
Windows native toolchains are in use:</p>
<ol class="arabic simple">
<li><p>GCC built for Windows (such as CodeSourcery, Atollic, devkitARM,
etc.),</p></li>
<li><p>SDCC built for Windows,</p></li>
<li><p>the ZiLOG XDS-II toolchain for Z16F, z8Encore, and eZ80Acclaim parts.</p></li>
</ol>
</section>
<section id="windows-native-cmd-exe-gnuwin32-including-gnu-make-mingw-host-gcc-compiler-windows-native-toolchain">
<h2>Windows Native (<code class="docutils literal notranslate"><span class="pre">CMD.exe</span></code>) + GNUWin32 (including GNU <code class="docutils literal notranslate"><span class="pre">make</span></code>) + MinGW Host GCC compiler + Windows Native Toolchain<a class="headerlink" href="#windows-native-cmd-exe-gnuwin32-including-gnu-make-mingw-host-gcc-compiler-windows-native-toolchain" title="Permalink to this heading"></a></h2>
<p>Build support has been added to support building natively in a Windows
console rather than in a POSIX-like environment.</p>
<p>This build:</p>
<ol class="arabic simple">
<li><p>Uses all Windows style paths</p></li>
<li><p>Uses primarily Windows batch commands from cmd.exe, with</p></li>
<li><p>A few extensions from GNUWin32</p></li>
</ol>
<p>This capability first appeared in NuttX-6.24 and should still be
considered a work in progress because: (1) it has not been verfied on
all targets and tools, and (2) still lacks some of the creature-comforts
of the more mature environments. The windows native build logic
initiated if <code class="docutils literal notranslate"><span class="pre">CONFIG_WINDOWS_NATIVE=y</span></code> is defined in the NuttX
configuration file:</p>
<p>At present, this build environment also requires:</p>
<p><strong>Windows Console</strong>. The build must be performed in a Windows console
window. This may be using the standard <code class="docutils literal notranslate"><span class="pre">CMD.exe</span></code> terminal that comes
with Windows. I prefer the ConEmu terminal which can be downloaded from:
<a class="reference external" href="http://code.google.com/p/conemu-maximus5/">http://code.google.com/p/conemu-maximus5/</a></p>
<p><strong>GNUWin32</strong>. The build still relies on some Unix-like commands. I
usethe GNUWin32 tools that can be downloaded from
<a class="reference external" href="http://gnuwin32.sourceforge.net/">http://gnuwin32.sourceforge.net/</a>. See the top-level <code class="docutils literal notranslate"><span class="pre">nuttx/README.txt</span></code>
file for some download, build, and installation notes.</p>
<p><strong>MinGW-GCC</strong>. MinGW-GCC is used to compiler the C tools in the
<code class="docutils literal notranslate"><span class="pre">nuttx/tools</span></code> directory that are needed by the build. MinGW-GCC can be
downloaded from <a class="reference external" href="http://www.mingw.org/">http://www.mingw.org/</a>. If you are using GNUWin32, then
it is recommended that you not install the optional MSYS components as
there may be conflicts.</p>
</section>
<section id="wine-gnu-make-windows-native-toolchain">
<h2>Wine + GNU <code class="docutils literal notranslate"><span class="pre">make</span></code> + Windows Native Toolchain<a class="headerlink" href="#wine-gnu-make-windows-native-toolchain" title="Permalink to this heading"></a></h2>
<p>I’ve never tried this one, but I off the following reported by an ez80
user using the ZiLOG ZDS-II Windows-native toolchain:</p>
<blockquote>
<div><p>“I’ve installed ZDS-II 5.1.1 (IDE for ez80-based boards) on wine
(windows emulator for UNIX) and to my surprise, not many changes were
needed to make GIT snapshot of NuttX buildable… I’ve tried nsh
profile and build process completed successfully. One remark is
necessary: NuttX makefiles for ez80 are referencing <code class="docutils literal notranslate"><span class="pre">cygpath</span></code>
utility. Wine provides similar thing called <code class="docutils literal notranslate"><span class="pre">winepath</span></code> which is
compatible and offers compatible syntax. To use that, <code class="docutils literal notranslate"><span class="pre">winepath</span></code>
(which itself is a shell script) has to be copied as <code class="docutils literal notranslate"><span class="pre">cygpath</span></code>
somewhere in <code class="docutils literal notranslate"><span class="pre">$PATH</span></code>, and edited as in following patch:</p>
<p>“Better solution would be replacing all <code class="docutils literal notranslate"><span class="pre">cygpath</span></code> references in
<code class="docutils literal notranslate"><span class="pre">Makefiles</span></code> with <code class="docutils literal notranslate"><span class="pre">$(CONVPATH)</span></code> (or <code class="docutils literal notranslate"><span class="pre">${CONVPATH}</span></code> in shell
scripts) and setting <code class="docutils literal notranslate"><span class="pre">CONVPATH</span></code> to <code class="docutils literal notranslate"><span class="pre">cygpath</span></code> or <code class="docutils literal notranslate"><span class="pre">winepath</span></code>
regarding to currently used environment.</p>
</div></blockquote>
</section>
<section id="other-environments">
<h2>Other Environments<a class="headerlink" href="#other-environments" title="Permalink to this heading"></a></h2>
<p><strong>Environment Dependencies</strong>. The primary environmental dependency of
NuttX are (1) GNU make, (2) bash scripting, and (3) Linux utilities
(such as cat, sed, etc.). If you have other platforms that support GNU
make or make utilities that are compatible with GNU make, then it is
very likely that NuttX would work in that environment as well (with some
porting effort). If GNU make is not supported, then some significant
modification of the Make system would be required.</p>
<p><strong>MSYS</strong>. I have not used MSYS but what I gather from talking with NuttX
users is that MSYS can be used as an alternative to Cygwin in any of the
above Cygwin environments. This is not surprising since MSYS is based on
an older version of Cygwin (cygwin-1.3). MSYS has been modified,
however, to interoperate in the Windows environment better than Cygwin
and that may be of value to some users.</p>
<p>MSYS, however, cannot be used with the native Windows NuttX build
because it will invoke the MSYS bash shell instead of the <code class="docutils literal notranslate"><span class="pre">CMD.exe</span></code>
shell. Use GNUWin32 in the native Windows build environment.</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="about.html" class="btn btn-neutral float-left" title="About Apache NuttX" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="licensing.html" class="btn btn-neutral float-right" title="Licensing" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2023, The Apache Software Foundation.</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>