Logo
MSP430IEC60730SWPackage
Crc_test_api

Functions

uint8_t IEC60730_CRC_TEST_testNvMemory (uint16_t *pStartAddress, uint16_t memorySize, uint16_t *pExpectedCrc)
 

Detailed Description

Function Documentation

uint8_t IEC60730_CRC_TEST_testNvMemory ( uint16_t *  pStartAddress,
uint16_t  memorySize,
uint16_t *  pExpectedCrc 
)

Tests invariable (non volatile) memory (FLASH)

Parameters
*pStartAddressis a pointer the start address of memory to be tested
memorySizesize of memory to be tested
*pExpectedCrcis a pointer to the expected CRC value

The following function check for memory corruption in non volatile memory. The user must first calculate the CRC value of the memory to be checked. This can be achieved by using the CRC_tool which is included in the utils folders of the library. To learn how to use the CRC_tool please consult the IEC60730 Class B API User's Guide. When the CRC value is obtain, the user must store the CRC value in FLASH before calling the function. The memorySize paramater is specified in 16 bit words and should not exceed 65535 16 bit words. The expectedCrc value is compared to the newly calculated CRC value. The test passes if the two CRC values are identical.

NOTE: memorySize should be even an value, otherwise the the test fails.

Returns
SIG_NV_MEM_CRC_TEST.- if expected CRC and calculated CRC are identical. TEST_FAILED. - if non volatile test fail and JUMP_TO_FAILSAFE is disabled in "IEC60730_user_config.h".