CANhack.de CAN-Interface RKS+CAN
CAN Hardware, CAN Software, CAN Protocols - CAN Bus Forum for Your CAN Bus Project.

CS Calculation Help: Get Your Answers Now!

 
New Topic Reply 🔗 🖨 CANhack.de - Index » General
Author Message
Jackson



Joined: 04/08/2019
Posts: 6
Karma: +1 / -0   Thank you, like it!


Premium Support

Post16-04-2019, 23:16    Subject: CS Calculation Help: Get Your Answers Now! Quote

Hello,

Does anyone have an idea how the CS (Customer Satisfaction) is calculated in the messages below?

Code:
15:55:07:0184 Rx 1 0x0A8 s 8 1D D0 7F 89 8C 64 00 00 .ЉŒd..
15:55:07:0286 Rx 1 0x0A8 s 8 67 D1 7F 89 8C 64 00 00 gщŒd..
15:55:07:0386 Rx 1 0x0A8 s 8 8B D2 7F 89 8C 64 00 00 ‹Ò‰Œd..
15:55:07:0486 Rx 1 0x0A8 s 8 64 D3 7F 89 8C 64 00 00 dÓ‰Œd..
15:55:07:0586 Rx 1 0x0A8 s 8 C8 D4 7F 89 8C 64 00 00 ÈÔ‰Œd..
15:55:07:0685 Rx 1 0x0A8 s 8 A2 D5 7F 89 8C 64 00 00 ¢Õ‰Œd..
15:55:07:0786 Rx 1 0x0A8 s 8 92 D6 7F 89 8C 64 00 00 ’Ö‰Œd..
15:55:07:0886 Rx 1 0x0A8 s 8 87 D7 7F 89 8C 64 00 00 ‡×‰Œd..
15:55:07:0984 Rx 1 0x0A8 s 8 A5 D8 7F 89 8C 64 00 00 ¥Ø‰Œd..
15:55:07:1089 Rx 1 0x0A8 s 8 D7 D9 7F 89 8C 64 00 00 ×Ù‰Œd..
15:55:07:1186 Rx 1 0x0A8 s 8 88 DA 7F 89 8C 64 00 00 ˆÚ‰Œd..
15:55:07:1285 Rx 1 0x0A8 s 8 45 DB 7F 89 8C 64 00 00 EÛ‰Œd..
15:55:07:1384 Rx 1 0x0A8 s 8 5B DC 7F 89 8C 64 00 00 [܉Œd..
15:55:07:1488 Rx 1 0x0A8 s 8 48 DD 7F 89 8C 64 00 00 H݉Œd..
15:55:07:1589 Rx 1 0x0A8 s 8 FA DE 7F 89 8C 64 00 00 úÞ‰Œd..
15:55:07:1685 Rx 1 0x0A8 s 8 75 DF 7F 89 8C 64 00 00 u߉Œd..
15:55:07:1784 Rx 1 0x0A8 s 8 1D D0 7F 89 8C 64 00 00 .ЉŒd..
15:55:07:1886 Rx 1 0x0A8 s 8 67 D1 7F 89 8C 64 00 00 gщŒd..
15:55:07:1986 Rx 1 0x0A8 s 8 8B D2 7F 89 8C 64 00 00 ‹Ò‰Œd..
15:55:07:2089 Rx 1 0x0A8 s 8 64 D3 7F 89 8C 64 00 00 dÓ‰Œd..


The CS (Chip Select) is located in byte 1, and the low nibble of byte 2 contains a counter. When the data is identical, the CS value is also the same. However, if you compare the CS values when the counter changes from 0 to 1, you'll see that they are significantly different, which indicates that a simple XOR operation doesn't apply. Even if you replace the CS with a 256-byte hash table, an XOR operation would not be appropriate, as demonstrated by:
Code:
RX 1 0x0A8 s 8 A2 DB DF 93 80 64 7C 09
RX 1 0x0A8 s 8 A2 DE FF 93 80 64 7A 09


Everyone has the A2, but they are technically completely different in terms of their core structure (CS).

Regards,
Jackson.


Translated on 07-08-2026, 20:40.
Back to top Profile PM
postmann
CAN-Profi
CAN-Profi


Joined: 05/23/2013
Posts: 142
Karma: +63 / -0   Thank you, like it!


CAN Support

CAN-Diagnose and Jackson likes this.
Post20-04-2019, 9:50    Subject: CS Calculation Help: Get Your Answers Now! Quote

Depending on the method used, it involves polynomial calculations with a variable starting value.

The SQC (counter) includes a table of initial values that serve as the starting polynomial. The procedure is defined in the AUTOSAR specification; search for "AUTOSAR E2E Protocol Profile 5".


Translated on 07-08-2026, 20:42.
Back to top Profile PM
Jackson



Joined: 04/08/2019
Posts: 6
Karma: +1 / -0   Thank you, like it!


Premium Support

Post13-05-2019, 0:44    Subject: CS Calculation Help: Get Your Answers Now! Quote

"@postman: According to the AUTOSAR E2E Protocol Profile 5, the CS (Communication State) would then be 16 bits and the counter would be 8 bits."

In my Audi Q7's log, the counter is only 4 bits wide, and the checksum (CS) is either 8 bits or 12 bits if you include the high nibble (HN) from byte 2.

Do you perhaps have any more tips for me on how to calculate the CS (Critical Section)?

Regards,
Jackson.


Translated on 07-08-2026, 20:43.
Back to top Profile PM
postmann
CAN-Profi
CAN-Profi


Joined: 05/23/2013
Posts: 142
Karma: +63 / -0   Thank you, like it!


CAN Support

CAN-Diagnose likes this.
Post13-05-2019, 20:43    Subject: CS Calculation Help: Get Your Answers Now! Quote

Okay, there are different CRC methods used in AUTOSAR. For example, Profile 11 only uses a 4-bit counter. However, it's also possible that the full length of the counter isn't utilized. Some manufacturers use Profile 5 with a 4-bit counter and associate 16 start polynomials with it.
The length of the SQC is only important for routing because packet data unit (PDU) routing counters can change from network to network. Therefore, a 4-bit SQC is sufficient. (unless you want to use a LIN with CRC).


Translated on 07-08-2026, 20:44.
Back to top Profile PM
New Topic Reply 🔗 🖨 CANhack.de - Index » General
Similar articles and topics
Topic Forum
No new posts CAN Bus Help: Troubleshooting & Support CANhack.de CAN-USB System: RKS+CAN
No new posts Help with directions CAN Software Tools and Software
No new posts newbee braucht hilfe CAN Bus General
No new posts Golf 5 Help: Beginner's Guide CAN Bus General
Jump to:  
You cannot post new topics in this forum.