From 637c3c820c51b34254d032f642afb0a7b6cd4129 Mon Sep 17 00:00:00 2001 From: Beartech <233074906+beartech-ca@users.noreply.github.com> Date: Thu, 9 Jul 2026 11:15:09 -0700 Subject: [PATCH] gm: route SDGM cam-long friction brake to the correct bus Send EBCMFrictionBrakeCmd (0x315) where the EBCM receives it: SDGM+SASCM cars off the SASCM's camera-bus (bus2) leg, bare SDGM on the powertrain bus. Whitelist 0x315 on the camera bus in GM_CAM_LONG_TX_MSGS. Requires a panda rebuild. --- opendbc_repo/opendbc/car/gm/carcontroller.py | 8 ++++++++ opendbc_repo/opendbc/safety/modes/gm.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/opendbc_repo/opendbc/car/gm/carcontroller.py b/opendbc_repo/opendbc/car/gm/carcontroller.py index 1f3f17881..1f67d7dbf 100644 --- a/opendbc_repo/opendbc/car/gm/carcontroller.py +++ b/opendbc_repo/opendbc/car/gm/carcontroller.py @@ -333,6 +333,14 @@ def get_friction_brake_bus(CP): if CP.networkLocation == NetworkLocation.fwdCamera: if CP.carFingerprint in SDGM_CAR: + # cam-long: 0x315 goes where the panda whitelist allows it and the EBCM hears it + safety_cfg = getattr(CP, "safetyConfigs", ()) + safety_param = safety_cfg[0].safetyParam if safety_cfg else 0 + if safety_param & GMSafetyFlags.HW_CAM_LONG.value: + # SASCM relays 0x315 to the EBCM off its camera-bus (bus2) leg; bare SDGM uses the pt bus + if CP.flags & GMFlags.SASCM.value: + return CanBus.CAMERA + return CanBus.POWERTRAIN return CanBus.CAMERA return CanBus.POWERTRAIN diff --git a/opendbc_repo/opendbc/safety/modes/gm.h b/opendbc_repo/opendbc/safety/modes/gm.h index 9029606c7..42e4b6fd4 100644 --- a/opendbc_repo/opendbc/safety/modes/gm.h +++ b/opendbc_repo/opendbc/safety/modes/gm.h @@ -581,7 +581,7 @@ static safety_config gm_init(uint16_t param) { // block PSCMStatus (0x184); forwarded through openpilot to hide an alert from the camera static const CanMsg GM_CAM_LONG_TX_MSGS[] = {{0x180, 0, 4, .check_relay = true}, {0x315, 0, 5, .check_relay = true}, {0x2CB, 0, 8, .check_relay = true}, {0x2CD, 0, 5, .check_relay = true}, {0x370, 0, 6, .check_relay = true}, {0x3D1, 0, 8, .check_relay = false}, // pt bus - {0x184, 2, 8, .check_relay = true}, // camera bus + {0x184, 2, 8, .check_relay = true}, {0x315, 2, 5, .check_relay = false}, // camera bus (SASCM brake relay) {0x200, 0, 6, .check_relay = false}, {0x1E1, 0, 7, .check_relay = false}, {0xBD, 0, 7, .check_relay = false}, {0x1F5, 0, 8, .check_relay = false}}; // pt bus