Configuration Settings
The availability of the above commands depends upon features that may or may not be enabled in the NuttX configuration file. The following cmdtable indicates the dependency of each command on NuttX configuration settings. General configuration settings are discussed in the NuttX Porting Guide. Configuration settings specific to NSH as discussed at the cmdbottom of this document.
Note that in addition to general NuttX configuration settings, each NSH command can be individually disabled via the settings in the rightmost column. All of these settings make the configuration of NSH potentially complex but also allow it to squeeze into very small memory footprints.
Command Dependencies on Configuration Settings
Command |
Depends on Configuration |
Can Be Disabled with |
---|---|---|
|
! |
|
|
|
|
|
|
|
|
|
|
|
|
|
. |
|
|
! |
. |
|
|
. |
|
! |
|
|
|
. |
|
|
. |
|
|
. |
|
|
. |
|
|
|
|
! |
|
|
|
. |
|
|
|
|
|
. |
|
|
|
|
|
. |
|
|
. |
|
|
|
|
|
. |
|
|
|
|
|
. |
|
|
. |
|
|
|
|
|
|
|
|
|
|
|
|
|
! |
. |
|
|
. |
|
! |
|
|
|
|
|
|
. |
|
|
|
|
|
|
|
. |
|
|
(! |
|
|
! |
|
|
|
|
|
! |
|
|
! |
|
|
! |
|
|
! |
|
|
|
|
|
! |
|
|
|
|
|
|
|
|
|
|
|
|
||
! |
|
|
|
|
|
|
|
|
! |
|
|
! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
. |
|
|
|
|
|
|
||
! |
|
|
. |
|
|
! |
|
|
! |
|
|
. |
|
|
|
|
|
! |
|
|
! |
|
|
! |
|
|
! |
|
|
. |
|
|
|
|
|
. |
|
Built-In Command Dependencies on Configuration Settings
All built-in applications require that support for NSH built-in
applications has been enabled. This support is enabled with
CONFIG_BUILTIN=y
and CONFIG_NSH_BUILTIN_APPS=y
.
Command |
Depends on Configuration |
---|---|
|
|
|
|
NSH-Specific Configuration Settings
The behavior of NSH can be modified with the following settings in the
boards/<arch>/<chip>/<board>/defconfig
file:
Configuration |
Description |
---|---|
|
Selects the minimal implementation of |
|
Selects the more extensive, EMACS-like command line editor. Select this option only if (1) you don’t mind a modest increase in the FLASH footprint, and (2) you work with a terminal that supports extensive VT100 editing commands. Selecting this option will add probably 1.5-2KB to the FLASH footprint. |
|
Support external registered, “builtin” applications that can
be executed from the NSH command line (see apps/README.txt for
more information). This required |
|
Size of a static I/O buffer used for file access (ignored if there is no file system). Default is 1024. |
|
|
|
The maximum length of one command line and of one output line. Default: 80 |
|
By default, you can enter multiple NSH commands on a line with each command separated by a semicolon. You can disable this feature to save a little memory on FLASH challenged platforms. Default: n |
|
If selected, then the output from commands, from file applications, and from NSH built-in commands can be used as arguments to other commands. The entity to be executed is identified by enclosing the command line in back quotes. For example: set FOO `myprogram $BAR`
will execute the program named |
|
The maximum number of NSH command arguments. Default: 6 |
|
Support concatenation of strings with environment variables or command output. For example: set FOO XYZ
set BAR 123
set FOOBAR ABC_${FOO}_${BAR}
would set the environment variable |
|
By default, there are no internal NSH variables. NSH will use OS
environment variables for all variable storage. If this option,
NSH will also support local NSH variables. These variables are,
for the most part, transparent and work just like the OS
environment variables. The difference is that when you
create new tasks, all of environment variables are
inherited by the created tasks. NSH local variables are not.
If this option is enabled (and |
|
Enables back-slash quoting of certain characters within the
command. This option is useful for the case where an NSH script
is used to dynamically generate a new NSH script. In that case,
commands must be treated as simple text strings without
interpretation of any special characters. Special characters
such as |
|
The maximum number of nested |
|
This can be set to y to suppress support for scripting.
This setting disables the |
|
If scripting is enabled, then then this option can be selected
to suppress support for |
|
If scripting is enabled, then then this option can be selected
suppress support |
|
This can be set to y to suppress support for background
commands. This setting disables the |
|
If the architecture supports an MMC/SD slot and if the NSH
architecture specific logic is present, this option will provide
the MMC/SD minor number, i.e., the MMC/SD block driver will be
registered as |
|
If Normally, the serial console device is a UART and RS-232
interface. However, if
If there are more than one USB slots, then a USB device minor number may also need to be provided:
If USB tracing is enabled (
|
|
If
|
|
If |
|
Set |
CMD |
w/o |
w/ |
---|---|---|
|
Set environment variable <a> to <b> |
Set NSH variable <a> to <b> (Unless the NSH variable has been promoted via
|
|
Causes an error. |
Lists all NSH variables. |
|
Unsets environment variable <a> |
Unsets both environment variable and NSH variable with and name <a> |
|
Causes an error, |
Unsets NSH variable <a>. Sets environment variable <a> to <b>. |
|
Causes an error. |
Sets environment variable <a> to the value of NSH variable <a> (or “” if the NSH variable has not been set). Unsets NSH local variable <a>. |
|
Lists all environment variables |
Lists all environment variables (only) |
If Telnet is selected for the NSH console, then we must configure the resources used by the Telnet daemon and by the Telnet clients.
Configuration |
Description |
---|---|
|
The telnet daemon will listen on this TCP port number for connections. Default: 23 |
|
Priority of the Telnet daemon. Default: |
|
Stack size allocated for the Telnet daemon. Default: 2048 |
|
Priority of the Telnet client. Default: |
|
Stack size allocated for the Telnet client. Default: 2048 |
One or both of CONFIG_NSH_CONSOLE
and CONFIG_NSH_TELNET
must be
defined. If CONFIG_NSH_TELNET
is selected, then there some other
configuration settings that apply:
Configuration |
Description |
---|---|
|
Of course, networking must be enabled. |
|
TCP/IP support is required for telnet (as well as various other TCP-related configuration settings). |
|
Obtain the IP address via DHCP. |
|
If |
|
Default router IP address |
|
Network mask |
|
Set if your Ethernet hardware has no built-in MAC address. If set, a bogus MAC will be assigned. |
|
This is the maximum round trip for a response to a ICMP ECHO request. It is in units of deciseconds. The default is 20 (2 seconds). |
If you use DHCPC, then some special configuration network options are required. These include:
Configuration |
Description |
---|---|
|
Of course, networking must be enabled. |
|
UDP support is required for DHCP (as well as various other UDP-related configuration settings). |
|
UDP broadcast support is needed. |
|
Per RFC2131 (p. 9), the DHCP client must be prepared to receive DHCP messages of up to 576 bytes (excluding Ethernet, IP, or UDP headers and FCS). NOTE: Note that the actual MTU setting will depend upon the specific link protocol. Here Ethernet is indicated. |
If CONFIG_ETC_ROMFS
is selected, then the following additional
configuration setting apply:
Configuration |
Description |
---|---|
|
This is the relative path to the system init script within the
mountpoint. The default is |
|
This is the relative path to the startup script within the
mountpoint. The default is |
Common Problems
Problem:
The function 'readline' is undefined.
Usual Cause:
The following is missing from your defconfig file:
CONFIG_SYSTEM_READLINE=y