Skip to content

2021 Rav4 Prime gets CAN Error even after the fingerprint is added (STEERING_LKA and PRE_COLLISION seems to have a different checksum scheme?) #2103

@nelsonjchen

Description

@nelsonjchen

Describe the bug

2021 Rav4 Prime gets CAN Error even after the fingerprint is added.

We've checked the setup against another Rav4 and the harness and C2 do not show the same error message and believe the hardware to be sound.

We get this error:

How to reproduce or log data

With a known-good Harness + C2 setup installed in the Rav4 Prime, checkout this branch on the C2: https://github.com/nelsonjchen/openpilot/tree/rav4_prime_fw @ commit 640ae8b

Start the Rav4 Prime.

Expected behavior

No CAN Error or CHECKSUM FAIL error in tmux.

Device/Version information (please complete the following information):

Additional context

I've been helping matty#8553 on Discord add support for his 2021 Rav4 Prime to openpilot. Many others and I thought this was as simple as adding the fingerprint for the TSS2 Rav4 Prime to OP. This turns out to not be the case.

After reproduction, we have SSH'd into the C2 and taken a look at tmux a, we see CHECKSUM FAIL spam:

Looking at Cabana, it seems that STEERING_LKA is now 8 bytes in size up from 5 bytes in the past and that PRE_COLLISION IS size 8 up from 7.

I took a look at STEERING_LKA and tried the existing checksum algorithm in a scratch-program, I implemented Toyota's checksum per the IOActive document to the last value and seeing if that pre-existing approach works for the RAV4 Prime's 8 byte STEERING_LKA. My unit tests work for my Corolla 2020's data. It doesn't for the 2021 Rav4 Prime's data and they don't match.

The last four bytes for STEERING_LKA are rapidly changing.

high_entropy

I haven't taken a look at PRE_COLLISION other than noticing the size change. Using the existing algorithm on a value here doesn't seem to work either.

Unfortunately, I've hit the limits of what I can do right now. I think Toyota has changed the checksum scheme or something for STEERING_LKA and PRE_COLLISION.

I am not the owner of this 2021 Rav4 Prime, matty#8553 on Discord is.

Please reach out to matty#8553 if you need him to perform some diagnosis. If there may be something out of his depth and Comma staff or someone from the community is not available or willing to help him through the "boring" diagnosis parts such as setup/SSH/forks/etc, let me know and I will be happy to help walk matty#8553 through those tasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions