NSH Documentation: A justification for 3 ENTERs when using USB serial console.
This commit is contained in:
parent
72ff151343
commit
466fccc494
@ -8,7 +8,7 @@
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
|
||||
<p>Last Updated: June 6, 2017</p>
|
||||
<p>Last Updated: June 13, 2017</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -305,7 +305,7 @@
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdmkfatfs">2.37 Create a FAT Filesystem (mkfatfs)</a>
|
||||
<a href="#cmdmkfatfs">2.37 Create a FAT File System (mkfatfs)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -335,7 +335,7 @@
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#cmdnfsmount">2.42 Mount an NFS file system (nfsmount)</a>
|
||||
<a href="#cmdnfsmount">2.42 Mount an NFS File System (nfsmount)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -619,9 +619,35 @@
|
||||
NuttShell (NSH)
|
||||
nsh>
|
||||
</pre></ul>
|
||||
The greating may also include NuttX versioning information if you are using a versioned copy of NuttX.
|
||||
The greeting may also include NuttX versioning information if you are using a versioned copy of NuttX.
|
||||
<code>nsh></code> is the NSH prompt and indicates that you may enter a command from the console.
|
||||
</p>
|
||||
<p>
|
||||
<a name="usbstartup"><b>USB console startup</b></a>.
|
||||
When using a USB console, the start-up sequence differs a little: In this case, you are required to press <i>ENTER</i> three times. Then NSH prompt will appear as described above.
|
||||
This is required for the following reasons:
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
This assures that the USB connection is stable.
|
||||
The USB connection may be made, broken, and re-established a few times if the USB cable is not yet fully seated.
|
||||
Waiting for <i>ENTER</i> to be pressed three times assures that the connection is stable.
|
||||
</li>
|
||||
<li>
|
||||
The establishment of the connection is two step process: First, the USB serial connection is made with the host PC. Then the application that uses the serial interface is started on the host.
|
||||
When the serial connection is established on the host, the host operating system may send several <i>AT</i> modem commands to the host depending upon how the host serial port is configured.
|
||||
By waiting for <i>ENTER</i> to be pressed three consecutive times, all of these modem commands will go to the bit-bucket and will not be interpreted as NSH command input.
|
||||
</li>
|
||||
<li>
|
||||
Similarly, in the second step when the applications is started, there may be additional <i>AT</i> modem commands sent out the serial port.
|
||||
Most serial terminal programs will do this unless they are specifically configured to suppress the modem command output.
|
||||
Waiting for the <i>ENTER</i> input eliminates the invalid command errors from both (2) and (3).
|
||||
</li>
|
||||
<li>
|
||||
Finally, if NSH did not wait for some positive indication that the serial terminal program is up and running, then the output of the NSH greeting and initial NSH prompt would be lost.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
<a name="cle"><b>Extended Command Line Editing</b></a>.
|
||||
By default, NuttX uses a simple command line editor that allows command entry after the <code>nsh></code> and supports only the <i>backspace</i> key for editing.
|
||||
@ -1726,7 +1752,7 @@ ifconfig [nic_name [<ip-address>|dhcp]] [dr|gw|gateway <dr-address>]
|
||||
<li>
|
||||
<p>
|
||||
With one or no arguments, <code>ifconfig</code> will shows the
|
||||
current configuration of the network and, perhaps, the status of ethernet
|
||||
current configuration of the network and, perhaps, the status of Ethernet
|
||||
device:
|
||||
</p>
|
||||
<ul><pre>
|
||||
@ -1749,7 +1775,7 @@ eth0 HWaddr 00:18:11:80:10:06
|
||||
<li>
|
||||
<p>
|
||||
If both the network interface name and an IP address are supplied as arguments,
|
||||
then <code>ifconfig</code> will set the address of the ethernet device:
|
||||
then <code>ifconfig</code> will set the address of the Ethernet device:
|
||||
</p>
|
||||
<ul><pre>
|
||||
ifconfig nic_name ip_address
|
||||
@ -2190,7 +2216,7 @@ nsh>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="cmdmkfatfs"><h2>2.37 Create a FAT Filesystem (mkfatfs)</h2></a>
|
||||
<a name="cmdmkfatfs"><h2>2.37 Create a FAT File System (mkfatfs)</h2></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2323,7 +2349,7 @@ mount -t <fstype> [-o <options>] <block-device> <code><dir-
|
||||
<code>mount</code> performs a three way association, binding:
|
||||
</p>
|
||||
<ol>
|
||||
<li><b>File system.</b>
|
||||
<li><b>File System.</b>
|
||||
The '-t <code><fstype></code>' option identifies the type of
|
||||
file system that has been formatted on the <code><block-device></code>.
|
||||
As of this writing, <code>vfat</code> is the only supported value for <code><fstype></code>
|
||||
@ -3698,7 +3724,7 @@ set FOOBAR ABC_${FOO}_${BAR}
|
||||
<td valign="top"><b><code>CONFIG_NSH_NESTDEPTH</code></b></td>
|
||||
<td>
|
||||
The maximum number of nested <a href="#conditional"><code>if-then[-else]-fi</code></a> sequences that
|
||||
are permissable. Default: 3
|
||||
are permissible. Default: 3
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -3975,7 +4001,7 @@ set FOOBAR ABC_${FOO}_${BAR}
|
||||
<tr>
|
||||
<td valign="top"><b><code>CONFIG_NSH_NOMAC</code></b></td>
|
||||
<td>
|
||||
Set if your ethernet hardware has no built-in MAC address.
|
||||
Set if your Ethernet hardware has no built-in MAC address.
|
||||
If set, a bogus MAC will be assigned.
|
||||
</td>
|
||||
</tr>
|
||||
@ -4666,7 +4692,7 @@ CONFIG_SCHED_WAITPID=y
|
||||
<p>
|
||||
You replace the sample code at <code>apps/examples/nsh/nsh_main.c</code> with whatever start-up logic that you want.
|
||||
NSH is a library at <code>apps/nshlib</code>.
|
||||
<code>apps.examplex/nsh</code> is just a tiny, example start-up function (<code>CONFIG_USER_ENTRYPOINT</code>()) that that runs immediately and illustrates how to start NSH
|
||||
<code>apps.examples/nsh</code> is just a tiny, example start-up function (<code>CONFIG_USER_ENTRYPOINT</code>()) that that runs immediately and illustrates how to start NSH
|
||||
If you want something else to run immediately then you can write your write your own custom <code>CONFIG_USER_ENTRYPOINT</code>() function and then start other tasks from your custom <code>CONFIG_USER_ENTRYPOINT</code>().
|
||||
</p>
|
||||
<li>
|
||||
@ -4841,7 +4867,7 @@ mount -t vfat /dev/ram1 /tmp
|
||||
</p>
|
||||
<p>
|
||||
To generate a custom <code>rcS</code> file a copy of <code>rcS.template</code> needs to be placed at <code>tools/</code> and changed according to the desired start-up behaviour.
|
||||
Running <code>tools/mkromfsimg.h</code> creates <code>nsh_romfsimg.h</code> which needs to be copied to <code>apps/nhslib</code> OR if <code>CONFIG_NSH_ARCHROMFS</code> is defined to <code>configs/<board>/include</code>.
|
||||
Running <code>tools/mkromfsimg.h</code> creates <code>nsh_romfsimg.h</code> which needs to be copied to <code>apps/nshlib</code> OR if <code>CONFIG_NSH_ARCHROMFS</code> is defined to <code>configs/<board>/include</code>.
|
||||
</p>
|
||||
</ol>
|
||||
|
||||
@ -5343,10 +5369,10 @@ xxd -i romfs_img >nsh_romfsimg.h
|
||||
<li><a href="#cmdmkrd"><code>mkrd</code></a></li>
|
||||
<li><a href="#custinit"><code>mkromfsimg.sh</code></a></li>
|
||||
<li><a href="#cmdmount"><code>mount</code></a></li>
|
||||
<li><a href="#cmdmv"><code>mv</code></a></li>
|
||||
</ul></td>
|
||||
<td width="34%" valign="top">
|
||||
<ul>
|
||||
<li><a href="#cmdmv"><code>mv</code></a></li>
|
||||
<li><a href="#cmdnfsmount"><code>nfsmount</code></a></li>
|
||||
<li><a href="#cmdoverview"><code>nice</code></a></li>
|
||||
<li><a href="#custonshlib">NSH library (<code>nshlib</code>)</a></li>
|
||||
@ -5403,6 +5429,7 @@ xxd -i romfs_img >nsh_romfsimg.h
|
||||
<li><a href="#custonshlib"><code>up_cxxinitialize()</code></a></li>
|
||||
<li><a href="#cmdurldec"><code>urldecode</code></a></li>
|
||||
<li><a href="#cmdurlencode"><code>urlencode</code></a></li>
|
||||
<li><a href="#usbstartup">USB console startup</a></li>
|
||||
<li><a href="#cmduseradd"><code>useradd</code></a></li>
|
||||
<li><a href="#cmduserdel"><code>userdel</code></a></li>
|
||||
<li><a href="#cmdusleep"><code>usleep</code></a></li>
|
||||
|
Loading…
Reference in New Issue
Block a user