From bcd29a2b8af7c7364040716926d5c18ccd89ca7c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 6 Feb 2024 22:37:26 -0600 Subject: [PATCH] Hyundai: add PT queries for all ECUs (#31334) * We never had any bus 0 logging queries for CAN! * should be logging * try all, and try on can fd as well * update refs * oof forgot about hda2 can fd where pt is bus 1 * sheesh * fix the timing * fix ref --- selfdrive/car/hyundai/values.py | 29 ++++++++++++++++++++++ selfdrive/car/tests/test_fw_fingerprint.py | 6 ++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 84447a485a..eef31222fe 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -414,6 +414,8 @@ PLATFORM_CODE_ECUS = [Ecu.fwdRadar, Ecu.fwdCamera, Ecu.eps] # TODO: there are date codes in the ABS firmware versions in hex DATE_FW_ECUS = [Ecu.fwdCamera] +ALL_HYUNDAI_ECUS = [Ecu.eps, Ecu.abs, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.engine, Ecu.parkingAdas, Ecu.transmission, Ecu.adas, Ecu.hvac, Ecu.cornerRadar] + FW_QUERY_CONFIG = FwQueryConfig( requests=[ # TODO: minimize shared whitelists for CAN and cornerRadar for CAN-FD @@ -447,6 +449,33 @@ FW_QUERY_CONFIG = FwQueryConfig( obd_multiplexing=False, ), + # CAN & CAN FD logging queries (from camera) + Request( + [HYUNDAI_VERSION_REQUEST_LONG], + [HYUNDAI_VERSION_RESPONSE], + whitelist_ecus=ALL_HYUNDAI_ECUS, + bus=0, + auxiliary=True, + logging=True, + ), + Request( + [HYUNDAI_VERSION_REQUEST_MULTI], + [HYUNDAI_VERSION_RESPONSE], + whitelist_ecus=ALL_HYUNDAI_ECUS, + bus=0, + auxiliary=True, + logging=True, + ), + Request( + [HYUNDAI_VERSION_REQUEST_LONG], + [HYUNDAI_VERSION_RESPONSE], + whitelist_ecus=ALL_HYUNDAI_ECUS, + bus=1, + auxiliary=True, + obd_multiplexing=False, + logging=True, + ), + # CAN-FD alt request logging queries Request( [HYUNDAI_VERSION_REQUEST_ALT], diff --git a/selfdrive/car/tests/test_fw_fingerprint.py b/selfdrive/car/tests/test_fw_fingerprint.py index 4c07abb026..73472b7a11 100755 --- a/selfdrive/car/tests/test_fw_fingerprint.py +++ b/selfdrive/car/tests/test_fw_fingerprint.py @@ -254,7 +254,7 @@ class TestFwFingerprintTiming(unittest.TestCase): @pytest.mark.timeout(60) def test_fw_query_timing(self): - total_ref_time = {1: 5.55, 2: 6.05} + total_ref_time = {1: 5.85, 2: 6.65} brand_ref_times = { 1: { 'gm': 0.5, @@ -262,7 +262,7 @@ class TestFwFingerprintTiming(unittest.TestCase): 'chrysler': 0.3, 'ford': 0.1, 'honda': 0.55, - 'hyundai': 0.65, + 'hyundai': 0.95, 'mazda': 0.1, 'nissan': 0.8, 'subaru': 0.45, @@ -272,7 +272,7 @@ class TestFwFingerprintTiming(unittest.TestCase): }, 2: { 'ford': 0.2, - 'hyundai': 1.05, + 'hyundai': 1.65, } }