Other types of transfer, Starting a test and collecting results, Existing test scripts – Comtrol eCos User Manual

Page 726

Advertising
background image

Testing

The receive delay is controlled by a similar set of six parameters:

rxdelay1

,

rxdelay*

,

rxdelay/

,

rxde-

lay+

,

rxdelay

>

=

and

rxdelay

<

=

. The default values for these are the same as for transmit delays.

The transmit delay is used on the side which sends data over the USB bus, so for a bulk IN transfer it is the target
that sends data and hence sleeps for the specified transmit delay, while the host receives data sleeps for the receive
delay. For an OUT transfer the positions are reversed.

It should be noted that although the delays are measured in nanoseconds, the actual delays will be much less precise
and are likely to be of the order of milliseconds. The exact details will depend on the kernel clock speed.

Other Types of Transfer

Support for testing other types of USB traffic such as isochronous transfers is not yet implemented.

Starting a Test and Collecting Results

A USB test script should prepare one or more transfers using appropriate functions such as

usbtest::bulktest

.

Once all the individual tests have been prepared they can be started by a call to

usbtest::start

. This takes a

single argument, a maximum duration measured in seconds. If all transfers have not been completed in the specified
time then any remaining transfers will be aborted.

usbtest::start

will return

1

if all the tests have succeeded, or

0

if any of them have failed. More detailed reports

will be stored in the Tcl variable

usbtests::results

, which will be a list of string messages.

Existing Test Scripts

A number of test scripts are provided as standard. These are located in the

host

subdirectory of the common

USB slave package, and will be installed as part of the process of building the host-side software. When a script
is specified on the command line usbhost will first search for it in the current directory, then in the install tree.
Standard test scripts include the following:

list.tcl

This script simply displays information about the capabilities of the target platform, as provided by the target-

side USB device driver. It can help with tracking down problems, but its primary purpose is to let users check
that everything is working correctly: if running usbhost list.tcl outputs sensible information then the user
knows that the target side is running correctly and that communication between host and target is possible.

verbose.tcl

The target-side code can provide information about what is happening while tests are prepared and run.

This facility should not normally be used since the extra I/O involved will significantly affect the behaviour
of the system, but in some circumstances it may prove useful. Since an eCos application cannot easily be
given command-line arguments the target-side verbosity level cannot be controlled using

-V

or

--verbose

options. Instead it can be controlled from inside gdb by changing the integer variable

verbose

. Alternatively

it can be manipulated by running the test script

verbose.tcl

. This script takes a single argument, the desired

verbosity level, which should be a small integer. For example, to disable target-side run-time logging the
command usbhost verbose 0 can be used.

622

Advertising