VxWorks BSP Developer's Reference : VxWorks BSP Validation Test Suite

serial

NAME

serial - serial I/O tests

SYNOPSIS

bspVal options serial

DESCRIPTION

This test verifies serial driver functionality under adverse conditions. See bspVal.sh for an explanation of options. The entire test can take several minutes to run.

NOTE: This reference entry lists the most likely reasons for a test's failure. However, it does not list all possible reasons.
The first test stresses the serial console port by having a target function repeatedly send output to the console, tty, while input is coming in from the host. The test checks that the target does not hang and that all the input sent was received intact by the target. This test is run at the highest baud rate supported by both host and target. If this test fails, check the serial connection. The serial driver's receive and transmit facilities must be stable and functioning properly. Generally, the driver should handle the receive interrupts before servicing transmit interrupts if both events are handled by the same ISR.

The second test also stresses the serial console port. The pkConsoleEcho( ) routine puts the console port in echo mode, where all characters sent by the host are immediately echoed. The test makes sure that every character sent to the console is received back by the host in the correct order and quantity. This test is run at the highest baud rate supported by both host and target. If this test fails, check for any possible interrupt race conditions in the serial driver.

The next two tests require that all free serial ports (other than the ttys used for the console and SLIP) be connected to run in loopback mode. This can usually be accomplished by running a jumper wire from the transmit/output line to the receive/input line. It might also be necessary to run a jumper from the RTS to the CTS line for ports with hardware handshaking.

The third test spawns a single pkLoopbackTest( ) task for each serial port connected in loopback mode. Each port sees a pattern of sequential characters sent and received at the maximum baud rate. All characters must be received in the order sent. If this test fails, check that all serial ports under test are set up correctly for loopback mode. Make sure that the serial driver is handling receive and transmit interrupts properly. Make sure that all serial channels under test have been configured and initialized to the correct values.

The fourth test spawns several pkLoopbackTest( ) tasks for each serial port connected in loopback mode. Each task repeatedly sends a particular character to one of the ports. There are several tasks for each serial port under test. Each port should receive all the characters that were sent. If this test fails, check the same problem areas suggested for the third test.

The third and fourth tests spawn one or more pkLoopbackTest( ) tasks for each serial device connected in loopback mode. These tasks run concurrently, sending and receiving characters at the highest baud rate supported by both host and target. It is possible that target boards with slower CPUs and many serial devices might not possess the raw processing power required to keep up with the tests. If hardware limitations are causing the loopback tests to fail, the tests can be configured to lighten the processor load. The serial.tcl tests run at the highest baud specified in the bspVal macro, BSPTEST_HOST_RATES (provided that the rate is supported by both the host and target).

Modifying BSPTEST_HOST_RATES to exclude the higher common baud rates will cause the tests to run at a lower rate, thus avoiding possible hardware- related problems. Additionally, the pkLib.c constant PK_LOOP_TASK_NUM can be changed from the default value of 4 to decrease the number of concurrent tasks running in the fourth test. In this case, the object code file pkLib.o must be rebuilt from the changed pkLib.c source file.

Target boards with several serial devices and a small amount of local RAM (1Mbyte or under) might run out of memory while executing the tests. In this case, either configure the target to use an external memory card or decrease the number of tasks running as described above.

If the test script execution ends prematurely, the target board might be left set to a baud rate other than T1_TIP_BAUD. This situation could leave the board in such a state that a power cycle reset would be necessary to continue with other tests.

Barring serious hardware or software limitations (such as an identifiable VxWorks problem), the target board must pass all tests for the BSP to be validated.

CONFIGURATION PARAMETERS

BSPTEST_HOST_RATES 25
Baud rates supported on host. (required)
T1_SER_DEVICE
Serial device to be used on host. (required)
T1_SER_BAUD
Default serial baud rate to be used. (required)

EXAMPLE

Output consists of:

                         BSP VALIDATION TEST
                         -------------------

    Target server                     : t53-160
    BSP                               : mv147
    Log file                          : /tmp/bspValidationLog.5219



    Serial Test :
    console I/O test                                          : PASS
    console echo test                                         : PASS
    sequential loopback test                                  : PASS
    multiple loopback test                                    : PASS

                      Tests RUN           4
                      Tests PASSED        4
                      Tests FAILED        0
                      Tests SKIPPED       0

SEE ALSO

bspVal.sh, bspPkCommonProc.tcl, envLib.tcl, serLib.tcl, pkLib.c