From 398dd771144fab835ebab4feebb4461f759bd07f Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 8 Jul 2023 01:33:41 -0700 Subject: [PATCH] Hyundai: blacklist bad camera FW (#28318) * cmt * common parts * add code and date * Revert "add code and date" This reverts commit 47f9ac84cae8d1e73dc2b5af7d5701adc83da6eb. * Revert "common parts" This reverts commit aa5683bbce5b5e8e8414f5b90df9add3998e98ab. * add back to santa cruz * todo * part number test * pass test * Update selfdrive/car/hyundai/tests/test_hyundai.py --- selfdrive/car/hyundai/tests/test_hyundai.py | 14 ++++++++++++++ selfdrive/car/hyundai/values.py | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/hyundai/tests/test_hyundai.py b/selfdrive/car/hyundai/tests/test_hyundai.py index 36d2b3dc4c..6a37ded35e 100755 --- a/selfdrive/car/hyundai/tests/test_hyundai.py +++ b/selfdrive/car/hyundai/tests/test_hyundai.py @@ -52,6 +52,20 @@ class TestHyundaiFingerprint(unittest.TestCase): self.assertEqual(len(ecus_not_in_whitelist), 0, f"{car_model}: Car model has ECUs not in auxiliary request whitelists: {ecu_strings}") + def test_blacklisted_parts(self): + # Asserts no ECUs known to be shared across platforms exist in the database. + # Tucson having Santa Cruz camera and EPS for example + for car_model, ecus in FW_VERSIONS.items(): + with self.subTest(car_model=car_model): + if car_model == CAR.SANTA_CRUZ_1ST_GEN: + raise unittest.SkipTest("Skip checking Santa Cruz for its parts") + + for code, _ in get_platform_codes(ecus[(Ecu.fwdCamera, 0x7c4, None)]): + if b"-" not in code: + continue + part = code.split(b"-")[1] + self.assertFalse(part.startswith(b'CW'), "Car has bad part number") + # Tests for platform codes, part numbers, and FW dates which Hyundai will use to fuzzy # fingerprint in the absence of full FW matches: def test_platform_code_ecus_available(self): diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 6d4285172f..e2b5ce9bd9 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -1766,7 +1766,6 @@ FW_VERSIONS = { (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-N9210 14G', b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.01 99211-N9240 14T', - b'\xf1\x00NX4 FR_CMR AT USA LHD 1.00 1.00 99211-CW010 14X', ], (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00NX4__ 1.00 1.00 99110-N9100 ',