S32K3 The CRC32 count results are consistent

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K3 The CRC32 count results are consistent

跳至解决方案
133 次查看
wuxianlong
Contributor III

Hi,All


I have a problem and need help. The CRC32 count results are consistent.

I use the CRC32 algorithm to calculate {0x12, 0x34, 0x56, 0x78} and get the correct result 0x4A090E98.

The second time we use this algorithm to get the wrong result, 0x94b22e7b.

The only difference between the two calls is that the function Crc_Ip_SetChannelCalculate needs to fill in the parameter IsFirstCall, which is FALSE when I do it the second time.
What is the reason for this? Is there anything to pay attention to in this parameter "IsFirstCall"? There is nothing wrong with me using the CRC32_MPEG_2 algorithm.
wuxianlong_2-1717557104486.png

wuxianlong_0-1717557031159.png

I use the software version RTD4.0.0 HF01, and the chip is S32K312

wuxianlong_1-1717557074604.png

Best Regards,
xianlong

0 项奖励
1 解答
104 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @wuxianlong 

All the times that you need to calculate the CRC from scratch it is necessary to define TRUE as the IsFirstCall parameter because when it is set to FALSE, the LocInitialSeedStartValue (Start value (seed Value) when the algorithm starts) will not be the StartValue you set when calling the function, thus causing the difference in the results. 

 

B.R.

VaneB

在原帖中查看解决方案

0 项奖励
2 回复数
105 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @wuxianlong 

All the times that you need to calculate the CRC from scratch it is necessary to define TRUE as the IsFirstCall parameter because when it is set to FALSE, the LocInitialSeedStartValue (Start value (seed Value) when the algorithm starts) will not be the StartValue you set when calling the function, thus causing the difference in the results. 

 

B.R.

VaneB

0 项奖励
100 次查看
wuxianlong
Contributor III

Hi,@VaneB 

Thank you very much, VaneB.

I have a doubt that every time I choose a channel to call an algorithm, I need to define "IsFirstCall" as TRUE.What is the application scenario for this parameter? When it needs to be defined as FALSE.

Best Regards,
xianlong

0 项奖励