From 466fccc494a9bd48111d549a1f4caf6ccb1d0a70 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 13 Jun 2017 17:39:38 -0600 Subject: [PATCH] NSH Documentation: A justification for 3 ENTERs when using USB serial console. --- Documentation/NuttShell.html | 103 ++++++++++++++++++++++------------- 1 file changed, 65 insertions(+), 38 deletions(-) diff --git a/Documentation/NuttShell.html b/Documentation/NuttShell.html index 5ee579995f..dae6f3019f 100644 --- a/Documentation/NuttShell.html +++ b/Documentation/NuttShell.html @@ -8,7 +8,7 @@

NuttShell (NSH)

-

Last Updated: June 6, 2017

+

Last Updated: June 13, 2017

@@ -305,7 +305,7 @@
- 2.37 Create a FAT Filesystem (mkfatfs) + 2.37 Create a FAT File System (mkfatfs) @@ -335,7 +335,7 @@
- 2.42 Mount an NFS file system (nfsmount) + 2.42 Mount an NFS File System (nfsmount) @@ -619,9 +619,35 @@ NuttShell (NSH) nsh> - 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. nsh> is the NSH prompt and indicates that you may enter a command from the console.

+

+ USB console startup. + When using a USB console, the start-up sequence differs a little: In this case, you are required to press ENTER three times. Then NSH prompt will appear as described above. + This is required for the following reasons: +

+
    +
  1. + 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 ENTER to be pressed three times assures that the connection is stable. +
  2. +
  3. + 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 AT modem commands to the host depending upon how the host serial port is configured. + By waiting for ENTER 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. +
  4. +
  5. + Similarly, in the second step when the applications is started, there may be additional AT 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 ENTER input eliminates the invalid command errors from both (2) and (3). +
  6. +
  7. + 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. +
  8. +
+

Extended Command Line Editing. By default, NuttX uses a simple command line editor that allows command entry after the nsh> and supports only the backspace key for editing. @@ -752,7 +778,7 @@ nsh> <file> is the full or relative path to any writable object - in the filesystem name space (file or character driver). + in the file system name space (file or character driver). Such objects will be referred to simply as files throughout this document. @@ -968,7 +994,7 @@ done