Skip to content

Fix LIN checksum calculation#33

Merged
jsphuebner merged 1 commit into
jsphuebner:masterfrom
davefiddes:fix-lin-checksum
Aug 31, 2025
Merged

Fix LIN checksum calculation#33
jsphuebner merged 1 commit into
jsphuebner:masterfrom
davefiddes:fix-lin-checksum

Conversation

@davefiddes

Copy link
Copy Markdown
Contributor

There is a typo in the LIN checksum calculation that introduces a data dependency bug. According to
Section 2.3.1.5 Checksum of the LIN Protocol
Specification Revision 2.1 the checksum should
check if the value is greater than or equal to 256 before subtracting 255.

Add a set of unit tests with representative LIN data. Only TestSyntheticLinStatusResponse1() actually
exhibits the bug.

Tests:

There is a typo in the LIN checksum calculation that
introduces a data dependency bug. According to
Section 2.3.1.5 Checksum of the LIN Protocol
Specification Revision 2.1 the checksum should
check if the value is greater than or equal to 256
before subtracting 255.

Add a set of unit tests with representative LIN data.
Only TestSyntheticLinStatusResponse1() actually
exhibits the bug.

Tests:
 - Run new unit tests
 - Verify VWCoolantHeater simulator built with ESP32
   and https://github.com/gicking/LIN_slave_portable_Arduino
   communicates data reliably with ZombieVerter VCU
@jsphuebner
jsphuebner merged commit dd6589b into jsphuebner:master Aug 31, 2025
1 check passed
@jsphuebner

Copy link
Copy Markdown
Owner

Thanks Dave

@davefiddes
davefiddes deleted the fix-lin-checksum branch October 6, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants