Skip to content

Wrong CRC implementation? #156

@decontamin4t0R

Description

@decontamin4t0R

Hello,

after testing the block transfer, it seems like the CRC-Checksum is calculated in a wrong way.
You use crc_hqx for calculating the checksum, which uses x16 + x12 + x5 + 1 as the polynom. However, in my CiA 301 specification, in section 9.2.2.2.16, the polynom is x^16 + x^15 + x^5 + 1... This complete CRC stuff is pretty messy. If you would want a true CRC-CCITT implementation, you would need to initialize _crc with 0xFFFF and not 0.
My "bought" CAN-Nodes to which I communicate all use the CRC-16-ARC (as on https://crccalc.com/)...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions