S32DS CRC 8 calculation

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

S32DS CRC 8 calculation

2,248 Views
satish_k_singh
Contributor III

Hello,

Currently I am working with the S32DS on the S32K148 EVAL board . The MCU has in built hard ware accelerator to calculate the CRC which is 32bits and 16 bits respectively.

Could you please let know how can I make use of the same to calculate 8 bit CRC with given seed and polynomial.

Thanks and best regards!!!

Satish Kumar

2 Replies

2,000 Views
tim_povall
Contributor II

I am a year late to this question, but 8-bit CRC actually is possible with a 16 or 32-bit CRC module.

You can convert the 8-bit polynomial into 16-bit by shifting 8 bits to the left, and then to get a 8-bit result do the same to the resulting 16-bit CRC.

For example, lets say I want to do CRC on the following ascii: '123456789', and my polynomial is 0xD5 (binary: 1101 0101). My resulting 8-bit CRC, with a seed value of 0x00, should be 0xBC (binary 1011 1100‬).

I am using a Freedom KEAZ64 board, which has a 16-bit CRC module. I shift my polynomial 8-bits to the left, which gives me 0xD500 (binary: 1101 0101 0000 0000). On the same ascii data, the 16-bit CRC outputs 0xBC00 (binary 1011 1100 0000 0000), so all we need to do is shift the result 8 bits to the right to get the correct result: 0xBC

I hope this is useful for anyone who happens to find this question,

Tim

2,000 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

because this is not supported by hardware CRC module, the only way is to use SW calculation.

You can find some SW examples on the web. First one I found on google:

c - Calculating a simple CRC - Electrical Engineering Stack Exchange 

Hope this helps.

Regards,

Lukas