How to Calculate FlexRay Header CRC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Calculate FlexRay Header CRC

4,508 Views
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

Labels (1)
0 Kudos
Reply
3 Replies

2,661 Views
bobgardner
Contributor I

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

0 Kudos
Reply

2,661 Views
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 Kudos
Reply

2,661 Views
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 Kudos
Reply