blob: 05f7a8bac0cc1e113539608c3c870d46f0f43f43 [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="viewport" content="width=device-width, initial-scale=1.0" />
<title>FAQ &mdash; NuttX latest documentation</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.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 type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script type="text/javascript" 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="Guides" href="../guides/index.html" />
<link rel="prev" title="I/O Buffer Management" href="../reference/os/iob.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
<img src="../_static/NuttX.png" class="logo" alt="Logo"/>
</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>
</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" />
<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="main navigation">
<p class="caption"><span class="caption-text">Table of Contents</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../index.html">Home</a></li>
<li class="toctree-l1"><a class="reference internal" href="../introduction/index.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart/index.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../introduction/inviolables.html">The Inviolable Principles of NuttX</a></li>
<li class="toctree-l1"><a class="reference internal" href="../platforms/index.html">Supported Platforms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../components/index.html">OS Components</a></li>
<li class="toctree-l1"><a class="reference internal" href="../applications/index.html">Applications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/index.html">API Reference</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">FAQ</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#nsh-tricks">NSH Tricks</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#how-to-increase-the-command-line-length">How to increase the command line length?</a></li>
<li class="toctree-l3"><a class="reference internal" href="#how-do-i-enable-editing-support-on-the-command-line">How do I enable editing support on the command line?</a></li>
<li class="toctree-l3"><a class="reference internal" href="#how-to-enable-command-line-history">How to enable command line history?</a></li>
<li class="toctree-l3"><a class="reference internal" href="#how-to-enable-autocomplete-on-the-command-line">How to enable autocomplete on the command line?</a></li>
<li class="toctree-l3"><a class="reference internal" href="#how-to-interrupt-an-nsh-application-using-ctrl-c">How to interrupt an NSH Application using Ctrl^C ?</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#board-initialization">Board Initialization</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#how-to-start-directly-my-application-instead-starting-nsh">How to start directly my application instead starting NSH?</a></li>
<li class="toctree-l3"><a class="reference internal" href="#why-after-putting-my-application-on-entrypoint-it-stops-to-work">Why after putting my application on ENTRYPOINT it stops to work?</a></li>
<li class="toctree-l3"><a class="reference internal" href="#why-isn-t-dev-ttysx-created-when-using-usb-console-even-when-uart-is-enabled">Why isn’t /dev/ttySx created when using USB Console even when UART is enabled?</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#network">Network</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#how-to-detect-ethernet-cable-connection-disconnection">How to detect Ethernet cable connection/disconnection?</a></li>
</ul>
</li>
</ul>
</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="top navigation">
<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="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
<li>FAQ</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/faq/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">
<div class="admonition-todo admonition" id="id1">
<p class="admonition-title">Todo</p>
<p>Create new subsections as needed.</p>
</div>
<div class="section" id="faq">
<h1>FAQ<a class="headerlink" href="#faq" title="Permalink to this headline"></a></h1>
<div class="section" id="nsh-tricks">
<h2>NSH Tricks<a class="headerlink" href="#nsh-tricks" title="Permalink to this headline"></a></h2>
<div class="section" id="how-to-increase-the-command-line-length">
<h3>How to increase the command line length?<a class="headerlink" href="#how-to-increase-the-command-line-length" title="Permalink to this headline"></a></h3>
<p>You can increase the Max command line length from 64 to other value,
this way:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Application Configuration ---&gt;
NSH Library ---&gt;
Command Line Configuration ---&gt;
(64) Max command line length
</pre></div>
</div>
</div>
<div class="section" id="how-do-i-enable-editing-support-on-the-command-line">
<h3>How do I enable editing support on the command line?<a class="headerlink" href="#how-do-i-enable-editing-support-on-the-command-line" title="Permalink to this headline"></a></h3>
<p>You need to change Command Line Editor from “Minimal readline” to
“Command Line Editor”, this way:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Application Configuration ---&gt;
NSH Library ---&gt;
Command Line Configuration ---&gt;
Command Line Editor (Command Line Editor) ---&gt;
</pre></div>
</div>
</div>
<div class="section" id="how-to-enable-command-line-history">
<h3>How to enable command line history?<a class="headerlink" href="#how-to-enable-command-line-history" title="Permalink to this headline"></a></h3>
<p>You need to enable these options in the menuconfig:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Application Configuration ---&gt;
System Libraries and NSH Add-Ons ---&gt;
-*- readline() Support ---&gt;
[*] Command line history
(80) Command line history length
(16) Command line history records
</pre></div>
</div>
<p>Note: If you are using the “Command Line Editor” instead of the “readline”
then you need to use this other option:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Application Configuration ---&gt;
System Libraries and NSH Add-Ons ---&gt;
-*- EMACS-like Command Line Editor ---&gt;
[*] Command line history
(80) Command line history length
(16) Command line history records
</pre></div>
</div>
</div>
<div class="section" id="how-to-enable-autocomplete-on-the-command-line">
<h3>How to enable autocomplete on the command line?<a class="headerlink" href="#how-to-enable-autocomplete-on-the-command-line" title="Permalink to this headline"></a></h3>
<p>You need to enable these options in the menuconfig:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Application Configuration ---&gt;
System Libraries and NSH Add-Ons ---&gt;
-*- readline() Support ---&gt;
[*] Tab completion
(64) Maximum built-in matches
(64) Maximum external command matches
</pre></div>
</div>
<p>Note: autocomplete is not enabled when “Command Line Editor” instead of the
“readline”.</p>
</div>
<div class="section" id="how-to-interrupt-an-nsh-application-using-ctrl-c">
<h3>How to interrupt an NSH Application using Ctrl^C ?<a class="headerlink" href="#how-to-interrupt-an-nsh-application-using-ctrl-c" title="Permalink to this headline"></a></h3>
<p>You need to enable these options in the menuconfig:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>RTOS Features ---&gt;
Signal Configuration ---&gt;
[*] Default signal actions ---&gt;
[*] SIGINT and SIGKILL
Device Drivers ---&gt;
Serial Driver Support ---&gt;
[*] Serial TERMIOS support
[*] Support SIGINT
(0x03) Serial parse SIGINT characters
</pre></div>
</div>
</div>
</div>
<div class="section" id="board-initialization">
<h2>Board Initialization<a class="headerlink" href="#board-initialization" title="Permalink to this headline"></a></h2>
<div class="section" id="how-to-start-directly-my-application-instead-starting-nsh">
<h3>How to start directly my application instead starting NSH?<a class="headerlink" href="#how-to-start-directly-my-application-instead-starting-nsh" title="Permalink to this headline"></a></h3>
<p>You can start you application directly instead of starting the default
NSH terminal. Lets support your application is called “hello”, then you
will modify the ENTRYPOINT to call “hello_main” instead of “nsh_main”:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>RTOS Features ---&gt;
Tasks and Scheduling ---&gt;
(hello_main) Application entry point
</pre></div>
</div>
</div>
<div class="section" id="why-after-putting-my-application-on-entrypoint-it-stops-to-work">
<h3>Why after putting my application on ENTRYPOINT it stops to work?<a class="headerlink" href="#why-after-putting-my-application-on-entrypoint-it-stops-to-work" title="Permalink to this headline"></a></h3>
<p>When you replace the ENTRYPOINT from “nsh_main” to your application some
initialization flow are changed, for instance the NSH_ARCHINIT is not
executed anymore and so some drivers initialization that are called from
it also stops to work.</p>
<p>You can fix it enabling the Board Late Initialization that will replace the
NSH_ARCHINIT to call those drivers initialization. Just enable it:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>RTOS Features ---&gt;
RTOS hooks ---&gt;
[*] Custom board late initialization
</pre></div>
</div>
<p>Also you need to disable the architecture-specific initialization:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Application Configuration ---&gt;
NSH Library ---&gt;
[ ] Have architecture-specific initialization
</pre></div>
</div>
</div>
<div class="section" id="why-isn-t-dev-ttysx-created-when-using-usb-console-even-when-uart-is-enabled">
<h3>Why isn’t /dev/ttySx created when using USB Console even when UART is enabled?<a class="headerlink" href="#why-isn-t-dev-ttysx-created-when-using-usb-console-even-when-uart-is-enabled" title="Permalink to this headline"></a></h3>
<p>If you don’t use serial console then /dev/ttyS0 will not be created,
even if you enable the UART peripheral at “System Type”.</p>
<p>You can fix it enabling the Serial Upper-Half Driver:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Device Drivers ---&gt;
Serial Driver Support ---&gt;
[*] Enable standard &quot;upper-half&quot; serial driver
</pre></div>
</div>
</div>
</div>
<div class="section" id="network">
<h2>Network<a class="headerlink" href="#network" title="Permalink to this headline"></a></h2>
<div class="section" id="how-to-detect-ethernet-cable-connection-disconnection">
<h3>How to detect Ethernet cable connection/disconnection?<a class="headerlink" href="#how-to-detect-ethernet-cable-connection-disconnection" title="Permalink to this headline"></a></h3>
<p>NuttX supports Ethernet connection/disconnection events from Ethernet PHY
using signals (see <code class="docutils literal notranslate"><span class="pre">nuttx/drivers/net/phy_notify.c</span></code>).
The network monitor thread at apps/netutils/netinit (see
<code class="docutils literal notranslate"><span class="pre">CONFIG_NETINIT_MONITOR</span></code>) will handle taking the network down if the cable
is unplugged and bringing it back up when the cable is restored.
It is important to note that your Ethernet controller driver of your
MCU needs to support CONFIG_ARCH_PHY_INTERRUPT (and implement
<code class="docutils literal notranslate"><span class="pre">arch_phy_irq()</span></code>).</p>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../guides/index.html" class="btn btn-neutral float-right" title="Guides" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="../reference/os/iob.html" class="btn btn-neutral float-left" title="I/O Buffer Management" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; Copyright 2020, The Apache Software Foundation.
</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>