Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRC16 calculation options #74

Open
THQ-WIFA opened this issue Jul 30, 2024 · 0 comments
Open

CRC16 calculation options #74

THQ-WIFA opened this issue Jul 30, 2024 · 0 comments

Comments

@THQ-WIFA
Copy link

The CRC16 calculation options are insufficient and hard to understand:

  • There is no explicit option to control the initial value. There is an implicit way to control it by selecting the named option -CCITT or -XMODEM and then override the polynomial with -POLY.
  • The implementation comments in crc16.cc refer to the CRC16 algorithm descriptions as proposed in the famous painless giude to CRC: Name, Width, Poly, Init, RefIn, RefOut, XOrOut, Check. But apparently, you can't control all of them, and/or the naming is inconsistent.
    • In fact, it seems you can't find a combination that creates MODBUS-style CRCs. I tried all 12 combinations of the Parameters {-CCITT|-XMODEM|-BROKEN}, {-AUGment|-No-AUGment}, {-Most_To_Least|-Least_To_Most} with -POLY ibm as indicated in srec_input.1.html, but none of the combinations got the correct result.

Proposal: Add options that control the parameters as named in the painless guide.

Useful resources:

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

No branches or pull requests

1 participant