How to Calculate FlexRay Header CRC

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

How to Calculate FlexRay Header CRC

4,010 次查看
yusun
Contributor I

Hi everyone,

 

We are using MC9S12XF512 to build a FlexRay application. However, we cannot figure out how the Header CRC configured for each message buffer is calculated.

 

The official FlexRay does give an algorighm, but it looks like that the actual implementation in MC9S12XF512 is different. Because we tried to use that algorithm to calculate the Header CRC, but the result is different from the value given in the sample applications.

 

Any advice?

 

Thanks a lot.

 

Yu

标签 (1)
0 项奖励
3 回复数

2,163 次查看
bobgardner
Contributor I

The Flexray_CC.c module in the NVC7383 demo code has the header crc calc function in it.

0 项奖励

2,163 次查看
kwridan
Contributor I

Hi,


The FlexRay protocol specs document (can be obtained from www.flexray.com) contains the algorithm, for the header CRC remember to have the inital values as:

vCrcSize=11;
vCrcInit=[0 0 0 0 0 0 1 1 0 1 0];
vData=[1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0];
vCrcPolynomial=[0 1 1 1 0 0 0 0 1 0 1];


vData as you know is

   1 bit          1 bit        11bits      7bits
[syncFrameBit,startUpFrameBit,frameID,payloadLength]


I found that the CRC result in the end was the other way around (LSB was on the left!)


Good luck!

Kassem

0 项奖励

2,163 次查看
admin
Specialist II
I found that the CRC result in the end was the other way around (LSB was on the left!)

That's because vData have LSB left, i.e. SY bit is LSB.

0 项奖励