VxWorks BSP Developer's Reference : VxWorks BSP Validation Test Suite
nvRam - non-volatile RAM tests
bspVal options nvRam
This test verifies sysNvRamGet( ) and sysNvRamSet( ), the sysLib.c routines that manipulate non-volatile memory. See bspVal.sh for an explanation of options.
On targets without non-volatile RAM, NV_RAM_SIZE should be set to NONE (-1) in the BSP. On such boards, only parameter checking of sysNvRamSet( ) and sysNvRamGet( ) is performed. If only a portion of NVRAM is writable, or some amount is reserved for hardware operations, be sure to specify the writable size with the NV_RAM_SIZE_WRITEABLE macro in config.h.
NOTE: This reference entry lists the most likely reasons for a test's failure. However, it does not list all possible reasons. The execution time of the tests run by this script is dependent on the size of NVRAM being tested and the CPU speed. The entire test script should not take more than a few minutes to run to completion.
This script merely calls pkTestNvRam( ) eight times to perform different non-volatile RAM functionality tests.
The first test verifies the operation of a sysNvRamGet( ) read of NV_RAM_SIZE bytes. If this test fails, check that NV_RAM_SIZE is set to the size of NVRAM and that NV_BOOT_OFFSET is defined and used properly. Also check that sysNvRamGet( ) is copying the entire length requested from NVRAM into the passed-in buffer.
The second test reads, writes, and reads NV_RAM_SIZE bytes of NVRAM to check sysNvRamSet( ) functionality. If this test fails, check the same problem areas as the first test. Also check that sysNvRamSet( ) is copying the entire length requested from the passed-in buffer into NVRAM.
The third test checks the operation of a sysNvRamGet( ) read of zero bytes. If this test fails, check that reads of zero length are allowed by sysNvRamGet( ). The buffer should be properly terminated with EOS, and the routine should return OK.
The fourth test performs parameter checking of sysNvRamSet( ). This test checks that the proper return value is given for erroneous input parameters. If this test fails, check that error checking is provided by sysNvRamSet( ), which should return ERROR for a negative offset or a length parameter. Also, the value of the offset plus length parameters must be less than NV_RAM_SIZE.
The fifth test performs parameter checking of sysNvRamGet( ). This test checks that the proper return value is given for erroneous input parameters. If this test fails, check that error checking is provided by sysNvRamGet( ), which should return ERROR for a negative offset or length parameter. Also, the value of the offset plus length parameters must be less than NV_RAM_SIZE.
The sixth test writes several bytes of data (0xff), then reads back from the same NVRAM location. This operation checks that the same data is read back, and that the buffer is returned with a NULL termination. If this test fails, check that writing 0xff to NVRAM does not cause a problem and that the passed-in buffer is properly terminated with EOS.
The seventh test writes several bytes of data (0x00), then reads back from the same NVRAM location. This operation checks that the same data is read back, and that the buffer is returned with a NULL termination. If this test fails, check that writing 0x00 to NVRAM does not cause a problem and that the passed-in buffer is properly terminated with EOS.
The eighth test returns NV_RAM_SIZE bytes of NVRAM back to the values read in the first test. If this test fails, check that NV_RAM_SIZE bytes of NVRAM can be written and read with sysNvRamSet( ) and sysNvRamGet( ).
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.
None.
Output consists of:
BSP VALIDATION TEST ------------------- Target server : t53-160 BSP : mv147 Log file : /tmp/bspValidationLog.5219 Non-Volatile RAM Test : sysNvRamGet() of boot line : PASS sysNvRamSet() and sysNvRamGet() of complemented bootline : PASS sysNvRamGet() with length zero : PASS sysNvRamSet() parameter checking : PASS sysNvRamGet() parameter checking : PASS sysNvRamSet() and sysNvRamGet() of 0xff data : PASS sysNvRamSet() and sysNvRamGet() of 0x00 data : PASS sysNvRamSet() and sysNvRamGet() of boot line : PASS Tests RUN 8 Tests PASSED 8 Tests FAILED 0 Tests SKIPPED 0
bspVal.sh, bspPkCommonProc.tcl, pkLib.c