USB serial update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2219 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
041200d562
commit
b7511eacdb
@ -332,48 +332,73 @@ examples/uip
|
|||||||
examples/usbserial
|
examples/usbserial
|
||||||
^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
This is another implementation of "Hello, World" but this one uses
|
TARGET CONFIGURATION:
|
||||||
a USB serial driver. Configuration options can be used to simply
|
|
||||||
the test. These options include:
|
|
||||||
|
|
||||||
CONFIG_EXAMPLES_USBSERIAL_INONLY
|
This is another implementation of "Hello, World" but this one uses
|
||||||
Only verify IN (device-to-host) data transfers. Default: both
|
a USB serial driver. Configuration options can be used to simply
|
||||||
CONFIG_EXAMPLES_USBSERIAL_OUTONLY
|
the test. These options include:
|
||||||
Only verify OUT (host-to-device) data transfers. Default: both
|
|
||||||
CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL
|
|
||||||
Send only small, single packet messages. Default: Send large and small.
|
|
||||||
CONFIG_EXAMPLES_USBSERIAL_ONLYBIG
|
|
||||||
Send only large, multi-packet messages. Default: Send large and small.
|
|
||||||
|
|
||||||
In additional to the target device-side example, there is also
|
CONFIG_EXAMPLES_USBSERIAL_INONLY
|
||||||
a host-side application in this directory. It can be compiled under
|
Only verify IN (device-to-host) data transfers. Default: both
|
||||||
Linux or Cygwin as follows:
|
CONFIG_EXAMPLES_USBSERIAL_OUTONLY
|
||||||
|
Only verify OUT (host-to-device) data transfers. Default: both
|
||||||
|
CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL
|
||||||
|
Send only small, single packet messages. Default: Send large and small.
|
||||||
|
CONFIG_EXAMPLES_USBSERIAL_ONLYBIG
|
||||||
|
Send only large, multi-packet messages. Default: Send large and small.
|
||||||
|
|
||||||
cd examples/usbserial
|
If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG and CONFIG_DEBUG_USB), then
|
||||||
make -f Makefile.host TOPDIR=../../.
|
the example code will also manage the USB trace output. The amount of trace output
|
||||||
|
can be controlled using:
|
||||||
|
|
||||||
This will generate a small program called 'host'. Usage:
|
CONFIG_EXAMPLES_USBSERIAL_TRACEINIT
|
||||||
|
Show initialization events
|
||||||
|
CONFIG_EXAMPLES_USBSERIAL_TRACECLASS
|
||||||
|
Show class driver events
|
||||||
|
CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS
|
||||||
|
Show data transfer events
|
||||||
|
CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER
|
||||||
|
Show controller events
|
||||||
|
CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS
|
||||||
|
Show interrupt-related events.
|
||||||
|
|
||||||
1. Build the examples/usbserial target program and start the target.
|
Error results are always shown in the trace output
|
||||||
|
|
||||||
2. Wait a bit, then do enter:
|
HOST-SIDE TEST PROGRAM
|
||||||
|
|
||||||
dmesg
|
In additional to the target device-side example, there is also a
|
||||||
|
host-side application in this directory. This host side application
|
||||||
|
must be executed on a Linux host in order to perform the USBSERIAL
|
||||||
|
test. The host application can be compiled under Linux (or Cygwin?)
|
||||||
|
as follows:
|
||||||
|
|
||||||
At the end of the dmesg output, you should see the serial
|
cd examples/usbserial
|
||||||
device was successfully idenfied and assigned to a tty device,
|
make -f Makefile.host TOPDIR=../../.
|
||||||
probably /dev/ttyUSB0.
|
|
||||||
|
|
||||||
3. Then start the host application:
|
RUNNING THE TEST
|
||||||
|
|
||||||
./host [<tty-dev>]
|
This will generate a small program called 'host'. Usage:
|
||||||
|
|
||||||
Where:
|
1. Build the examples/usbserial target program and start the target.
|
||||||
|
|
||||||
<tty-dev> is the USB TTY device to use. The default is /dev/ttyUSB0.
|
2. Wait a bit, then do enter:
|
||||||
|
|
||||||
The host and target will exchange are variety of very small and very large
|
dmesg
|
||||||
serial messages.
|
|
||||||
|
At the end of the dmesg output, you should see the serial
|
||||||
|
device was successfully idenfied and assigned to a tty device,
|
||||||
|
probably /dev/ttyUSB0.
|
||||||
|
|
||||||
|
3. Then start the host application:
|
||||||
|
|
||||||
|
./host [<tty-dev>]
|
||||||
|
|
||||||
|
Where:
|
||||||
|
|
||||||
|
<tty-dev> is the USB TTY device to use. The default is /dev/ttyUSB0.
|
||||||
|
|
||||||
|
The host and target will exchange are variety of very small and very large
|
||||||
|
serial messages.
|
||||||
|
|
||||||
examples/usbstorage
|
examples/usbstorage
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -159,7 +159,7 @@ static void show_usage(const char *progname, int exitcode)
|
|||||||
int main(int argc, char **argv, char **envp)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
struct termios tty;
|
struct termios tty;
|
||||||
#ifndef CONFIG_EXAMPLES_USBSERIAL_INONLY
|
#ifndef CONFIG_EXAMPLES_USBSERIAL_OUTONLY
|
||||||
ssize_t nbytes;
|
ssize_t nbytes;
|
||||||
#endif
|
#endif
|
||||||
#ifdef COUNTER_NEEDED
|
#ifdef COUNTER_NEEDED
|
||||||
|
Loading…
Reference in New Issue
Block a user