mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
Add support for the USB trace cability in NSH when a USB console is used
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4774 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -2218,13 +2218,28 @@ nsh>
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
If USB tracing is enabled, then NSH will initialize USB tracing as requested by the following:
|
If USB tracing is enabled (<code>CONFIG_USBDEV_TRACE</code>), then NSH will initialize USB tracing as requested by the following.
|
||||||
|
Default: Only USB errors are traced.
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<code>CONFIG_NSH_UBSDEV_TRACEINIT</code>.
|
<code>CONFIG_NSH_USBDEV_TRACEINIT</code>.
|
||||||
Bit set with each bit enabling a trace option (see <code>include/nuttx/usb/usbdev_trace.h</code>).
|
Show initialization events
|
||||||
Default: Only USB errors are traced.
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NSH_USBDEV_TRACECLASS</code>.
|
||||||
|
Show class driver events
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NSH_USBDEV_TRACETRANSFERS</code>.
|
||||||
|
Show data transfer events
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NSH_USBDEV_TRACECONTROLLER</code>.
|
||||||
|
Show controller events
|
||||||
|
<li>
|
||||||
|
<code>CONFIG_NSH_USBDEV_TRACEINTERRUPTS</code>.
|
||||||
|
Show interrupt-related events.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -1018,7 +1018,7 @@ Where <subdir> is one of the following:
|
|||||||
However, that configuration does not work. It fails early probably because
|
However, that configuration does not work. It fails early probably because
|
||||||
of some dependency on /dev/console before the USB connection is established.
|
of some dependency on /dev/console before the USB connection is established.
|
||||||
|
|
||||||
But there is a work around for this that does work fine (but has some side
|
But there is a work around for this that works better (but has some side
|
||||||
effects). The following configuration will also create a NSH USB console
|
effects). The following configuration will also create a NSH USB console
|
||||||
but this version will will use /dev/console. Instead, it will use the
|
but this version will will use /dev/console. Instead, it will use the
|
||||||
normal /dev/ttyACM0 USB serial device for the console:
|
normal /dev/ttyACM0 USB serial device for the console:
|
||||||
@@ -1033,16 +1033,20 @@ Where <subdir> is one of the following:
|
|||||||
|
|
||||||
CONFIG_NSH_USBCONDEV="/dev/ttyACM0"
|
CONFIG_NSH_USBCONDEV="/dev/ttyACM0"
|
||||||
|
|
||||||
|
NOTE 1: When you first start the USB console, you have hit ENTER a few
|
||||||
|
times before NSH starts. The logic does this to prevent sending USB data
|
||||||
|
before there is anything on the host side listening for USB serial input.
|
||||||
|
|
||||||
Now the side effects:
|
Now the side effects:
|
||||||
|
|
||||||
NOTE 1. When any other device other than /dev/console is used for a user
|
NOTE 2. When any other device other than /dev/console is used for a user
|
||||||
interface, linefeeds (\n) will not be expanded to carriage return /
|
interface, linefeeds (\n) will not be expanded to carriage return /
|
||||||
linefeeds (\r\n). You will need to set your terminal program to account
|
linefeeds (\r\n). You will need to set your terminal program to account
|
||||||
for this.
|
for this.
|
||||||
|
|
||||||
NOTE 2: /dev/console still exists and still refers to the serial port. So
|
NOTE 3: /dev/console still exists and still refers to the serial port. So
|
||||||
you can still use certain kinds of debug output (see include/debug.h, all
|
you can still use certain kinds of debug output (see include/debug.h, all
|
||||||
of the interfaces based on lib_lowprintf will work in this configraration).
|
of the interfaces based on lib_lowprintf will work in this configuration).
|
||||||
|
|
||||||
nxlines:
|
nxlines:
|
||||||
------
|
------
|
||||||
|
|||||||
@@ -1222,8 +1222,16 @@ CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3
|
|||||||
# readable/write-able USB driver such as: CONFIG_NSH_USBCONDEV="/dev/ttyACM0".
|
# readable/write-able USB driver such as: CONFIG_NSH_USBCONDEV="/dev/ttyACM0".
|
||||||
# CONFIG_NSH_UBSDEV_MINOR - The minor device number of the USB device.
|
# CONFIG_NSH_UBSDEV_MINOR - The minor device number of the USB device.
|
||||||
# Default: 0
|
# Default: 0
|
||||||
# CONFIG_NSH_UBSDEV_TRACEINIT - Bit set with each bit enabling a trace option
|
# CONFIG_NSH_USBDEV_TRACEINIT - Is using a USB console and CONFIG_USB_TRACE
|
||||||
# (see include/nuttx/usb/usbdev_trace.h). Default: Only USB errors are traced.
|
# is defined, this will show initialization events
|
||||||
|
# CONFIG_NSH_USBDEV_TRACECLASS - Is using a USB console and CONFIG_USB_TRACE
|
||||||
|
# is defined, this will show class driver events
|
||||||
|
# CONFIG_NSH_USBDEV_TRACETRANSFERS - Is using a USB console and CONFIG_USB_TRACE
|
||||||
|
# is defined, this will show data transfer events
|
||||||
|
# CONFIG_NSH_USBDEV_TRACECONTROLLER - Is using a USB console and CONFIG_USB_TRACE
|
||||||
|
# is defined, this will show controller events
|
||||||
|
# CONFIG_NSH_USBDEV_TRACEINTERRUPTS - Is using a USB console and CONFIG_USB_TRACE
|
||||||
|
# is defined, this will show interrupt-related events.
|
||||||
# CONFIG_NSH_CONDEV - If CONFIG_NSH_CONSOLE is set to 'y', then CONFIG_NSH_CONDEV
|
# CONFIG_NSH_CONDEV - If CONFIG_NSH_CONSOLE is set to 'y', then CONFIG_NSH_CONDEV
|
||||||
# may also be set to select the serial device used to support the NSH console.
|
# may also be set to select the serial device used to support the NSH console.
|
||||||
# This should be set to the quoted name of a readable/write-able character
|
# This should be set to the quoted name of a readable/write-able character
|
||||||
@@ -1265,7 +1273,11 @@ CONFIG_NSH_TELNET=n
|
|||||||
CONFIG_NSH_USBCONSOLE=n
|
CONFIG_NSH_USBCONSOLE=n
|
||||||
CONFIG_NSH_USBCONDEV="/dev/ttyACM0"
|
CONFIG_NSH_USBCONDEV="/dev/ttyACM0"
|
||||||
CONFIG_NSH_UBSDEV_MINOR=0
|
CONFIG_NSH_UBSDEV_MINOR=0
|
||||||
#CONFIG_NSH_UBSDEV_TRACEINIT
|
CONFIG_NSH_USBDEV_TRACEINIT=n
|
||||||
|
CONFIG_NSH_USBDEV_TRACECLASS=n
|
||||||
|
CONFIG_NSH_USBDEV_TRACETRANSFERS=n
|
||||||
|
CONFIG_NSH_USBDEV_TRACECONTROLLER=n
|
||||||
|
CONFIG_NSH_USBDEV_TRACEINTERRUPTS=n
|
||||||
#CONFIG_NSH_CONDEV
|
#CONFIG_NSH_CONDEV
|
||||||
CONFIG_NSH_ARCHINIT=n
|
CONFIG_NSH_ARCHINIT=n
|
||||||
CONFIG_NSH_IOBUFFER_SIZE=512
|
CONFIG_NSH_IOBUFFER_SIZE=512
|
||||||
|
|||||||
Reference in New Issue
Block a user