Transmit size, Receive size, Transmit and receive delays – Comtrol eCos User Manual

Page 725

Advertising
background image

Testing

Transmit Size

The next set of arguments can be used to control the size of the transmitted buffer:

txsize1

,

txsize

>

=

,

txsize

<

= txsize*

,

txsize/

, and

txsize+

.

txsize1

determines the size of the first transfer, and has a default value of 32 bytes. The size of the next transfer

is calculated by first multiplying by the

txsize*

value, then dividing by the

txsize/

value, and finally adding

the

txsize+

value. The defaults for these are

1

,

1

, and

0

respectively, which means that the transfer size will

remain unchanged. If for example the transfer size should increase by approximately 50 per cent each time then
suitable values might be

txsize* 3

,

txsize/ 2

, and

txsize+ 1

.

The

txsize

>

=

and

txsize

<

=

arguments can be used to impose lower and upper bounds on the transfer. By

default the

min_size

and

max_size

values appropriate for the endpoint will be used. If at any time the current

size falls outside the bounds then it will be normalized.

Receive Size

The receive size, in other words the number of bytes that either host or target will expect to receive as opposed to the
number of bytes that actually get sent, can be adjusted using a similar set of arguments:

rxsize1

,

rxsize

>

=

,

rxsize

<

=

,

rxsize*

,

rxsize/

and

rxsize+

. The current receive size will be adjusted between transfers just

like the transmit size. However when communicating over USB it is not a good idea to attempt to receive less data
than will actually be sent: typically neither the hardware nor the software will be able to do anything useful with
the excess, so there will be problems. Therefore if at any time the calculated receive size is less than the transmit
size, the actual receive will be for the exact number of bytes that will get transmitted. However this will not affect
the calculations for the next receive size.

The default values for

rxsize1

,

rxsize*

,

rxsize/

and

rxsize+

are

0

,

1

,

1

and

0

respectively. This means

that the calculated receive size will always be less than the transmit size, so the receive operation will be for the
exact number of bytes transmitted. For some USB protocols this would not accurately reflect the traffic that will
happen. For example with USB-ethernet transfer sizes will vary between 16 and 1516 bytes, so the receiver will
always expect up to 1516 bytes. This can be achieved using

rxsize1 1516

, leaving the other parameters at their

default values.

For target hardware which involves non-zero

max_in_padding

, on the host side the padding will be added auto-

matically to the receive size if necessary.

Transmit and Receive Delays

Typically during the testing there will be some minor delays between transfers on both host and target. Some of
these delays will be caused by timeslicing, for example another process running on the host, or a concurrent test
thread running inside the target. Other delays will be caused by the USB bus itself, for example activity from
another device on the bus. However it is desirable that test cases be allowed to inject additional and somewhat
more controlled delays into the system, for example to make sure that the target behaves correctly even if the target
is not yet ready to receive data from the host.

The transmit delay is controlled by six parameters:

txdelay1

,

txdelay*

,

txdelay/

,

txdelay+

,

txdelay

>

=

and

txdelay

<

=

. The default values for these are

0

,

1

,

1

,

0

,

0

and

1000000000

respectively, so

that by default transmits will happen as quickly as possible. Delays are measured in nanoseconds, so a value of

1000000

would correspond to a delay of 0.001 seconds or one millisecond. By default delays have an upper

bound of one second. Between transfers the transmit delay is updated in much the same was as the transfer sizes.

621

Advertising