VxWorks BSP Developer's Reference : VxWorks BSP Validation Test Suite
auxClock - auxiliary clock tests
bspVal options auxClock
This test verifies the functionality of the auxiliary clock for the BSP. Its run-time is seven to ten minutes. See bspVal.sh for an explanation of options.
The tests within this script connect a routine to the auxiliary clock interrupt handler using the sysAuxClkConnect( ) routine. This disconnects any routine previously connected to the auxiliary clock ISR by the BSP.
In order to run this test, the target has to be configured with auxiliary clock. To do this, add INCLUDE_AUXCLK to config.h file of the BSP or include the component INCLUDE_AUX_CLK, if using project facility.
Tests 1 through 4 check the accuracy of the auxiliary clock at several frequencies: an optional extra rate, minimum, maximum, and the default rate, respectively. To measure the rate of the auxiliary clock, a simple callback routine is connected to the auxiliary clock ISR using sysAuxClkConnect( ). This callback routine increments a counter on every clock tick. The counter is then cleared, and the auxiliary clock is enabled at the rate being tested. The counter is read after 10 seconds and again after 130 seconds. The counter values are used to calculate the average interrupt rate of the auxiliary clock. Three measurements are taken to cancel the fixed portion of measurement latency error. The computed clock rate error is reported with one percent resolution. If the measured clock rate is more than 10 percent off the value being tested, the test for that rate fails.
NOTE: This reference entry lists the most likely reasons for a test's failure. However, it does not list all possible reasons. If any of these tests fail, check that the timer chip is properly initialized and is programmed with an appropriate scaling factor, if necessary. Interrupts should be enabled in sysAuxClkEnable( ) before the timer is started. Check that the sysAuxClkRoutine is getting connected by sysAuxClkConnect( ), and that the sysAuxClkRoutine( ) is being called on every auxiliary clock interrupt.
The fifth test verifies the operation of sysAuxClkDisable( ). This is done by periodically checking the same counter incremented by the first four tests. After sysAuxClkDisable( ) is called, this counter should not continue to increment. If this test fails, check that the sysAuxClkDisable( ) routine is disabling timer interrupts, turning off the timer, and setting the running flag to FALSE.
The sixth test performs parameter checking of the sysAuxClkRateSet( ) routine. This test checks that the proper return value is given for erroneous input parameters. If this test fails, check that sysAuxClkRateSet( ) performs error checking based on the AUX_CLK_RATE_MIN and AUX_CLK_RATE_MAX macros.
The seventh test checks the return values of the sysAuxClkRateSet( ) and sysAuxClkRateGet( ) routines when first passed valid rates followed by erroneous rates. If this test fails, check that sysAuxClkRateSet( ) is setting the global rate variable, and that sysAuxClkRateGet( ) is reading the same variable.
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.
- T1_EXTRA_AUXCLK 25
- Another rate to test (optional).
Output consists of:
BSP VALIDATION TEST ------------------- Target server : t53-160 BSP : mv147 Log file : /tmp/bspValidationLog.5219 Auxiliary Clock Test : auxClk at 4321 hertz (rate = 4325 error = 0%) : PASS auxClk at 3 hertz (rate = 3 error = 0%) : PASS auxClk at 5000 hertz (rate = 5002 error = 0%) : PASS auxClk at 60 hertz (rate = 60 error = 0%) : PASS sysAuxClkDisable() disables auxClk : PASS sysAuxClkRateSet() parameter checking : PASS sysAuxClkRateGet() return value : PASS Tests RUN 7 Tests PASSED 7 Tests FAILED 0 Tests SKIPPED 0
bspVal.sh, cloclkLib.tcl, bspPkCommonProc.tcl, envLib.tcl, pkLib.c