Announcements

Equip yourself to optimize AURIX™ MCUs for Evs at the EV Webinar. Click here to register.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

AURIX™ Forum Discussions

zhouyi_NJ
Level 2
Level 2
10 replies posted 25 sign-ins First solution authored

Hi, Infineon Experts:

My code is based on the Github example
https://github.com/Infineon/AURIX_code_examples/tree/master/code_examples/FCE_CRC_1_KIT_TC397_TFT
The only difference is FCE ISR is not used in my code, but it should have no impact for my question.


The question is for iLLD API function IfxFce_Crc_calculateCrc(): how to set the input parameter crcData
Its prototype is:
uint32 IfxFce_Crc_calculateCrc(IfxFce_Crc_Crc *fce, const uint32 *crcData, uint16 crcDataLength, uint32 crcStartValue)

The  question detail is:  how to set the data type of parameter crcData, when I want to calculate crc8 or crc16?

Data type of crcData is uint32 *if the buffer to be calculated CRC8 is uint8 dataBuf[4] = {0x11, 0x22, 0x33, 0x44}
The uint8 dataBuf  is used as input parameter = crcData, will the data 0x11, 0x22, 0x33 be ignored (not calculated)?
It seems for uint32 type, 0x11223344 is a single uint32 data, and only bit0~bit7 will be kept
Or I must set the dataBuf to uint32 type?

And according the iLLD document and Aurix User manual, parameter is the length depends on kernel polynomial width.
So the parameter crcDataLength should be 4

thanks and BR

ZhouYi

0 Likes
1 Solution
zhouyi_NJ
Level 2
Level 2
10 replies posted 25 sign-ins First solution authored

Hi, dw:

thank you. 

I've tested with different data type (uint8 and uint32) buffer for FCE CRC8 calculation. 

The test result also proves your comment:

uint32 type buffer shall be used for CRC8 calculation, only the LSB is used. 

thanks and BR

Zhou Yi

View solution in original post

0 Likes
2 Replies
dw
Moderator
Moderator
Moderator
100 likes received 750 replies posted 10 likes given

Hi ZY,

The LSB is used for 16- or 8- bit input value.

dw_0-1672731363072.png

 

0 Likes
zhouyi_NJ
Level 2
Level 2
10 replies posted 25 sign-ins First solution authored

Hi, dw:

thank you. 

I've tested with different data type (uint8 and uint32) buffer for FCE CRC8 calculation. 

The test result also proves your comment:

uint32 type buffer shall be used for CRC8 calculation, only the LSB is used. 

thanks and BR

Zhou Yi

0 Likes