Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rather than copying them.
| `zephyr/`, `CMakeLists.txt`, `Kconfig` | This repository as a Zephyr module, contributing `lib/` |
| `nodes/` | Zephyr applications, one per node, each reusable by any bench: `vcu`, `bms`, `dcdc`, `pdu`, `console`, `motor`; `full` runs the DC-DC, the genset (its sources in `genset`, built only into `full`) and the PDU in one image |
| `lib/`, `include/zelos/` | Code the nodes share, each piece off until a node's `prj.conf` enables it. `lib/can` owns the controller: every protocol sends through its one queue, lowest id first |
| `snippets/` | Protocols any node can build with, e.g. `-S xcp`, `-S uds`, `-S autosar`, `-S ethernet`, `-S goose` |
| `snippets/` | Protocols any node can build with, e.g. `-S xcp`, `-S uds`, `-S autosar`, `-S ethernet`, `-S goose`, `-S mms` |
| `dbc/` | Wire formats of the shared nodes: `bench.dbc` (classic), `genset.dbc` (J1939), and `full.dbc`, both merged, the one file tools load; `lib/codec_<name>/` and `full.dbc` are generated by `just dbc` |
| `arxml/` | `can-full.arxml`, the can-full bench as an AUTOSAR R19-11 System Template; the DC-DC's AUTOSAR tables are generated from it (`just arxml`) |
| `toolchain/` | The firmware build image |
Expand Down
23 changes: 21 additions & 2 deletions can-full/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ same default, so run one bench at a time or move one.
|---|---|---|---|
| VCU | `../nodes/vcu` | | `0x101` |
| BMS | `../nodes/bms` | | `0x200`-`0x202` |
| DC-DC | `../nodes/full` (`../nodes/dcdc`, XCP, UDS, AUTOSAR, Ethernet and GOOSE) | XCP on CAN, UDS on ISO-TP, AUTOSAR PDUs; IPv4 and GOOSE on Ethernet | `0x300`; AUTOSAR `0x310`-`0x315`; CRO `0x6F0`, DTO `0x6F1`; UDS `0x7E0`, functional `0x7DF`, responses `0x7E8`; `10.1.1.75/24`; GOOSE APPIDs `0x0001`, `0x0002` |
| DC-DC | `../nodes/full` (`../nodes/dcdc`, XCP, UDS, AUTOSAR, Ethernet, GOOSE and MMS) | XCP on CAN, UDS on ISO-TP, AUTOSAR PDUs; IPv4, GOOSE and MMS on Ethernet | `0x300`; AUTOSAR `0x310`-`0x315`; CRO `0x6F0`, DTO `0x6F1`; UDS `0x7E0`, functional `0x7DF`, responses `0x7E8`; `10.1.1.75/24`; GOOSE APPIDs `0x0001`, `0x0002`; MMS on TCP 102 |
| Signal generator | `../nodes/full/src/waveform.c` | Classic CAN | `0x7F0` `Waveform` every 2 ms: sine, square and sawtooth of one phase, chirped 1 to 100 Hz over 20 s; the lowest-priority id, for plots |
| genset | `../nodes/full` (`../nodes/genset`) | J1939 | 29-bit, source address `0x80` |
| PDU | `../nodes/full` (`../nodes/pdu`) | CANopen, node-id `0x20` | NMT `0x000`, SYNC `0x080`, TIME `0x100`, EMCY `0x0A0`, TPDO1 `0x1A0`, RPDO1 `0x220`, TPDO2 `0x2A0`, RPDO2 `0x320`, TPDO3 `0x3A0`, SDO `0x5A0`/`0x620`, heartbeat `0x720` |
Expand Down Expand Up @@ -105,6 +105,24 @@ both control blocks: `0x01` toggles simulation, `0x02` toggles ndsCom, `0x03`
adds one to confRev. Any capture tool on a host on the same switch shows them,
e.g. `tcpdump -i <iface> ether proto 0x88b8`, or Wireshark's GOOSE dissector.

The same logical device is served over IEC 61850-8-1 MMS on TCP 102 (`../lib/mms`,
`../nodes/full/src/mms.c`), to two clients at once, without TLS or
authentication. `../nodes/full/zelosfull.cid` is its station file. Each data
object reads with its value, quality and time: `XSWI1`-`XSWI8` `Pos`,
`PTRC1`-`PTRC8` `Tr`, `EmcyGGIO1` `IntIn1` for the PDU; `OutMMDC1` `Vol` and
`Amp`, `InMMDC1` `Amp`, `STMP1` `Tmp`, `CycGGIO1` `CntVal1` for the DC-DC. The
data sets are GOOSE's own, one report control block each:

| Report control block | Kind | Data set | Reports |
|---|---|---|---|
| `LLN0$BR$brcb_pdu01` | buffered | `ds_pdu` | a PDU change as it happens; the last 32 kept while no client is connected and replayed to one that resumes from its last EntryID |
| `LLN0$RP$urcb_dcdc01` | unbuffered | `ds_dcdc` | the DC-DC's members that moved, every 100 ms |

Both start with data change, quality change and general interrogation as
triggers and no integrity period; a client sets its own. The node has no clock:
time stamps are time since boot, flagged clock not synchronized. No controls,
files or setting groups.

