3.15.19 diag_flash_crc16_direct.c File Reference

This file contains APIs to test FLASH using CRC16 CCITT Direct Computation algorithm.

Includes

  1. diag_flash_crc16.h
  2. ../../../diag_common/config/diag_config.h
  3. string.h
  4. xc.h

Functions

Table 3-39. diag_crc_status_tDIAG_FLASH_CalculateCRC16 (uint16_t startAddress, uint16_t length, uint16_t *crcSeed)
Parameters

[in] startAddress

uint16_t

- starting address of FLASH memory region to be considered for CRC

[in] length

uint16_t

- number of bytes from startAddress to be considered for CRC

[in, out] crcSeed

uint16_t *

- pointer to initial and final CRC

Returns
diag_crc_status_t CRC_OK, CRC_ERROR, CRC_INVALID_ADDRESS, CRC_INVALID_LENGTH
Table 3-40. diag_crc_status_tDIAG_FLASH_CalculateStoreCRC16 (uint16_t startAddress, uint16_t length, uint16_t storeAddress)
Parameters

[in] startAddress

uint16_t

- starting address of FLASH memory region to be considered for CRC

[in] length

uint16_t

- number of bytes from startAddress to be considered for CRC

[in] storeAddress

uint16_t

- the FLASH address where calculated CRC will be stored

Returns
diag_crc_status_t CRC_OK, CRC_ERROR, CRC_INVALID_ADDRESS, CRC_INVALID_LENGTH
Table 3-41. diag_crc_status_tDIAG_FLASH_ValidateCRC16 (uint16_t startAddress, uint16_t length, uint16_t refAddress)
Parameters

[in] startAddress

uint16_t

- starting address of FLASH memory region to be considered for CRC

[in] length

uint16_t

- number of bytes from startAddress to be considered for CRC

[in] refAddress

uint16_t

- the FLASH address where reference CRC is available

Returns
diag_crc_status_t CRC_OK, CRC_ERROR, CRC_INVALID_ADDRESS, CRC_INVALID_LENGTH