Skip to content

genset: EEC3, CCVS1, status fields, TSC1 override, CI - #33

Merged
tkeairns merged 4 commits into
mainfrom
feat/j1939-vehicle-pgs
Nov 26, 2026
Merged

tkeairns merged 4 commits into
mainfrom
feat/j1939-vehicle-pgs

Conversation

@tkeairns

@tkeairns tkeairns commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What

The genset sends the vehicle-side PGs a decoder meets on real trucks and fills the status fields it used to leave not-available:

  • EEC1 and EEC2 carry torque mode, the controlling device's address, starter mode, driver's and engine demand torque, the low-idle switch, maximum available and pumping torque, from the model.
  • EEC3 (65247, 250 ms): nominal friction torque, the governor's target speed, parasitic losses.
  • CCVS1 (65265, 100 ms): parking brake, brake, PTO governor and cruise states; wheel-based speed not available.
  • TSC1 (PGN 0, PDU1) to the node overrides the governor: speed control, torque control or a speed/torque limit; EEC1 names the controller (mode 11 remote accelerator, 8 torque limiting). A controller that stops sending loses the override after 1 s.
  • CI (65259) on request, by RTS/CTS to the requester or BAM to everyone, like SOFT. VI stays unsupported: it is the suites' NACK probe.

Every layout is from dbc/genset.dbc; the codec and dbc/full.dbc are regenerated. Byte positions checked against the Equipment and Tool Institute's J1939DA extract (j1939-84).

Why

Sub-byte status fields, a PDU1 message addressed to the node and the most common vehicle PGs were not on the bench, so a decoder's indicator-band and state handling had no hardware traffic to prove itself on.

How tested

  • just hil can-full/build/full.elf can0 j1939 on the hardware bench: 22 passed. New tests: the status fields follow the VCU's mode (idle: low idle governor, pedal at idle, parking brake, PTO standby; drive: pedal, PTO set), TSC1 speed control to 1500 rpm and a limit below idle, both reported in EEC1 and dropped on timeout, CI by BAM.
  • The existing periods test picks up EEC3 and CCVS1 from the DBC; frame spacing keeps at most two periodic frames per 10 ms tick (about 125 frames/s).
  • A Zelos CAN extension on the same bus decodes the filled EEC1/EEC2 fields and shows EEC3/CCVS1 as raw PGN rows without a user DBC.

Follow-ups

DM3/DM11 (needs a positive ACK in lib/j1939), a second sender of EEC1 (a second J1939 instance).

J1939-73 diagnostics (later commits)

What: the genset answers the diagnostic messages a service tool asks for.

  • Fault lists beside DM1 / DM2: DM6, DM12, DM23, DM27, DM28.
  • Readiness and counts consistent with those lists: DM5, DM21, DM26, DM29.
  • DM19, DM20, DM24, DM25 (a freeze frame captured when the first fault sets), DM31, DM33, DM34, DM56.
  • DM35 and DM42 (the active faults, as DM1), DM4 (one freeze frame), DM58 on DM7 with the rationality test identifier.
  • DM11 / DM3 clear the active / previously active faults, acknowledged when asked by address; DM22 clears one fault and answers. A fault whose cause remains sets again.
  • DM7 commands a test, answered by DM30.
  • DM14 / DM15 / DM16 read and write a 64-byte region through a seed and key (writes up to 7 bytes).
  • lib/j1939: positive Acknowledgment, PDU1 messages to the requester, reply-only messages, on_request / on_pg callbacks.

DM1, DM2, their timing and every periodic message are unchanged; VI stays unsupported as the NACK probe.

How tested (final commit):

  • just test-bench j1939 can-full/build/full.elf (Renode): 44 passed (22 existing tests untouched, 22 new).
  • just hil ... can0 j1939 on the board: 44 passed.
  • The other CAN suites of the full image on the same board (xcp uds obd canopen autosar full): 108 passed, 4 skipped.
  • just twister: 75 of 75 test cases passed, no warnings. Image: flash 211 KB of 2 MB, RAM 179 KB of 512 KB.

Notes: layouts as implemented by public MIT-licensed J1939 stacks. The node uses all 8 extended receive filters of the board's CAN controller, so one more addressed PGN needs a wider filter first. The node keeps one answer per kind of command in each 50 ms pass.

…, memory access

The genset answers the diagnostic messages a service tool asks for:

- Fault lists beside DM1 / DM2: DM6, DM12, DM23, DM27, DM28, from the same
  two faults by membership (pending, emission-related, permanent).
- Readiness and counts consistent with those lists: DM5, DM21, DM26, DM29.
- DM19 calibration, DM20 monitor ratios, DM24 supported SPNs, DM25 a freeze
  frame captured when the first fault sets, DM31 lamps per fault, DM33,
  DM34, DM56.
- DM11 / DM3 clear the active / previously active faults, acknowledged
  when asked by address; DM22 clears one fault and answers; a fault whose
  cause remains sets again on the next pass.
- DM7 commands a test, answered by DM30.
- DM14 / DM15 / DM16 read and write a 64-byte region through a seed and key.

lib/j1939: a positive Acknowledgment beside the NACK, PDU1 messages sent to
the requester (RTS/CTS when over 8 bytes), reply-only messages, and
on_request / on_pg callbacks for requests and commands addressed to the node.

DM1 and DM2, their timing and every periodic message are as before. The
suite grows to 43 tests; the README lists what the node answers, the
memory map and the key.
… queue is full; timers stop at their top

- The DM5 / DM21 / DM26 / DM29 / DM34 signals in genset.dbc take short names
  of their own (ActiveDtcCount, TimeSinceClear, NoxControlArea, ...); the
  codec is regenerated.
- A DM3 / DM11 request that finds the command queue full is left untaken,
  so one sent to the node is NACKed instead of silently dropped.
- The time-since counters saturate instead of wrapping after 49 days.
- README: boost pressure control is the monitor sent as not complete; one
  answer per kind of command in each 50 ms pass.
- DM35 and DM42 list the active DTCs, as DM1.
- DM4: one freeze frame, the coolant fault's of the node's history from
  boot, then that of the first DTC to set.
- DM7 with the rationality test identifier (245) is answered by DM58 with
  the SPN's data as its PG carries it.

The suite grows to 44 tests.
@tkeairns
tkeairns merged commit e32535d into main Nov 26, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant