Hi Ravi, As per my understanding, the CRC compression will always happen for 64-bit data only. If you want to calculate CRC for 0x00, 0x01 and 0x02 then you should need to give 0x00000000 00000000, 0x0000000000000001 and 0x0000000000000002. So, you can write your code something as below: #include "HL_crc.h" uint64_t Data_Buffer[10] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x07, 0x08, 0x90, 0x12, 0x13}; uint8_t CRC_Completion_Flag = 0; crcConfig_t sCrcParams; uint64_t compressed_crc; int main(void) { crcInit(); Data_Initialization(); sCrcParams.crc_channel = CRC_CH1; sCrcParams.mode = CRC_FULL_CPU; sCrcParams.pcount = 0u; sCrcParams.scount = 0u; sCrcParams.wdg_preload = 0u; sCrcParams.block_preload = 0u; crcChannelReset(crcREG1, CRC_CH1); crcSetConfig(crcREG1, &sCrcParams); deneme.mode = CRC_FULL_CPU; deneme.crc_channel = CRC_CH1; deneme.src_data_pat = Data_Buffer; deneme.data_length = 10; crcSignGen(crcREG1, &deneme); compressed_crc = crcGetPSASig(crcREG1, CRC_CH1);/*Reading the compressed CRC from the CRC module*/ compressed_crc = swap_high32_with_low32(compressed_crc); /*Due to bug in crcGetPSASig the received CRC need to swap again* while(1); return 0; } You no need to mention higher bytes and it will consider higher bytes as all zeros as we declare the array size with 64-bit. -- Thanks & regards, Jagadish.
↧