diff --git a/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h b/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h index 27b380a792..1695395812 100644 --- a/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h +++ b/opendbc_repo/opendbc/safety/modes/hyundai_canfd.h @@ -1251,7 +1251,7 @@ static bool hyundai_kona_host_steering(void) { } static bool hyundai_kona_lfa_valid(const CANPacket_t *msg) { - return msg->fd && !msg->extended && (GET_LEN(msg) == 16U) && + return !msg->extended && (GET_LEN(msg) == 16U) && (hyundai_canfd_get_checksum(msg) == (hyundai_common_canfd_compute_checksum(msg) ^ 0x041DU)); } @@ -1277,7 +1277,7 @@ static bool hyundai_kona_camera_without_slot(const CANPacket_t *msg) { static bool hyundai_kona_camera_release_current(const CANPacket_t *msg, uint32_t now) { return (msg->bus == 2U) && hyundai_kona_output_seen && hyundai_kona_host_output && hyundai_kona_camera_seen && !relay_malfunction && !safety_rx_checks_invalid && aol_rx_healthy() && - !hyundai_kona_host_steering() && hyundai_kona_lfa_valid(msg) && + !hyundai_kona_host_steering() && msg->fd && hyundai_kona_lfa_valid(msg) && ((uint8_t)(msg->data[2] - hyundai_kona_output_counter) == 1U) && ((uint8_t)(msg->data[2] - hyundai_kona_camera_counter) == 1U) && (safety_get_ts_elapsed(now, hyundai_kona_camera_ts) <= 20000U); @@ -1311,7 +1311,7 @@ static bool hyundai_kona_camera_output(const CANPacket_t *msg, CANPacket_t *outp const uint8_t delta = (uint8_t)(counter - hyundai_kona_camera_counter); const bool advancing = (delta > 0U) && (delta <= 127U); const bool consecutive = hyundai_kona_camera_seen && (delta == 1U) && (camera_age <= 20000U); - blocked = !hyundai_kona_lfa_valid(msg) || safety_rx_checks_invalid || !aol_rx_healthy() || + blocked = !msg->fd || !hyundai_kona_lfa_valid(msg) || safety_rx_checks_invalid || !aol_rx_healthy() || (hyundai_kona_camera_seen && (camera_age <= 50000U) && !advancing); if (!blocked) { hyundai_kona_camera_counter = counter; @@ -1344,6 +1344,7 @@ static bool hyundai_kona_camera_output(const CANPacket_t *msg, CANPacket_t *outp candidate.data[5] = (candidate.data[5] & 0x01U) | (uint8_t)((raw & 0x7FU) << 1U); candidate.data[6] = (candidate.data[6] & 0xF0U) | (uint8_t)(raw >> 7U); } + candidate.fd = msg->fd; candidate.data[2] = counter; const uint16_t checksum = hyundai_common_canfd_compute_checksum(&candidate) ^ 0x041DU; candidate.data[0] = (uint8_t)checksum; @@ -1461,7 +1462,7 @@ static bool hyundai_canfd_tx_hook(const CANPacket_t *msg) { if (hyundai_kona_idle_handoff && (msg->addr == 0x12AU)) { const uint32_t now = microsecond_timer_get(); allowed = hyundai_kona_emitting && !safety_rx_checks_invalid && aol_rx_healthy() && hyundai_kona_host_steering() && - hyundai_kona_lfa_valid(msg) && hyundai_kona_camera_seen && + msg->fd && hyundai_kona_lfa_valid(msg) && hyundai_kona_camera_seen && (safety_get_ts_elapsed(now, hyundai_kona_camera_ts) <= 50000U) && (msg->data[2] == hyundai_kona_camera_counter) && hyundai_kona_output_ready(now, true, msg->data[2]); } diff --git a/opendbc_repo/opendbc/safety/tests/test_hyundai_kona_ccnc_handoff.py b/opendbc_repo/opendbc/safety/tests/test_hyundai_kona_ccnc_handoff.py index 8f33ff31f0..08be7d5824 100644 --- a/opendbc_repo/opendbc/safety/tests/test_hyundai_kona_ccnc_handoff.py +++ b/opendbc_repo/opendbc/safety/tests/test_hyundai_kona_ccnc_handoff.py @@ -17,7 +17,7 @@ class TestHyundaiKonaCcncHandoff(unittest.TestCase): def packet(self, bus, body): packet = libsafety_py.make_CANPacket(0x12A, bus, bytes.fromhex(body)) - packet[0].fd = 1 + packet[0].fd = bus == 2 return packet def test_handoff_is_debug_only_and_requires_exact_alternative_experience(self): @@ -71,6 +71,9 @@ class TestHyundaiKonaCcncHandoff(unittest.TestCase): status.valid_quality_flag = True status.last_timestamp = 1_000_000 + camera[0].fd = 0 + self.assertEqual(self.forward(camera)[0], -1) + camera[0].fd = 1 self.assertEqual(self.forward(camera)[:2], (0, False)) self.assertEqual(self.forward(camera)[0], -1) corrupt = self.packet(2, 'a6770a1881001800000a000000900000') @@ -88,11 +91,15 @@ class TestHyundaiKonaCcncHandoff(unittest.TestCase): host[0].data[0], host[0].data[1] = crc & 255, crc >> 8 self.safety.set_timer(1_005_000) self.assertFalse(self.safety.safety_tx_hook(host)) + host[0].data[0] ^= 1 + self.assertFalse(self.safety.safety_stage_tx_hook(host)) + host[0].data[0] ^= 1 self.assertTrue(self.safety.safety_stage_tx_hook(host)) self.safety.set_timer(1_010_000) match = self.packet(2, '5ce51500000108f0000a000000640000') bus, replaced, output = self.forward(match) self.assertEqual((bus, replaced, output[0].data[2]), (0, True, 21)) + self.assertTrue(output[0].fd) self.assertEqual(output[0].data[7] & 0xF0, 0xF0) self.safety.set_controls_allowed(False) diff --git a/panda/board/obj/body_h7.bin.signed b/panda/board/obj/body_h7.bin.signed index 0168e85c77..107839bc4c 100644 Binary files a/panda/board/obj/body_h7.bin.signed and b/panda/board/obj/body_h7.bin.signed differ diff --git a/panda/board/obj/bootstub.body_h7.bin b/panda/board/obj/bootstub.body_h7.bin index 72fc5cd2b7..c26f075ffd 100644 Binary files a/panda/board/obj/bootstub.body_h7.bin and b/panda/board/obj/bootstub.body_h7.bin differ diff --git a/panda/board/obj/bootstub.panda.bin b/panda/board/obj/bootstub.panda.bin index 60ea1d43a9..6c14280408 100644 Binary files a/panda/board/obj/bootstub.panda.bin and b/panda/board/obj/bootstub.panda.bin differ diff --git a/panda/board/obj/bootstub.panda_can_ignition_only.bin b/panda/board/obj/bootstub.panda_can_ignition_only.bin index 60ea1d43a9..6c14280408 100644 Binary files a/panda/board/obj/bootstub.panda_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_h7.bin b/panda/board/obj/bootstub.panda_h7.bin index 8cf568d031..53069e4352 100644 Binary files a/panda/board/obj/bootstub.panda_h7.bin and b/panda/board/obj/bootstub.panda_h7.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_can_ignition_only.bin b/panda/board/obj/bootstub.panda_h7_can_ignition_only.bin index 8cf568d031..53069e4352 100644 Binary files a/panda/board/obj/bootstub.panda_h7_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_h7_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_hkg_remote.bin b/panda/board/obj/bootstub.panda_h7_hkg_remote.bin index 8cf568d031..53069e4352 100644 Binary files a/panda/board/obj/bootstub.panda_h7_hkg_remote.bin and b/panda/board/obj/bootstub.panda_h7_hkg_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_hkg_remote_can_ignition_only.bin b/panda/board/obj/bootstub.panda_h7_hkg_remote_can_ignition_only.bin index 8cf568d031..53069e4352 100644 Binary files a/panda/board/obj/bootstub.panda_h7_hkg_remote_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_h7_hkg_remote_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_remote.bin b/panda/board/obj/bootstub.panda_h7_remote.bin index 8cf568d031..53069e4352 100644 Binary files a/panda/board/obj/bootstub.panda_h7_remote.bin and b/panda/board/obj/bootstub.panda_h7_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_remote_can_ignition_only.bin b/panda/board/obj/bootstub.panda_h7_remote_can_ignition_only.bin index 8cf568d031..53069e4352 100644 Binary files a/panda/board/obj/bootstub.panda_h7_remote_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_h7_remote_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_tesla_wake.bin b/panda/board/obj/bootstub.panda_h7_tesla_wake.bin index 8cf568d031..53069e4352 100644 Binary files a/panda/board/obj/bootstub.panda_h7_tesla_wake.bin and b/panda/board/obj/bootstub.panda_h7_tesla_wake.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_tesla_wake_can_ignition_only.bin b/panda/board/obj/bootstub.panda_h7_tesla_wake_can_ignition_only.bin index 8cf568d031..53069e4352 100644 Binary files a/panda/board/obj/bootstub.panda_h7_tesla_wake_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_h7_tesla_wake_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_hkg_remote.bin b/panda/board/obj/bootstub.panda_hkg_remote.bin index 60ea1d43a9..6c14280408 100644 Binary files a/panda/board/obj/bootstub.panda_hkg_remote.bin and b/panda/board/obj/bootstub.panda_hkg_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_hkg_remote_can_ignition_only.bin b/panda/board/obj/bootstub.panda_hkg_remote_can_ignition_only.bin index 60ea1d43a9..6c14280408 100644 Binary files a/panda/board/obj/bootstub.panda_hkg_remote_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_hkg_remote_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_remote.bin b/panda/board/obj/bootstub.panda_remote.bin index 60ea1d43a9..6c14280408 100644 Binary files a/panda/board/obj/bootstub.panda_remote.bin and b/panda/board/obj/bootstub.panda_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_remote_can_ignition_only.bin b/panda/board/obj/bootstub.panda_remote_can_ignition_only.bin index 60ea1d43a9..6c14280408 100644 Binary files a/panda/board/obj/bootstub.panda_remote_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_remote_can_ignition_only.bin differ diff --git a/panda/board/obj/bootstub.panda_tesla_wake.bin b/panda/board/obj/bootstub.panda_tesla_wake.bin index 60ea1d43a9..6c14280408 100644 Binary files a/panda/board/obj/bootstub.panda_tesla_wake.bin and b/panda/board/obj/bootstub.panda_tesla_wake.bin differ diff --git a/panda/board/obj/bootstub.panda_tesla_wake_can_ignition_only.bin b/panda/board/obj/bootstub.panda_tesla_wake_can_ignition_only.bin index 60ea1d43a9..6c14280408 100644 Binary files a/panda/board/obj/bootstub.panda_tesla_wake_can_ignition_only.bin and b/panda/board/obj/bootstub.panda_tesla_wake_can_ignition_only.bin differ diff --git a/panda/board/obj/panda.bin.signed b/panda/board/obj/panda.bin.signed index 4a362eb355..f97c4a2cf1 100644 Binary files a/panda/board/obj/panda.bin.signed and b/panda/board/obj/panda.bin.signed differ diff --git a/panda/board/obj/panda_can_ignition_only.bin.signed b/panda/board/obj/panda_can_ignition_only.bin.signed index e2308c951d..14a8d314dc 100644 Binary files a/panda/board/obj/panda_can_ignition_only.bin.signed and b/panda/board/obj/panda_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_h7.bin.signed b/panda/board/obj/panda_h7.bin.signed index 543b8c65e0..dc117dc8cd 100644 Binary files a/panda/board/obj/panda_h7.bin.signed and b/panda/board/obj/panda_h7.bin.signed differ diff --git a/panda/board/obj/panda_h7_can_ignition_only.bin.signed b/panda/board/obj/panda_h7_can_ignition_only.bin.signed index dbe6e9aa59..c987f4425c 100644 Binary files a/panda/board/obj/panda_h7_can_ignition_only.bin.signed and b/panda/board/obj/panda_h7_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_h7_hkg_remote.bin.signed b/panda/board/obj/panda_h7_hkg_remote.bin.signed index 34d3fa4c97..e37ea22990 100644 Binary files a/panda/board/obj/panda_h7_hkg_remote.bin.signed and b/panda/board/obj/panda_h7_hkg_remote.bin.signed differ diff --git a/panda/board/obj/panda_h7_hkg_remote_can_ignition_only.bin.signed b/panda/board/obj/panda_h7_hkg_remote_can_ignition_only.bin.signed index 7ddb379d49..129a7c2f36 100644 Binary files a/panda/board/obj/panda_h7_hkg_remote_can_ignition_only.bin.signed and b/panda/board/obj/panda_h7_hkg_remote_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_h7_remote.bin.signed b/panda/board/obj/panda_h7_remote.bin.signed index 5ef48a2555..5157eadf6b 100644 Binary files a/panda/board/obj/panda_h7_remote.bin.signed and b/panda/board/obj/panda_h7_remote.bin.signed differ diff --git a/panda/board/obj/panda_h7_remote_can_ignition_only.bin.signed b/panda/board/obj/panda_h7_remote_can_ignition_only.bin.signed index 27acd3c551..9b71ffd3c4 100644 Binary files a/panda/board/obj/panda_h7_remote_can_ignition_only.bin.signed and b/panda/board/obj/panda_h7_remote_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_h7_tesla_wake.bin.signed b/panda/board/obj/panda_h7_tesla_wake.bin.signed index ba0a157094..d0a4774c9c 100644 Binary files a/panda/board/obj/panda_h7_tesla_wake.bin.signed and b/panda/board/obj/panda_h7_tesla_wake.bin.signed differ diff --git a/panda/board/obj/panda_h7_tesla_wake_can_ignition_only.bin.signed b/panda/board/obj/panda_h7_tesla_wake_can_ignition_only.bin.signed index 78bc596640..7e2dfb50e7 100644 Binary files a/panda/board/obj/panda_h7_tesla_wake_can_ignition_only.bin.signed and b/panda/board/obj/panda_h7_tesla_wake_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_hkg_remote.bin.signed b/panda/board/obj/panda_hkg_remote.bin.signed index 767f5ec6b1..cfb0ef7765 100644 Binary files a/panda/board/obj/panda_hkg_remote.bin.signed and b/panda/board/obj/panda_hkg_remote.bin.signed differ diff --git a/panda/board/obj/panda_hkg_remote_can_ignition_only.bin.signed b/panda/board/obj/panda_hkg_remote_can_ignition_only.bin.signed index a2aa593530..3232a59235 100644 Binary files a/panda/board/obj/panda_hkg_remote_can_ignition_only.bin.signed and b/panda/board/obj/panda_hkg_remote_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_remote.bin.signed b/panda/board/obj/panda_remote.bin.signed index 4983895df1..54daa14039 100644 Binary files a/panda/board/obj/panda_remote.bin.signed and b/panda/board/obj/panda_remote.bin.signed differ diff --git a/panda/board/obj/panda_remote_can_ignition_only.bin.signed b/panda/board/obj/panda_remote_can_ignition_only.bin.signed index 3950338e28..ef7555c480 100644 Binary files a/panda/board/obj/panda_remote_can_ignition_only.bin.signed and b/panda/board/obj/panda_remote_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/panda_tesla_wake.bin.signed b/panda/board/obj/panda_tesla_wake.bin.signed index 0034de0a10..56c56a1d12 100644 Binary files a/panda/board/obj/panda_tesla_wake.bin.signed and b/panda/board/obj/panda_tesla_wake.bin.signed differ diff --git a/panda/board/obj/panda_tesla_wake_can_ignition_only.bin.signed b/panda/board/obj/panda_tesla_wake_can_ignition_only.bin.signed index 97d0f22e6c..507bfb3cc9 100644 Binary files a/panda/board/obj/panda_tesla_wake_can_ignition_only.bin.signed and b/panda/board/obj/panda_tesla_wake_can_ignition_only.bin.signed differ diff --git a/panda/board/obj/version b/panda/board/obj/version index 8268d8cdbc..b94fc3ecf6 100644 --- a/panda/board/obj/version +++ b/panda/board/obj/version @@ -1 +1 @@ -DEV-b666318e-Pf38f504f-DEBUG \ No newline at end of file +DEV-c4817d9a-Pf38f504f-DEBUG \ No newline at end of file diff --git a/panda/tests/libpanda/libpanda.so b/panda/tests/libpanda/libpanda.so index 30d47b8446..49760d77c8 100755 Binary files a/panda/tests/libpanda/libpanda.so and b/panda/tests/libpanda/libpanda.so differ diff --git a/prebuilt.json b/prebuilt.json index 0596403832..3afaa92b51 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "d7e4040d0eea396aa644f3e18da68be560b309575c874fe298173e9cc8f58fd3", "schema_version": 1} +{"protected_inventory_sha256": "c305449b5668a10ceaac348e5d80ff657f5ab4daa9567e57b7bfaaeb88f0704a", "schema_version": 1}