move last content from old docs to new docs; remove old docs
@@ -1,3 +0,0 @@
|
||||
/TODO.txt
|
||||
/ChangeLog.txt
|
||||
/NuttXConfigVariables.*
|
||||
@@ -1,385 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NFS Client How-To</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<hr><hr>
|
||||
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NFS Client How-To</i></font></big></h1>
|
||||
<p>Last Updated: June 18, 2012</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr><hr>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1>Table of Contents</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<center><table width ="80%">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#nfsconfiguration">Adding NFS to the NuttX Configuration</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#mountinterface">Mount Interface</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#nfsmount">NFS Mount Command</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#serverconfig">Configuring the NFS server (Ubuntu)</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></center>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="nfsconfiguration"><h1>Adding NFS to the NuttX Configuration</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
The NFS client is easily added to your configuration:
|
||||
You simply need to add <code>CONFIG_NFS</code> to your <code>nuttx/.config</code> file.
|
||||
There are, however, a few dependencies on other system settings:
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
First, there are things that you must configure in order to be able to use any file system:
|
||||
</li>
|
||||
<ul>
|
||||
<li>
|
||||
<code>CONFIG_DISABLE_MOUNTPOINT=n</code>. You must include support for mount points in the pseudo-file system.
|
||||
</li>
|
||||
</ul>
|
||||
<li>
|
||||
And there are several dependencies on the networking configuration.
|
||||
At a minimum, you need to have the following selections:
|
||||
</li>
|
||||
<ul>
|
||||
<li>
|
||||
<code>CONFIG_NET=y</code>. General networking support.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_UDP=y</code>. Support for UDP.
|
||||
</li>
|
||||
</ul>
|
||||
</ol>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="mountinterface"><h1>Mount Interface</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
A low-level, C-callable interface is provided to mount a file system.
|
||||
That interface is called <code>mount()</code> and is mentioned in the <a href="NuttxPortingGuide.html#NxFileSystem"><code>porting guide</code></a> and is prototyped in the header file <code>include/sys/mount.h</code>:
|
||||
</p>
|
||||
<ul><pre>
|
||||
int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data);
|
||||
</pre></ul>
|
||||
<p>
|
||||
<b>Synopsis</b>:
|
||||
<code>mount()</code> attaches the filesystem specified by the <code>source</code> block device name into the root file system at the path specified by <code>target</code>.
|
||||
</p>
|
||||
<p>
|
||||
<b>Input Parameters</b>:
|
||||
<ul>
|
||||
<li><code>source</code>. A null-terminated string providing the fill path to a block driver in the NuttX pseudo-file system.
|
||||
<li><code>target</code>. The location in the NuttX pseudo-file system where the volume will be mounted.
|
||||
<li><code>filesystemtype</code>. A string identifying the type of file system to use.
|
||||
<li><code>mountflags</code>. Various flags that can be used to qualify how the file system is mounted.
|
||||
<li><code>data</code>. Opaque data that is passed to the file system with the mount occurs.
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
<b>Returned Values</b>
|
||||
Zero is returned on success; -1 is returned on an error and <code>errno</code> is set appropriately:
|
||||
<ul>
|
||||
<li><code>EACCES</code>.
|
||||
A component of a path was not searchable or mounting a read-only filesystem was attempted without giving the <code>MS_RDONLY</code> flag.
|
||||
</li>
|
||||
<li><code>EBUSY</code>.
|
||||
<code>source</code> is already mounted.
|
||||
</li>
|
||||
<li><code>EFAULT</code>.
|
||||
One of the pointer arguments points outside the user address space.
|
||||
</li>
|
||||
<li><code>EINVAL</code>.
|
||||
<code>source</code> had an invalid superblock.
|
||||
</li>
|
||||
<li><code>ENODEV</code>.
|
||||
<code>filesystemtype</code> not configured
|
||||
</li>
|
||||
<li><code>ENOENT</code>.
|
||||
A pathname was empty or had a nonexistent component.
|
||||
</li>
|
||||
<li><code>ENOMEM</code>.
|
||||
Could not allocate a memory to copy filenames or data into.
|
||||
</li>
|
||||
<li><code>ENOTBLK</code>.
|
||||
<code>source</code> is not a block device
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
This same interface can be used to mount a remote, NFS file system using some special parameters.
|
||||
The NFS mount differs from the <i>normal</i> file system mount in that: (1) there is no block driver for the NFS file system, and (2) special parameters must be passed as <code>data</code> to describe the remote NFS server.
|
||||
Thus the following code snippet might represent how an NFS file system is mounted:
|
||||
</p>
|
||||
<ul><pre>
|
||||
#include <sys/mount.h>
|
||||
#include <nuttx/fs/nfs.h>
|
||||
|
||||
struct nfs_args data;
|
||||
char *mountpoint;
|
||||
|
||||
ret = mount(NULL, mountpoint, string "nfs", 0, (FAR void *)&data);
|
||||
</pre></ul>
|
||||
<p>
|
||||
NOTE that: (1) the block driver parameter is <code>NULL</code>.
|
||||
The <code>mount()</code> is smart enough to know that no block driver is needed with the NFS file system.
|
||||
(2) The NFS file system is identified with the simple string "nfs"
|
||||
(3) A reference to <code>struct nfs_args</code> is passed as an NFS-specific argument.
|
||||
</p>
|
||||
<p>
|
||||
The NFS-specific interface is described in the file <code>include/nuttx/fs/nfs.h</code>.
|
||||
There you can see that <code>struct nfs_args</code> is defined as:
|
||||
</p>
|
||||
<ul><pre>
|
||||
struct nfs_args
|
||||
{
|
||||
uint8_t addrlen; /* Length of address */
|
||||
uint8_t sotype; /* Socket type */
|
||||
uint8_t flags; /* Flags, determines if following are valid: */
|
||||
uint8_t timeo; /* Time value in deciseconds (with NFSMNT_TIMEO) */
|
||||
uint8_t retrans; /* Times to retry send (with NFSMNT_RETRANS) */
|
||||
uint16_t wsize; /* Write size in bytes (with NFSMNT_WSIZE) */
|
||||
uint16_t rsize; /* Read size in bytes (with NFSMNT_RSIZE) */
|
||||
uint16_t readdirsize; /* readdir size in bytes (with NFSMNT_READDIRSIZE) */
|
||||
char *path; /* Server's path of the directory being mount */
|
||||
struct sockaddr_storage addr; /* File server address (requires 32-bit alignment) */
|
||||
};
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="nfsmount"><h1>NFS Mount Command</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
The <a href="NuttShell.html">NuttShell (NSH)</a> also supports a command called <code>nfsmount</code>
|
||||
that can be used to mount a remote file system via the NSH command line.
|
||||
</p>
|
||||
<p>
|
||||
<b>Command Syntax:</b>
|
||||
</p>
|
||||
<ul><pre>
|
||||
nfsmount <server-address> <mount-point> <remote-path>
|
||||
</pre></ul>
|
||||
<p>
|
||||
<b>Synopsis</b>.
|
||||
The <code>nfsmount</code> command mounts a network file system in the NuttX pseudo filesystem.
|
||||
The <code>nfsmount</code> will use NFSv3 UDP protocol to mount the remote file system.
|
||||
</p>
|
||||
<p>
|
||||
<b>Command Line Arguments</b>.
|
||||
The <code>nfsmount</code> takes three arguments:
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
The <code><server-address></code> is the IP address of the server exporting the file system you wish to mount.
|
||||
This implementation of NFS for the NuttX RTOS is only for a local area network, so the server and client must be in the same network.
|
||||
</li>
|
||||
<li>
|
||||
The <code><mount-point ></code> is the location in the NuttX pseudo filesystem where the mounted volume will appear.
|
||||
This mount point can only reside in the NuttX pseudo filesystem.
|
||||
By convention, this mount point is a subdirectory under <code>/mnt</code>.
|
||||
The mount command will create whatever pseudo directories that may be needed to complete the full path (but the full path must not already exist).
|
||||
</li>
|
||||
<li>
|
||||
The <code><remote-path></code> is the file system <code>/</code> directory being exported from server.
|
||||
This <code>/</code> directory must have been configured for exportation on the server before when the NFS server was set up.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
After the volume has been mounted in the NuttX pseudo filesystem, it may be access in the same way as other objects in the file system.
|
||||
</p>
|
||||
<p>
|
||||
<b>Example</b>.
|
||||
Suppose that the NFS server has been configured to export the directory <code>/export/shared</code>.
|
||||
The the following command would mount that file system (assuming that the target also has privileges to mount the file system).
|
||||
</p>
|
||||
<ul><pre>
|
||||
NuttShell (NSH)
|
||||
nsh> ls /mnt
|
||||
/mnt:
|
||||
nsh: ls: no such directory: /mnt
|
||||
nsh> nfsmount 10.0.0.1 /mnt/nfs /export/shared
|
||||
nsh> ls -l /mnt/nfs
|
||||
/mnt/nfs:
|
||||
drwxrwxrwx 4096 ..
|
||||
drwxrwxrwx 4096 testdir/
|
||||
-rw-rw-rw- 6 ctest.txt
|
||||
-rw-r--r-- 15 btest.txt
|
||||
drwxrwxrwx 4096 .
|
||||
nsh> echo "This is a test" >/mnt/nfs/testdir/testfile.txt
|
||||
nsh> ls -l /mnt/nfs/testdir
|
||||
/mnt/nfs/testdir:
|
||||
-rw-rw-rw- 21 another.txt
|
||||
drwxrwxrwx 4096 ..
|
||||
drwxrwxrwx 4096 .
|
||||
-rw-rw-rw- 16 testfile.txt
|
||||
nsh> cat /mnt/nfs/testdir/testfile.txt
|
||||
This is a test
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="serverconfig"><h1>Configuring the NFS server (Ubuntu)</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
Setting up the server will be done in two steps:
|
||||
First, setting up the configuration file for NFS, and then starting the NFS services.
|
||||
But first, you need to install the nfs server on Ubuntu with these two commands:
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo apt-get install nfs-common</FONT>
|
||||
# sudo apt-get install nfs-kernel-server</FONT>
|
||||
</pre></ul>
|
||||
|
||||
<p>
|
||||
After that, we need to make or choose the directory we want to export from the NFS server.
|
||||
In our case, we are going to make a new directory called <code>/export</code>.
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo mkdir /export
|
||||
</pre></ul>
|
||||
<p>
|
||||
It is important that <code>/export</code> directory allow access to everyone (777 permissions) as we will be accessing the NFS share from the client with no authentication.
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo chmod 777 /export
|
||||
</pre></ul>
|
||||
<p>
|
||||
When all this is done, we will need to edit the configuration file to set up an NFS server: <code>/etc/exports</code>.
|
||||
This file contains a list of entries;
|
||||
each entry indicates a volume that is shared and how it is shared.
|
||||
For more information for a complete description of all the setup options for this file you can check in the man pages (<code>man export</code>).</p>
|
||||
An entry in <code>/etc/exports</code> will typically look like this:
|
||||
</p>
|
||||
<ul><pre>
|
||||
directory machine1(option11,option12)
|
||||
</pre></ul>
|
||||
<p>
|
||||
So for our example we export <code>/export</code> to the client 10.0.0.2 add the entry:
|
||||
</p>
|
||||
<ul><pre>
|
||||
/export 10.0.0.2(rw)
|
||||
</pre></ul>
|
||||
<p>
|
||||
In our case we are using all the default options except for the <code>ro</code> that we replaced with <code>rw</code> so that our client will have read and write access to the directory that we are exporting.
|
||||
</p>
|
||||
</p>
|
||||
After we do all the require configurations, we are ready to start the server with the next command:
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo /etc/init.d/nfs-kernel-server start
|
||||
</pre></ul>
|
||||
</p>
|
||||
Note: If you later decide to add more NFS exports to the /etc/exports file, you will need to either restart NFS daemon
|
||||
or run command exportfs.
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo /etc/init.d/nfs-kernel-server start
|
||||
</pre></ul>
|
||||
<p>Or</p>
|
||||
<ul><pre>
|
||||
# exportfs -ra
|
||||
</pre></ul>
|
||||
<p>
|
||||
Now we can check if the export directory and our mount point is properly set up.
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo showmount -e
|
||||
# sudo showmount -a
|
||||
</pre></ul>
|
||||
<p>
|
||||
And also we can verify if NFS is running in the system with:
|
||||
</p>
|
||||
<P STYLE="margin-left: 0.49in; margin-bottom: 0in; line-height: 100%">
|
||||
<ul><pre>
|
||||
# rpcinfo –p</FONT>
|
||||
program vers proto port
|
||||
100000 2 tcp 111 portmapper
|
||||
100000 2 udp 111 portmapper
|
||||
100011 1 udp 749 rquotad
|
||||
100011 2 udp 749 rquotad
|
||||
100005 1 udp 759 mountd
|
||||
100005 1 tcp 761 mountd
|
||||
100005 2 udp 764 mountd
|
||||
100005 2 tcp 766 mountd
|
||||
100005 3 udp 769 mountd
|
||||
100005 3 tcp 771 mountd
|
||||
100003 2 udp 2049 nfs
|
||||
100003 3 udp 2049 nfs
|
||||
300019 1 tcp 830 amd
|
||||
300019 1 udp 831 amd
|
||||
100024 1 udp 944 status
|
||||
100024 1 tcp 946 status
|
||||
100021 1 udp 1042 nlockmgr
|
||||
100021 3 udp 1042 nlockmgr
|
||||
100021 4 udp 1042 nlockmgr
|
||||
100021 1 tcp 1629 nlockmgr
|
||||
100021 3 tcp 1629 nlockmgr
|
||||
100021 4 tcp 1629 nlockmgr
|
||||
</pre></ul>
|
||||
<p>
|
||||
Now your NFS sever is sharing <code>/export</code> directory to be accessed.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,76 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NxWidgets</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<hr><hr>
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NxWidgets</i></font></big></h1>
|
||||
<p>Last Updated: November 7, 2017</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1>NxWidgets</h1>
|
||||
<p>
|
||||
In order to better support NuttX based platforms, a special graphical userinterface has been created called NXWidgets.
|
||||
NXWidgets is written in C++ and integrates seamlessly with the NuttX <a href="NXGraphicsSubsystem.html">NX graphics subsystem</a> in order to provide graphic objects, or "widgets," in the NX Graphics Subsystem
|
||||
</p>
|
||||
<p>
|
||||
Some of the features of NXWidgets include:
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>Conservative C++</b>.
|
||||
NXWidgets is written entirely in C++ but using only selected "embedded friendly" C++ constructs that are fully supported under NuttX.
|
||||
No additional C++ support libraries are required.
|
||||
</li>
|
||||
<li><b>NX Integration</b>.
|
||||
NXWidgets integrate seamlessly with the <a href="NXGraphicsSubsystem.html">NX graphics subsystem</a>.
|
||||
Think of the X server under Linux … the NX graphics system is like a tiny X server that provides windowing under NuttX.
|
||||
By adding NXWidgets, you can support graphics objects like buttons and text boxes in the NX windows and toolbars.
|
||||
</li>
|
||||
<li><b>Small Footprint</b>.
|
||||
NXWidgets is tailored for use MCUs in embedded applications.
|
||||
It is ideally suited for mid- and upper-range of most MCU families.
|
||||
A complete NXWidgets is possible in as little as 40K of FLASH and maybe 4K of SRAM.
|
||||
</li>
|
||||
<li><b>Output Devices</b>.
|
||||
NXWidgets will work on the high-end frame buffer devices as well as on LCDs connected via serial or parallel ports to a small MCU.
|
||||
</li>
|
||||
<li><b>Input Devices</b>.
|
||||
NXWidgets will accept position and selection inputs from a mouse or a touchscreen.
|
||||
It will also support character input from a keyboard such as a USB keyboard.
|
||||
NXWidgets supports on very special widget called CKeypad that will provide keyboard input via an on-screen keypad that can be operated via mouse or touchscreen inputs.
|
||||
</li>
|
||||
<li><b>Many Graphic Objects</b>.
|
||||
Some of the graphic objects supported by NXWidgets include labels, buttons, text boxes, button arrays, check boxes, cycle buttons, images, sliders, scrollable list boxes, progress bars, and more.
|
||||
</li>
|
||||
<li><b>DOxygen Documentation</b>
|
||||
DOxygen documentation is available.
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
Note: Many of the fundamental classed in NxWidgets derive from the Antony
|
||||
Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style
|
||||
license. See the COPYING file for details.
|
||||
</p>
|
||||
<h1>NXWidgets DOxygen Documentation</h1>
|
||||
<p>
|
||||
Release notes, DOxygen documentation, as well as downloads for the latest NxWidgets releases are available online:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<b>NxWidgets-1.19</b>:
|
||||
<a href="http://nuttx.org/nxwidgets_v1_19/html/index.html">Documentation</a>,
|
||||
<a href="http://sourceforge.net/projects/nuttx/files/NxWidgets/NxWidgets-1.19/">Release notes</a>, and
|
||||
<a href="http://sourceforge.net/projects/nuttx/files/NxWidgets/NxWidgets-1.19/">Downloads</a>
|
||||
</li>
|
||||
</p>
|
||||
<p>
|
||||
Thanks go to Jose Pablo Carballo for contributing this!
|
||||
</p>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,453 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NuttX USB Trace Capability</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
|
||||
<body background="backgd.gif">
|
||||
<hr><hr>
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttX USB Device Trace</i></font></big></h1>
|
||||
<p>Last Updated: March 20, 2011</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr><hr>
|
||||
<p><b>USB Device Tracing Controls</b>.
|
||||
The NuttX USB device subsystem supports a fairly sophisticated tracing facility.
|
||||
The basic trace cabability is controlled by these NuttX configuration settings:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>CONFIG_USBDEV_TRACE</code>: Enables USB tracing</li>
|
||||
<li><code>CONFIG_USBDEV_TRACE_NRECORDS</code>: Number of trace entries to remember</li>
|
||||
</ul>
|
||||
<p><b>Trace IDs</b>.
|
||||
The trace facility works like this:
|
||||
When enabled, USB events that occur in either the USB device driver or in the USB class driver are logged.
|
||||
These events are described in <code>include/nuttx/usb/usbdev_trace.h</code>.
|
||||
The logged events are identified by a set of event IDs:
|
||||
</p>
|
||||
<ul><table>
|
||||
<tr>
|
||||
<td><code>TRACE_INIT_ID</code></td>
|
||||
<td>Initialization events</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_EP_ID</code></td>
|
||||
<td>Endpoint API calls</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_DEV_ID</code></td>
|
||||
<td>USB device API calls</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_CLASS_ID</code></td>
|
||||
<td>USB class driver API calls</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_CLASSAPI_ID</code></td>
|
||||
<td>Other class driver system API calls</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_CLASSSTATE_ID</code></td>
|
||||
<td>Track class driver state changes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_INTENTRY_ID</code></td>
|
||||
<td>Interrupt handler entry</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_INTDECODE_ID</code></td>
|
||||
<td>Decoded interrupt event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_INTEXIT_ID</code></td>
|
||||
<td>Interrupt handler exit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_OUTREQQUEUED_ID</code></td>
|
||||
<td>Request queued for OUT endpoint</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_INREQQUEUED_ID</code></td>
|
||||
<td>Request queued for IN endpoint</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_READ_ID</code></td>
|
||||
<td>Read (OUT) action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_WRITE_ID</code></td>
|
||||
<td>Write (IN) action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_COMPLETE_ID</code></td>
|
||||
<td>Request completed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_DEVERROR_ID</code></td>
|
||||
<td>USB controller driver error event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_CLSERROR_ID</code></td>
|
||||
<td>USB class driver error event</td>
|
||||
</tr>
|
||||
</table></ul>
|
||||
<p><b>Logged Events</b>.
|
||||
Each logged event is 32-bits in size and includes
|
||||
</p>
|
||||
<ol>
|
||||
<li>8-bits of the trace ID (values associated with the above)</li>
|
||||
<li>8-bits of additional trace ID data, and</li>
|
||||
<li>16-bits of additional data.</li>
|
||||
</ol>
|
||||
<p><b>8-bit Trace Data</b>
|
||||
The 8-bit trace data depends on the specific event ID. As examples,
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
For the USB serial and mass storage class, the 8-bit event data is provided in <code>include/nuttx/usb/usbdev_trace.h</code>.
|
||||
</li>
|
||||
<li>
|
||||
For the USB device driver, that 8-bit event data is provided within the USB device driver itself.
|
||||
So, for example, the 8-bit event data for the LPC1768 USB device driver is found in <code>arch/arm/src/lpc17xx_40xx/lpc17_40_usbdev.c</code>.
|
||||
</li>
|
||||
</ul>
|
||||
<p><b>16-bit Trace Data</b>.
|
||||
The 16-bit trace data provided additional context data relevant to the specific logged event.
|
||||
</p>
|
||||
<p><b>Trace Control Interfaces</b>.
|
||||
Logging of each of these kinds events can be enabled or disabled using the interfaces described in <code>include/nuttx/usb/usbdev_trace.h</code>.
|
||||
</p>
|
||||
<p><b>Enabling USB Device Tracing</b>.
|
||||
USB device tracing will be configured if <code>CONFIG_USBDEV</code> and either of the following are set in the NuttX configuration file:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>CONFIG_USBDEV_TRACE</code>, or</li>
|
||||
<li><code>CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_USB</code></li>
|
||||
</ul>
|
||||
<p><b>Log Data Sink</b>.
|
||||
The logged data itself may go to either (1) an internal circular buffer, or (2) may be provided on the console.
|
||||
If <code>CONFIG_USBDEV_TRACE</code> is defined, then the trace data will go to the circular buffer.
|
||||
The size of the circular buffer is determined by <code>CONFIG_USBDEV_TRACE_NRECORDS</code>.
|
||||
Otherwise, the trace data goes to console.
|
||||
<p>
|
||||
<p><b>Example</b>.
|
||||
Here is an example of USB trace output using <code>apps/examples/usbserial</code> for an LPC1768 platform with the following NuttX configuration settings:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>CONFIG_DEBUG_FEATURES</code>, <code>CONFIG_DEBUG_INFO</code>, <code>CONFIG_USB</code>
|
||||
<li><code>CONFIG_EXAMPLES_USBSERIAL_TRACEINIT</code>, <code>CONFIG_EXAMPLES_USBSERIAL_TRACECLASS</code>,
|
||||
<code>CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS</code>, <code>CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER</code>,
|
||||
<code>CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS</code>
|
||||
</ul>
|
||||
<p>Console Output:</p>
|
||||
<ul><table>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>ABDE</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>usbserial_main: Registering USB serial driver</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>uart_register: Registering /dev/ttyUSB0</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>usbserial_main: Successfully registered the serial driver</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">1</td>
|
||||
<td align="left"><code>Class API call 1: 0000</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">2</td>
|
||||
<td align="left"><code>Class error: 19:0000</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>usbserial_main: ERROR: Failed to open /dev/ttyUSB0 for reading: 107</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>usbserial_main: Not connected. Wait and try again.</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">3</td>
|
||||
<td align="left"><code>Interrupt 1 entry: 0039</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">4</td>
|
||||
<td align="left"><code>Interrupt decode 7: 0019</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">5</td>
|
||||
<td align="left"><code>Interrupt decode 32: 0019</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">6</td>
|
||||
<td align="left"><code>Interrupt decode 6: 0019</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">7</td>
|
||||
<td align="left"><code>Class disconnect(): 0000</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">8</td>
|
||||
<td align="left"><code>Device pullup(): 0001</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">9</td>
|
||||
<td align="left"><code>Interrupt 1 exit: 0000</code></td>
|
||||
</tr>
|
||||
</table></ul>
|
||||
<p>
|
||||
The numbered items are USB USB trace output.
|
||||
You can look in the file <code>drivers/usbdev/usbdev_trprintf.c</code> to see examctly how each output line is formatted.
|
||||
Here is how each line should be interpreted:
|
||||
</p>
|
||||
<ul><table>
|
||||
<tr>
|
||||
<th align="center"> </th>
|
||||
<td align="left">USB EVENT ID</td>
|
||||
<td align="right">8-bit<br>EVENT<br>DATA</td>
|
||||
<td align="left">MEANING</td>
|
||||
<td align="left">16-bit<br>EVENT<br>DATA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">1</td>
|
||||
<td align="left"><code>TRACE_CLASSAPI_ID</code><sup>1</sup></td>
|
||||
<td align="right">1</td>
|
||||
<td align="left"><code>USBSER_TRACECLASSAPI_SETUP</code><sup>1</sup></td>
|
||||
<td align="left">0000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">2</td>
|
||||
<td align="left"><code>TRACE_CLSERROR_ID</code><sup>1</sup></td>
|
||||
<td align="right">19</td>
|
||||
<td align="left"><code>USBSER_TRACEERR_SETUPNOTCONNECTED</code><sup>1</sup></td>
|
||||
<td align="left">0000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">3</td>
|
||||
<td align="left"><code>TRACE_INTENTRY_ID</code><sup>1</sup></td>
|
||||
<td align="right">1</td>
|
||||
<td align="left"><code>LPC17_40_TRACEINTID_USB</code><sup>2</sup></td>
|
||||
<td align="left">0039</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">4</td>
|
||||
<td align="left"><code>TRACE_INTDECODE_ID</code><sup>2</sup></td>
|
||||
<td align="right">7</td>
|
||||
<td align="left"><code>LPC17_40_TRACEINTID_DEVSTAT</code><sup>2</sup></td>
|
||||
<td align="left">0019</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">5</td>
|
||||
<td align="left"><code>TRACE_INTDECODE_ID</code><sup>2</sup></td>
|
||||
<td align="right">32</td>
|
||||
<td align="left"><code>LPC17_40_TRACEINTID_SUSPENDCHG</code><sup>2</sup></td>
|
||||
<td align="left">0019</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">6</td>
|
||||
<td align="left"><code>TRACE_INTDECODE_ID</code><sup>2</sup></td>
|
||||
<td align="right">6</td>
|
||||
<td align="left"><code>LPC17_40_TRACEINTID_DEVRESET</code><sup>2</sup></td>
|
||||
<td align="left">0019</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">7</td>
|
||||
<td align="left"><code>TRACE_CLASS_ID</code><sup>1</sup></td>
|
||||
<td align="right">3</td>
|
||||
<td align="left"><code>(See TRACE_CLASSDISCONNECT</code><sup>1</sup>)</td>
|
||||
<td align="left">0000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">8</td>
|
||||
<td align="left"><code>TRACE_DEV_ID</code><sup>1</sup></td>
|
||||
<td align="right">6</td>
|
||||
<td align="left"><code>(See TRACE_DEVPULLUP</code><sup>1</sup>)</td>
|
||||
<td align="left">0001</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">9</td>
|
||||
<td align="left"><code>TRACE_INTEXIT_ID</code><sup>1</sup></td>
|
||||
<td align="right">1</td>
|
||||
<td align="left"><code>LPC17_40_TRACEINTID_USB</code><sup>2</sup></td>
|
||||
<td align="left">0000</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><small><b>NOTES</b>:<br>
|
||||
<sup>1</sup>See <code>include/nuttx/usb/usbdev_trace.h</code><br>
|
||||
<sup>2</sup><code>See arch/arm/src/lpc17xx_40xx/lpc17_40_usbdev.c</code>
|
||||
</small></p>
|
||||
</ul>
|
||||
<p>
|
||||
In the above example you can see that:
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>1</b>.
|
||||
The serial class USB setup method was called for the USB serial class.
|
||||
This is the corresponds to the following logic in <code>drivers/usbdev/pl2303.c</code>:
|
||||
<ul><pre>
|
||||
static int pl2303_setup(FAR struct uart_dev_s *dev)
|
||||
{
|
||||
...
|
||||
usbtrace(PL2303_CLASSAPI_SETUP, 0);
|
||||
...
|
||||
</pre></ul>
|
||||
</li>
|
||||
<li><b>2</b>.
|
||||
An error occurred while processing the setup command because no configuration has yet been selected by the host.
|
||||
This corresponds to the following logic in <code>drivers/usbdev/pl2303.c</code>:
|
||||
<ul><pre>
|
||||
static int pl2303_setup(FAR struct uart_dev_s *dev)
|
||||
{
|
||||
...
|
||||
/* Check if we have been configured */
|
||||
|
||||
if (priv->config == PL2303_CONFIGIDNONE)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_SETUPNOTCONNECTED), 0);
|
||||
return -ENOTCONN;
|
||||
}
|
||||
...
|
||||
</pre></ul>
|
||||
<li><b>3-6</b>.
|
||||
Here is a USB interrupt that suspends and resets the device.
|
||||
</li>
|
||||
<li><b>7-8</b>.
|
||||
During the interrupt processing the serial class is disconnected
|
||||
</li>
|
||||
<li><b>9</b>.
|
||||
And the interrupt returns
|
||||
</li>
|
||||
</ul>
|
||||
<p><b>USB Monitor</b>.
|
||||
The <i>USB monitor</i> is an application in the <code>apps/system/usbmonitor</code> that provides a convenient way to get debug trace output.
|
||||
If tracing is enabled, the USB device will save encoded trace output in in-memory buffer;
|
||||
if the USB monitor is also enabled, that trace buffer will be periodically emptied and dumped to the
|
||||
system logging device (the serial console in most configurations).
|
||||
The following are some of the relevant configuration options:
|
||||
</p>
|
||||
<ul>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td colspan="2" align="left" valign="top" bgcolor="#e4e4e4">
|
||||
<i>Device Drivers -> USB Device Driver Support</i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_USBDEV_TRACE=y</code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Enable USB trace feature
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_USBDEV_TRACE_NRECORDS=<i>nnnn</i></code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Buffer <i>nnnn</i> records in memory.
|
||||
If you lose trace data, then you will need to increase the size of this buffer
|
||||
(or increase the rate at which the trace buffer is emptied).
|
||||
</td>
|
||||
</tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_USBDEV_TRACE_STRINGS=y</code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Optionally, convert trace ID numbers to strings.
|
||||
This feature may not be supported by all drivers.
|
||||
</td>
|
||||
<tr>
|
||||
<td colspan="2" align="left" valign="top" bgcolor="#e4e4e4">
|
||||
<i>Application Configuration -> NSH LIbrary</i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_NSH_USBDEV_TRACE=n</code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Make sure that any built-in tracing from NSH is disabled.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_NSH_ARCHINIT=y</code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Enable this option <i>only</i> if your board-specific logic has logic to automatically start the USB monitor.
|
||||
Otherwise the USB monitor can be started or stopped with the <code>usbmon_start</code> and <code>usbmon_stop</code> commands from the NSH console.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="left" valign="top" bgcolor="#e4e4e4">
|
||||
<i>Application Configuration -> System NSH Add-Ons</i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_USBMONITOR=y</code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Enable the USB monitor daemon
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_USBMONITOR_STACKSIZE=<i>nnnn</i></code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Sets the USB monitor daemon stack size to <i>nnnn</i>.
|
||||
The default is 2KiB.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_USBMONITOR_PRIORITY=50</code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Sets the USB monitor daemon priority to <i>nnnn</i>.
|
||||
This priority should be low so that it does not interfere with other operations, but not so low that you cannot dump the buffered USB data sufficiently rapidly.
|
||||
The default is 50.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_USBMONITOR_INTERVAL=<i>nnnn</i></code>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Dump the buffered USB data every <i>nnnn</i> seconds.
|
||||
If you lose buffered USB trace data, then dropping this value will help by increasing the rate at which the USB trace buffer is emptied.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30%" align="left" valign="top">
|
||||
<code>CONFIG_USBMONITOR_TRACEINIT=y</code><br>
|
||||
<code>CONFIG_USBMONITOR_TRACECLASS=y</code><br>
|
||||
<code>CONFIG_USBMONITOR_TRACETRANSFERS=y</code><br>
|
||||
<code>CONFIG_USBMONITOR_TRACECONTROLLER=y</code><br>
|
||||
<code>CONFIG_USBMONITOR_TRACEINTERRUPTS=y</code><br>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
Selects which USB event(s) that you want to be traced.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ul>
|
||||
<p>
|
||||
NOTE: If USB debug output is also enabled, both outputs will appear on the serial console.
|
||||
However, the debug output will be asynchronous with the trace output and, hence, difficult to interpret.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 3.1 KiB |
@@ -1,84 +0,0 @@
|
||||
body
|
||||
{
|
||||
background: none;
|
||||
font-family: sans-serif;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
a
|
||||
{
|
||||
color: #dd2f2f;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover
|
||||
{
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
code
|
||||
{
|
||||
font-family: "courier";
|
||||
color: #2b4893;
|
||||
background: #f4f4f4;
|
||||
padding-left: 0.25em;
|
||||
padding-right: 0.25em;
|
||||
}
|
||||
|
||||
pre
|
||||
{
|
||||
font-family: "courier";
|
||||
background: #f4f4f4;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.container
|
||||
{
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.toc
|
||||
{
|
||||
top: 0;
|
||||
left: 0;
|
||||
float: left;
|
||||
width: 22%;
|
||||
font-size: 80%;
|
||||
overflow-y: scroll;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.toc tbody
|
||||
{
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.toc .toc_table
|
||||
{
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.toc ul
|
||||
{
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
.toc > ul
|
||||
{
|
||||
padding-left: 1.0em;
|
||||
}
|
||||
|
||||
.toc h1
|
||||
{
|
||||
padding-left: 0.5em;
|
||||
padding-top: 0.5em;
|
||||
}
|
||||
|
||||
.main
|
||||
{
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
width: 75%;
|
||||
float: right;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 3.1 KiB |