CAN Checksum Algorithm

I am having issues with a checksum from a CAN message.
Normally this is a simple XOR of all bytes but it does not work for this message.
The last byte is the checksum.

When i XOR
8C 04 00 00 80 20 00 XOR checksum is 0x28 but on my data it is 0x4F

8C 04 00 00 80 00 00 6F
8C 04 00 00 80 10 00 5F
8C 04 00 00 80 20 00 4F
8C 04 00 00 80 30 00 3F
8C 04 00 00 80 40 00 2F
8C 04 00 00 80 50 00 1F
8C 04 00 00 80 60 00 0F
8C 04 00 00 80 70 00 FF
8C 04 00 00 80 80 00 EF
8C 04 00 00 80 90 00 DF
8C 04 00 00 80 A0 00 CF
8C 04 00 00 80 B0 00 BF
8C 04 00 00 80 C0 00 AF
8C 04 00 00 80 D0 00 9F
8C 04 00 00 80 E0 00 8F
8C 04 00 00 80 F0 00 7F
8C 04 00 00 80 00 00 6F
B0 04 00 00 80 10 00 3B
B0 04 00 00 80 20 00 2B
B0 04 00 00 80 30 00 1B
B0 04 00 00 80 40 00 0B
B0 04 00 00 80 50 00 FB
D0 04 54 01 80 60 00 76
D0 04 54 01 80 70 00 66
D0 04 54 01 80 80 00 56
D0 04 54 01 80 90 00 46
D0 04 54 01 80 A0 00 36
D0 04 54 01 80 B0 00 26
F4 04 AC 02 80 C0 00 99
F4 04 AC 02 80 D0 00 89
F4 04 AC 02 80 E0 00 79
F4 04 AC 02 80 F0 00 69
F4 04 54 01 80 00 00 B2
F4 04 54 01 80 10 00 A2

  • Why would you ever use some hobbyist checksum like this when CAN frames already come with built-in CRC-15? What is the problem you are trying to solve by adding an extra subpar checksum?

    – 

  • This is used by Volkswagen on their can protocol. Need to reproduce the data and so the checksum must be correct for other modules to accept the data.

    – 

  • That makes me afraid of cars yet again. But anyway, in that case you would have the actual algorithm available, yeah? There are many different ways which we can form hobbyist checksums pre-dating CRC. Sum of all bytes truncated to one byte, sum of all bytes truncated then bitwise inverse (very common), bitwise XOR, count the number of ones “parity”. Etc etc. Notably, all of these are completely unprofessional and unsafe – they are not CRC-8.

    – 




  • CRC-8 ist not “XOR of all bytes”

    – 

  • I have the algorithm of other messages which is just a simple XOR of all bytes. For this message it is not working so it seems the another algorithm which i need to find. this is used by VW in all their cars probably unprofessional and unsafe if you say so. i need to find the algorithm for this message any pointers are appreciated.

    – 




Leave a Comment