feat: S12 — vcucmd 3-state command from VCU (replaces binary vcustop) #10
Reference in New Issue
Block a user
Delete Branch "feat/s12-vcucmd-3state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Promote 0x212 byte 3 from S11's binary
vcustopto the full Dilong-styleOBC_ControlCMDvocabulary so the VCU's two charger paths can share morestate-machine logic. VCU is now authoritative for the OI-OBC lifecycle.
What
Internal FSM changes:
vcucmd == Charging(was unconditional).Completedrops to STOP;Stoppedholds HV-armed.CheckVoltage,CheckTimeout) are removed. Those were band-aids for the absence of an authoritative VCU stop signal.vcucmd == Stoppedparks back in ENABLE (HV held);Completedrops to STOP.CheckUnplugged+CheckChargerFaultsstill own hardware-safety exits.vcucmd != Complete(previously unplug-only).Why this matters
S11's binary
vcustopwedged the charger on every limit-raise mid-COMPLETE: VCU setvcustop=1→ charger STOP → user raised limit → VCU cleared the BMS-side latch → VCU went IDLE expecting STOP→OFF→WAITSTART... but STOP only exited on physical unplug. User had to unplug+replug to restart. S12 fixes that by exiting STOP whenevervcucmd != Complete.Param rename
Param::vcustop→Param::vcucmdwith new 3-state enum (VCUCMDS = "0=Charging, 1=Stopped, 2=Complete"). External openinverter web UI tooling that reads/writes the S11 vcustop param will see the new vcucmd param — single-user bench, acceptable.VERSTR bumped to S12.
Companion VCU PR
stm32-hal-vcu
refactor/charger-slot-polymorphismbranch — lands the matchingVCU_OIOBCCommand_tenum +Charger_TransmitChargeLimitsignature change +_UpdateChargingStateOIOBCsimplification.Test plan
Promote 0x212 byte 3 from S11's binary vcustop to the full Dilong-style OBC_ControlCMD vocabulary: 0 = Charging — walk to / hold at EVSEACTIVATE, produce current 1 = Stopped — sit idle in OFF/WAITSTART/ENABLE, no current 2 = Complete — drop to STOP (cycle terminated by VCU) VCU is now authoritative for the charge-cycle lifecycle. The charger keeps hardware-level wisdom (EVSE pilot via CheckStartCondition, plug-out safety via CheckUnplugged, module-fault detection via CheckChargerFaults) but obeys vcucmd for "should I be charging?". FSM changes: - ENABLE→ACTIVATE now gated on vcucmd==Charging (was unconditional). ENABLE on vcucmd==Complete drops to STOP; vcucmd==Stopped holds HV-armed waiting for next Charging command. - EVSEACTIVATE self-decided exits (CheckVoltage, CheckTimeout) are gone. Those were band-aids for the absence of an authoritative VCU stop signal. vcucmd==Stopped now parks back in ENABLE (HV held); vcucmd==Complete drops to STOP. CheckUnplugged + CheckChargerFaults still own hardware-safety exits. - STOP→OFF now also triggers on vcucmd != Complete (was unplug-only). This is the fix for the "raise ChargeLimit mid-COMPLETE doesn't restart charging" wedge — the VCU's vcucmd flip from Complete to Stopped on a limit-raise lets the natural OFF→WAITSTART→ENABLE→ ACTIVATE→EVSEACTIVATE flow resume charging without an unplug cycle. Param rename vcustop→vcucmd. External tooling that reads/writes the S11 vcustop param via the openinverter web UI will see the new vcucmd param with 3-state semantics — single-user bench, acceptable. VERSTR bumped to S12. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.