Tesla: Fix DAS_steeringControlType on newer firmware#3389
Open
AmyJeanes wants to merge 5 commits into
Open
Conversation
Contributor
Car behavior reportReplays driving segments through this PR and compares the behavior to master. Testing 20 segments for: TESLA_MODEL_3, TESLA_MODEL_Y Show changes |
Contributor
Author
|
@sshane this is now ready for review, I've added routes from my own vehicle on the older firmware and a route showing everything working from a car on the newer 3-bit firmware. Please let me know if you need any other routes or anything. |
sshane
reviewed
May 22, 2026
Contributor
There was a problem hiding this comment.
Just one DBC, and set values in reference to the new 3 bit signal? Or use a generator so we don't duplicate message definitions
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.
On newer Tesla vehicle firmware across the fleet, we are seeing the
DAS_steeringControlTypefield expanded from 2 bits to 3 bits in the dbc. It is in the same position, the field simply expands by 1 bit into previously unknown/unmapped bits which we can assume were not in use before.This change first appeared in FSD v14 builds, as the expansion of the field was to allow a new value
4 = FSDto be set as the previous field could only go up to 3, but after some time this change found it's way to normal vehicle builds from update 2026.8.6 onwards and thus is no longer a FSD v14 specific change as was previously noted in the code here.The resulting behaviour of openpilot when assuming a 2-bit field when it was actually 3-bit resulted in the following behaviour:
LANE_KEEP_ASSISTsteering instead ofANGLE_CONTROLsteering as0b01would be sent by openpilot but read by the car as0b010invalidLkasSettinguntil the device went off-road.0b10would be sent, which was read by the car as0b100aka FSD steering which apparently does not workThe changes in this PR essentially allow us to swap between two different DBCs, the new one with the 3-bit field and the "legacy" one with the 2-bit field, determined using a fixed
LEGACY_DAS_STEERING_FWlist, similar to the previousFSD_14_FWlist but with the behaviour inverted, as it seems Tesla will now be using 3-bit going forwards in all updates to all cars. All firmwares that were previously classified as FSD v14 have been removed from the legacy list to maintain behaviour with the existing code, and additionally some others that have been since confirmed to be using 3-bit.The changes to the safety code also work in the same vein, except instead of switching between DBCs it simply switches how it reads the
DAS_steeringControlTypevalue based on the set safety flags.The test around comparing the firmware list against the suspected FSD v14 rule has been simplified to just ensuring that all entries within the list are also present in the
FW_VERSIONSlist so they don't get orphaned, but the logic is too complex to accurately add heuristics too and given we can expect all new firmwares from Tesla to include the 3-bit field now that it is in the standard release tracks and no longer exclusive to FSD v14 this shouldn't be an issue going forwards.The previous FSD v14 handling has been stripped out as part of this PR as it runs on incorrect assumptions that the values themselves had changed, but it was actually the bit size of the field that had changed. Without that knowledge, it appeared as if
ANGLE_CONTROL(0b01) had become0b10andLANE_KEEP_ASSIST(0b10) had become0b01when in fact they had become0b100(new FSD value) and0b010, the same value as before just shifted. Autosteer on these vehicles also went seemingly missing with0b01becoming0b00but it had actually just moved to the new bit0b001.A sunnypilot variant of these changes was installed and tested on several vehicles using both 2-bit and 3-bit firmwares and in one case testing directly before and after upgrading and the new code correctly both read and set the correct values according to several validation routes shared privately with myself.
A new firmware string was also added, a minor variation of an already existing one. Routes are also provided for this below just to be complete.
Routes: