From 51a12a96d30284924a8fae6d55920fa1ae66b919 Mon Sep 17 00:00:00 2001 From: elkoled Date: Sat, 13 Dec 2025 13:22:22 +0100 Subject: [PATCH 1/5] add PSA exception --- board/drivers/can_common.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/board/drivers/can_common.h b/board/drivers/can_common.h index 35c6702e807..5a8e83f1140 100644 --- a/board/drivers/can_common.h +++ b/board/drivers/can_common.h @@ -201,6 +201,13 @@ void ignition_can_hook(CANPacket_t *msg) { ignition_can_cnt = 0U; } + // PSA exception + if ((msg->addr == 0x348U) && (len == 8)) { + // bit 41: EV running, bit 42: ICE running + ignition_can = (msg->data[5] & 0x6U) != 0U; + ignition_can_cnt = 0U; + } + } } From a563af09d1f856598fbe8c38458cc787c6425de7 Mon Sep 17 00:00:00 2001 From: elkoled Date: Wed, 17 Dec 2025 18:30:09 +0100 Subject: [PATCH 2/5] add PSA exception with counter --- board/drivers/can_common.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/board/drivers/can_common.h b/board/drivers/can_common.h index 5a8e83f1140..68dfd910cf9 100644 --- a/board/drivers/can_common.h +++ b/board/drivers/can_common.h @@ -202,10 +202,16 @@ void ignition_can_hook(CANPacket_t *msg) { } // PSA exception - if ((msg->addr == 0x348U) && (len == 8)) { - // bit 41: EV running, bit 42: ICE running - ignition_can = (msg->data[5] & 0x6U) != 0U; - ignition_can_cnt = 0U; + if ((msg->addr == 0x208) && (len == 8)) { + int counter = msg->data[2] & 0xFU; + + static int prev_counter_psa = -1; + if ((counter == ((prev_counter_psa + 1) % 16)) && (prev_counter_psa != -1)) { + // Dyn_CMM->P042_Inm_bCanMon + ignition_can = ((msg->data[4] >> 6) & 0x1U); + ignition_can_cnt = 0U; + } + prev_counter_psa = counter; } } From 3364008656bb104244754a8aec8879847c74541e Mon Sep 17 00:00:00 2001 From: elkoled Date: Thu, 18 Dec 2025 17:17:02 +0100 Subject: [PATCH 3/5] add PSA exception with other msg --- board/drivers/can_common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/board/drivers/can_common.h b/board/drivers/can_common.h index 68dfd910cf9..ec054980d9d 100644 --- a/board/drivers/can_common.h +++ b/board/drivers/can_common.h @@ -202,13 +202,13 @@ void ignition_can_hook(CANPacket_t *msg) { } // PSA exception - if ((msg->addr == 0x208) && (len == 8)) { - int counter = msg->data[2] & 0xFU; + if ((addr == 0x2f5) && (len == 7)) { + int counter = msg->data[0] & 0xFU; static int prev_counter_psa = -1; if ((counter == ((prev_counter_psa + 1) % 16)) && (prev_counter_psa != -1)) { - // Dyn_CMM->P042_Inm_bCanMon - ignition_can = ((msg->data[4] >> 6) & 0x1U); + // STEERING->IGNITION + ignition_can = ((msg->data[2] >> 5) & 0x1U); ignition_can_cnt = 0U; } prev_counter_psa = counter; From b7dacfe2461a301f6e730c947ce5c2ee33d04acb Mon Sep 17 00:00:00 2001 From: elkoled Date: Thu, 18 Dec 2025 17:21:04 +0100 Subject: [PATCH 4/5] fix --- board/drivers/can_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/drivers/can_common.h b/board/drivers/can_common.h index ec054980d9d..c4a6d579d2d 100644 --- a/board/drivers/can_common.h +++ b/board/drivers/can_common.h @@ -202,7 +202,7 @@ void ignition_can_hook(CANPacket_t *msg) { } // PSA exception - if ((addr == 0x2f5) && (len == 7)) { + if ((msg->addr == 0x2f5) && (len == 7)) { int counter = msg->data[0] & 0xFU; static int prev_counter_psa = -1; From 4ce60f39d02da5d4b05199bc81400fd1fbdf44ee Mon Sep 17 00:00:00 2001 From: elkoled Date: Fri, 19 Dec 2025 00:16:56 +0100 Subject: [PATCH 5/5] PSA ignition with 0x432 --- board/drivers/can_common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/board/drivers/can_common.h b/board/drivers/can_common.h index c4a6d579d2d..f058a88afda 100644 --- a/board/drivers/can_common.h +++ b/board/drivers/can_common.h @@ -202,13 +202,13 @@ void ignition_can_hook(CANPacket_t *msg) { } // PSA exception - if ((msg->addr == 0x2f5) && (len == 7)) { - int counter = msg->data[0] & 0xFU; + if ((msg->addr == 0x432) && (len == 8)) { + int counter = msg->data[1] & 0xFU; static int prev_counter_psa = -1; if ((counter == ((prev_counter_psa + 1) % 16)) && (prev_counter_psa != -1)) { - // STEERING->IGNITION - ignition_can = ((msg->data[2] >> 5) & 0x1U); + // Dat_BSI1->P369_Com_stElecNetRaw + ignition_can = (msg->data[7] >> 4) == 0x5U; ignition_can_cnt = 0U; } prev_counter_psa = counter;