As an AUTOSAR ECU it sends what `../arxml/can-full.arxml` (an AUTOSAR R19-11
System Template of this bench, `bench.dbc` included) describes: E2E profiles 1,
2 and 5, a container with short headers, a multiplexed PDU and a SecOC profile 1
Expand Down Expand Up @@ -225,6 +243,7 @@ limit, `0x1003` for a wrong key, `0x1` for any other command.
| `../testing/suites/doip` | DC-DC | Its UDS server as a DoIP entity (ISO 13400-2, `../lib/doip`), checked with a client written from the standard and with zelos-can's (doipclient), as the UDS and OBD extensions connect: vehicle identification by plain request, EID and VIN, answered within 500 ms, and one responder to a broadcast; entity status, power mode, header NACKs; routing activation's codes (0x10, 0x00, 0x02, 0x03 and 0x01 decided by alive checks, 0x06), initial inactivity; diagnostic messages acknowledged, NACKed (0x02, 0x03, 0x04 above MDS) or answered; three announcements 500 ms apart after a reset. The UDS conformance suite, unchanged, over DoIP. One server, two transports: a CAN tester's session gives the DoIP tester 0x21 and only OBD, and S3 still ends it; a closed DoIP owner's output returns at once; a pending routine answers its own tester. Core: ztests in `../tests/lib/doip` |
| `../testing/suites/someip` | DC-DC | Its SOME/IP service (DcdcService `0x5A00`, `../lib/someip`) and its SD, checked with a client written from the PRS: offers every second with TTL 3 and the service's UDP endpoint (where the SD group reaches the host: on this bench, not on the hardware bench, whose switch forwards it to IGMPv2 members only); FindService answered unicast within 100 ms; a subscription acknowledged, the Setpoint field's value at once, then DcdcStatus every 100 ms with none missing, each equal, within the frame's resolution, to the DCDC_Status of the same Counter; the getter equal to DID `0x0200`, and the notifier within 150 ms of a write over UDS; 0x28 stops the events, not SD or the getter; error codes; StopOffer at a reset, and the Reboot flag after it. Core: ztests in `../tests/lib/someip` |
| `../testing/suites/goose` | DC-DC, PDU | Its GOOSE (`../lib/goose`) captured raw on the host interface on the node's subnet and decoded by a BER walk written from IEC 61850-8-1 Annex A: both control blocks with their destinations, references, goID and data set sizes; timeAllowedtoLive twice the period, or one of the on-change ladder's; stNum and sqNum in sequence, none missed; `gcb_dcdc` every 100 ms (within 5 % on hardware). Needs CAP_NET_RAW, which the bench's tester has. Core: ztests in `../tests/lib/goose` |
| `../testing/suites/mms` | DC-DC, PDU | Its MMS server (`../lib/mms`) with an MMS client on the host: the data sets and report control blocks the station file declares; a data object read with its quality and time; the unbuffered block reporting the DC-DC every 100 ms, none missed; a PDU channel switched over CANopen reported by the buffered block, and a change made while no client was connected replayed to the client that resumes. Core: ztests in `../tests/lib/mms` |
| `../testing/suites/full` | all three | Every protocol at once for `--soak-s` (120 s here, 10 s on hardware): XCP DAQ, a UDS 64 KiB download and upload loop, CANopen operational with SYNC every 10 ms and RPDO1, J1939 and DCDC_Status. No EMCY, no DAQ sample lost, periods kept, and the node's counters (UDS DID `0x0110`) show no TX queue overflow, TX error or RX FIFO overrun |

The suites drive the other nodes' roles themselves when those nodes are absent,
Expand All @@ -233,7 +252,7 @@ Every test sets its own preconditions over the bus rather than assuming a fresh
boot.

`just test`, and CI on every change, run the core: xcp, j1939, canopen, autosar,
eth, the DoIP entity, goose and the coexistence suite, one boot and each protocol
eth, the DoIP entity, goose, mms and the coexistence suite, one boot and each protocol
touched once. The rest (UDS conformance on CAN and over DoIP, DTCs and resets,
DoIP arbitration, SOME/IP, OBD) run with `just test-all`, on hardware with
`just hil`, and on CI for a pull request labelled `ci-full`, on demand, and
Expand Down
4 changes: 2 additions & 2 deletions can-full/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ NODES := "vcu bms full"
# Each node with a suite, as node:suite, in the order they run. `just test-all`
# runs every suite on the bench; `just hil` runs one node's. full's
# coexistence suite runs every protocol at once.
SUITES := "full:xcp full:uds full:obd full:j1939 full:canopen full:autosar full:eth full:doip full:someip full:goose full:full"
SUITES := "full:xcp full:uds full:obd full:j1939 full:canopen full:autosar full:eth full:doip full:someip full:goose full:mms full:full"
# The core: one boot, each protocol touched once, then every protocol at once.
# `just test` and CI run these on every change; the rest (UDS conformance on
# CAN and DoIP, DTCs and resets, DoIP arbitration, SOME/IP, OBD) run while that
# area is worked on, on hardware (`just hil`) and on CI by label or on schedule.
CORE := "full:xcp full:j1939 full:canopen full:autosar full:eth full:doip/test_entity.py full:goose full:full"
CORE := "full:xcp full:j1939 full:canopen full:autosar full:eth full:doip/test_entity.py full:goose full:mms full:full"

# The firmware is built by the repository's shared recipes, one level up.
FIRMWARE := quote(just_executable()) + " --justfile " + quote(justfile_directory() / ".." / "justfile")
Expand Down
Loading
Loading