mask output data checksum to 2 bytes#136
Merged
ThomasAkam merged 1 commit intopyControl:masterfrom Feb 24, 2025
Merged
Conversation
Collaborator
|
Thanks Andy! |
IsabelDAlessandro
pushed a commit
to IsabelDAlessandro/pycontrol_code
that referenced
this pull request
Jan 21, 2026
Fixes error that occurs with Micropython version 1.24 if the checksum value for messages is greater than 2 bytes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I ran into an error after upgrading to Micropython v1.24
One of our tasks has many variables, and as a consequence the "content" of the variable run_start message is very long:
This long message has a checksum value that is greater than 2 bytes. Previously, the
to_bytes(2, "little")would only convert the lower 2 bytes, but after the upgrade, I was getting the following error:In version 1.24 release notes it's noted that there are now buffer size checks
The small change in this commit prevents the error by masking everything off but the last 2 bytes for the checksum. The computer side code that is receiving the serial message is already using a similar mask when checking the checksum:
code/source/communication/pycboard.py
Line 488 in c5b6999