Mazda: decouple TJA MADS from MRCC - #6
Open
chinna244 wants to merge 4 commits into
Open
Conversation
Expose a nullable per-mode hook so board code can sanitize a copied packet without changing the original RX packet.
Carry the dedicated safety parameter only for the platform whose physical TJA button layout has been verified.
Preserve wheel state in synthetic button frames, suppress TJA-visible ICBM traffic, and strip TJA only from the FSC-bound forwarding copy.
Track pre-press ownership and use a delayed, interruptible three-frame MRCC-off hold with its deadline, counter, and interruption regression tests.
There was a problem hiding this comment.
Thanks for contributing to opendbc! In order for us to review your PR as quickly as possible, check the following:
- Convert your PR to a draft unless it's ready to review
- Read the contributing docs
- Before marking as "ready for review", ensure:
- the goal is clearly stated in the description
- all the tests are passing
- include a route or your device' dongle ID if relevant
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.
This makes the physical TJA button the MADS lateral-control source on the supported Mazda CX-5 platform instead of tying lateral availability to MRCC state.
The TJA state is preserved on synthetic CRZ_BTNS messages, while the forwarded copy to the FSC has the TJA bit cleared so stock TJA does not take ownership. Panda safety still receives the original bus-0 state.
Mazda can arm MRCC as a side effect of a TJA press. When that happens from an MRCC-off state, the controller sends a bounded MRCC_OFF cleanup after release. The cleanup keeps driver input priority, uses raw MRCC state for confirmation, preserves ownership across repeated TJA interaction, and is limited to three transmitted frames.
The behavior is scoped behind TJA_MADS. Mazda platforms without that capability continue using the existing MADS/MRCC path.
Required Panda dependency
This OpenDBC PR is not sufficient by itself. Panda must call the new
safety_fwd_modify()hook on the copied forwarding packet. Without this call, the physical TJA bit is forwarded unchanged to the FSC and stock OEM TJA can still take ownership.The required Panda change is commit
950151de. Add this one line inboard/drivers/fdcan.h, after copying the RX payload intoto_sendand before recalculating its checksum:Required integration order:
safety_fwd_modify()is declared and implemented.fdcan.hchange.The complete combination—this OpenDBC work plus Panda
950151de—is already pinned and field-tested on the author's Zoompilotdevelopbranch.Tests