From 3580123a39f5381b2df9726ce0881ca01535dba7 Mon Sep 17 00:00:00 2001 From: Bastian de Byl Date: Fri, 8 May 2026 16:48:48 -0400 Subject: [PATCH] feat: expand 0x210 telemetry layout (state/udc/idc/uaux@5/soc) for SKUDAK-448 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the single uaux-at-byte-0 broadcast (commit d209a47) with a 7-byte expanded telemetry frame. Bench capture on green car showed dual 0x210 frames colliding (DLC=8 simple + DLC=7 expanded) because Kyle's flashed image had both AddSend sets active; standardising on the expanded layout eliminates that ambiguity. Byte layout: byte 0 state (0=Off, 1=WaitStart, 2=Enable, 3=Activate, 4=Run, 5=Stop) bytes 1-2 udc (V, gain=1) bytes 3-4 idc (0.1A, gain=10) byte 5 uaux (decivolts, gain=10) — 12V aux battery rail byte 6 soc (%, gain=1) byte 7 reserved Consumed by stm32-hal-vcu Core/Src/main.c CHARGER_CAN_ID_OI_OBC_AUX handler. The state byte enables future VCU_IsCharging integration via state == 4 (Run) without requiring a second CAN ID. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/chargercan.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/chargercan.cpp b/src/chargercan.cpp index e20d901..eed043d 100644 --- a/src/chargercan.cpp +++ b/src/chargercan.cpp @@ -100,6 +100,17 @@ void ChargerCAN::MapMessages(CanMap* can) can->AddSend(Param::idc, 0x109, 24, 16, 1); can->AddSend(Param::opmode, 0x109, 40, 3, 5); //Set charging and connlock at once - /***** Auxiliary TX *****/ - can->AddSend(Param::uaux, 0x210, 0, 8, 10); //12V aux battery: byte 0, gain=10 (0.1V/decivolts, SKUDAK-448) + /***** SKUDAK VCU telemetry (0x210) — SKUDAK-448 expanded charger telemetry *****/ + // Byte 0: state (0=Off, 1=WaitStart, 2=Enable, 3=Activate, 4=Run, 5=Stop) + // Bytes 1-2: udc (V, gain=1) + // Bytes 3-4: idc (0.1A, gain=10) + // Byte 5: uaux (decivolts, gain=10) — 12V aux battery rail + // Byte 6: soc (%, gain=1) + // Byte 7: reserved + // Consumed by stm32-hal-vcu Core/Src/main.c CHARGER_CAN_ID_OI_OBC_AUX handler. + can->AddSend(Param::state, 0x210, 0, 8, 1); + can->AddSend(Param::udc, 0x210, 8, 16, 1); + can->AddSend(Param::idc, 0x210, 24, 16, 10); + can->AddSend(Param::uaux, 0x210, 40, 8, 10); + can->AddSend(Param::soc, 0x210, 48, 8, 1); } -- 2.52.0