cembeddedcan-busbusautomotive

Is CRC already calculated by CAN protocol?


I am in a project and I have to comply with ISO26262 so I need to verify my CAN frame. I am going to check my frame using the CRC calculation. My question is: Should I do this calculation in my program or does the CAN protocol already do it automatically?


Solution

  • Actually, you might not just rely on the CAN CRC itself in the case of ISO26262.

    Because, the E2E protection (as it is called in AUTOSAR) consisting of CRC + SeqCounter, are done between two SWCs, in an ASIL-context.

    The BSW is usually not ASIL. So, between the SWC providing the data to the BSW, and the receiving SWC checking the CRC, anything could happen in between. So, your BSW could put some flipped data into the CAN HW mailbox. The CAN HW will then build the wrong CRC when transmitting that data. Or the receiver might have a bug and flip the received data between the CAN mailbox and the actual receiving SWC end.