Recognize 2025 Subaru Impreza Base firmware

This commit is contained in:
firestar5683
2026-11-28 11:02:39 -06:00
parent ad8c193b8c
commit 4d0fa59f72
4 changed files with 21 additions and 14 deletions
@@ -616,9 +616,11 @@ FW_VERSIONS = {
CAR.SUBARU_IMPREZA_2025: {
(Ecu.abs, 0x7b0, None): [
b'\xa2 $\x07\x05',
b'\xa2 $\x04\x05',
],
(Ecu.eps, 0x746, None): [
b'\xc2 $\x01\x01',
b'\xc2 $\x00\x01',
],
(Ecu.fwdCamera, 0x787, None): [
b'\x1d!\x08\x00F\x00\x00\x00\x00\x00',
@@ -626,6 +628,7 @@ FW_VERSIONS = {
],
(Ecu.engine, 0x7a2, None): [
b'\x04"ep\x07',
b'\x04!`p\x07',
],
},
@@ -104,11 +104,11 @@ def recorded_impreza_firmware():
for ecu, address, version, logging, bus, obd in rows]
@pytest.mark.parametrize('full_startup', [False, True])
def test_recorded_impreza_firmware_selects_exact_identity_without_overrides(full_startup):
@pytest.mark.parametrize(('full_startup', 'base'), [(False, False), (True, False), (True, True)], ids=('rs', 'rs-startup', 'base-startup'))
def test_recorded_impreza_firmware_selects_exact_identity_without_overrides(full_startup, base):
from opendbc.car.fw_versions import match_fw_to_car, build_fw_dict
fw = recorded_impreza_startup_firmware() if full_startup else recorded_impreza_firmware()
fw = recorded_impreza_startup_firmware(base=base) if full_startup else recorded_impreza_firmware()
exact, matches = match_fw_to_car(fw, '0' * 17, log=False)
assert exact and matches == {CAR.SUBARU_IMPREZA_2025}
assert bytes.fromhex('20020e') not in build_fw_dict(fw)[0x787, None]
@@ -119,16 +119,20 @@ def test_recorded_impreza_firmware_selects_exact_identity_without_overrides(full
assert CAR.SUBARU_IMPREZA_2025 not in match_fw_to_car(unknown, '0' * 17, log=False)[1]
def recorded_impreza_startup_firmware(camera_version='1d21080046142108003d'):
def recorded_impreza_startup_firmware(camera_version='1d21080046142108003d', *, base=False):
# 388aeb4f2701bd8e/0000001e--432395cebf: preserve all actual responses, including other query brands.
# The Base capture uses the same query sequence and has distinct powertrain and EPS firmware.
abs_version, engine, eps = ('a220240405', '0421607007', 'c220240001') if base else ('a220240705', '0422657007', 'c220240101')
if base:
camera_version = '1d210800460000000000'
rows = (
('abs', 1968, 'a220240705', 'subaru', True, 1, True),
('engine', 1954, '0422657007', 'subaru', True, 1, True),
('eps', 1862, 'c220240101', 'subaru', True, 1, True),
('abs', 1968, abs_version, 'subaru', True, 1, True),
('engine', 1954, engine, 'subaru', True, 1, True),
('eps', 1862, eps, 'subaru', True, 1, True),
('fwdCamera', 1927, camera_version, 'subaru', False, 0, True),
('fwdCamera', 1927, '20020e', 'subaru', True, 0, True),
('abs', 1968, 'a220240705', 'subaru', False, 1, False),
('engine', 1954, '0422657007', 'subaru', False, 1, False),
('abs', 1968, abs_version, 'subaru', False, 1, False),
('engine', 1954, engine, 'subaru', False, 1, False),
('hvac', 1971, 'f100b90100', 'hyundai', True, 1, True),
('fwdRadar', 2000, 'f100000002', 'hyundai', False, 1, True),
('fwdCamera', 1988, 'f100ac0300', 'hyundai', False, 1, True),
@@ -754,15 +754,15 @@ def test_actual_main_during_temporary_eps_waits_for_clear(subaru_native_pair, tm
CAR.SUBARU_IMPREZA_2020, subaru_native_pair, tmp_path, main_only=True, main_during_eps=True)
@pytest.mark.parametrize('full_startup', [False, True])
def test_actual_impreza2025_automatic_full_stack(subaru_native_pair, tmp_path, full_startup):
@pytest.mark.parametrize(('full_startup', 'base'), [(False, False), (True, False), (False, True)], ids=('rs-padded', 'rs-full', 'base'))
def test_actual_impreza2025_automatic_full_stack(subaru_native_pair, tmp_path, full_startup, base):
from opendbc.car.subaru.tests.test_supported_firmware import recorded_impreza_startup_firmware
camera_version = '1d21080046142108003d' if full_startup else '1d210800460000000000'
firmware = recorded_impreza_startup_firmware(camera_version)
firmware = recorded_impreza_startup_firmware(camera_version, base=base)
test_actual_full_engage_brake_reverse_temporary_recovery_mainoff(
CAR.SUBARU_IMPREZA_2025, subaru_native_pair, tmp_path, main_only=True,
stop_resume=True, hard_stop_native_first=True, firmware=firmware)
stop_resume=True, hard_stop_native_first=True, firmware=firmware, camera_hud=base)
@pytest.mark.parametrize('candidate', [CAR.SUBARU_CROSSTREK_2025, CAR.SUBARU_IMPREZA_2025])
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "865a249d3eb8c36b4cb321667bcce5d5e3dc19c08351d0874282f52002de714c", "schema_version": 1}
{"protected_inventory_sha256": "3f794b0cb5798e299bec6f5545b551b74fdfcab92988393bdcf289ce5b8bf12b", "schema_version": 1}