flync_4_bus
The flync_4_bus module defines the physical communication buses
that carry Frames across the vehicle network.
Each bus configuration file lives in its own sub-folder under
communication/channels/ and contains the bus-level parameters, the
participating nodes, and the full list of frames transmitted on that
bus.
Hint
Frames referenced inside a bus configuration are defined inline
within the bus YAML file. They reference PDUs by name
(pdu_ref) β the PDU definitions themselves live in
communication/channels/pdus/ (see PDU).
CAN Bus
Expand for Schematic
classDiagram
class Category {
<<Enumeration>>
VALUE_RANGE: int = 1
REQUIRED: int = 2
CONSISTENCY: int = 3
UNIQUENESS: int = 4
REFERENCE: int = 5
FORMAT: int = 6
COMPATIBILITY: int = 7
STRUCTURAL: int = 8
LIFECYCLE: int = 9
}
class CANBus {
name: str
description: str | None = None
version: str = ''
baud_rate: int
fd_enabled: bool = False
fd_baud_rate: int | None = None
frames: list[CANFrame | CANFDFrame] = list
state_memberships: list[StateMembershipRef] | None = list
}
class CANFrame {
name: str
length: int
frame_usage: Literal['application', 'bap', 'diag_request', 'diag_response', 'diag_state', 'network_management', 'other', 'service', 'tpl', 'xcp_pre_configured', 'xcp_runtime_configured'] | None = None
description: str | None = None
packed_pdus: list[PDUInstance] = list
can_id: int
id_format: Literal['standard_11bit', 'extended_29bit']
timing: FrameTransmissionTiming | None = None
type: Literal['can'] = 'can'
is_remote_frame: bool = False
}
class CANFDFrame {
name: str
length: int
frame_usage: Literal['application', 'bap', 'diag_request', 'diag_response', 'diag_state', 'network_management', 'other', 'service', 'tpl', 'xcp_pre_configured', 'xcp_runtime_configured'] | None = None
description: str | None = None
packed_pdus: list[PDUInstance] = list
can_id: int
id_format: Literal['standard_11bit', 'extended_29bit']
timing: FrameTransmissionTiming | None = None
type: Literal['can_fd'] = 'can_fd'
bit_rate_switch: bool = True
error_state_indicator: bool = False
}
class FLYNCBaseModel {
}
class StateMembershipRef {
group: str
role: Literal['participant', 'observer'] = 'participant'
relevance_bits: list[str] | None = None
extensions: dict[str, str] | None = None
}
CANFDFrame ..> FrameTransmissionTiming
CANFDFrame ..> PDUInstance
CANFrame ..> FrameTransmissionTiming
CANFrame ..> PDUInstance
CANBus ..> CANFDFrame
CANBus ..> CANFrame
CANBus ..> StateMembershipRef
Expand for a YAML example - π communication/channels/can/<bus_name>.flync.yaml
Note
Each CAN or CAN FD bus is stored in its own .flync.yaml
file under communication/channels/can/. The bus identity comes
from the name field inside the file, not from the file name.
This directory is optional β omit it when the system has no
CAN buses.
name: PowertrainCAN
description: 500 kbit/s classical CAN bus carrying engine, transmission, and vehicle dynamics signals.
version: "1.0"
baud_rate: 500000
frames:
# --------------------------------------------------------------------------
# Frame: EngineStatus (0x101, 8 bytes, EngineECU -> HPC + TransmissionECU)
# --------------------------------------------------------------------------
- name: Frame_EngineStatus
type: can
description: Engine speed, torque, temperature and state from EngineECU.
length: 8
can_id: 257 # 0x101
id_format: standard_11bit
packed_pdus:
- pdu_ref: PDU_EngineStatus
bit_position: 0
timing:
cyclic_timings:
- cycle: 0.010
event_timings: []
# --------------------------------------------------------------------------
# Frame: VehicleDynamics (0x201, 6 bytes, EngineECU -> HPC + others)
# --------------------------------------------------------------------------
- name: Frame_VehicleDynamics
type: can
description: Vehicle speed and lateral acceleration from EngineECU.
length: 6
can_id: 513 # 0x201
id_format: standard_11bit
packed_pdus:
- pdu_ref: PDU_VehicleDynamics
bit_position: 0
timing:
cyclic_timings:
- cycle: 0.020
event_timings: []
# --------------------------------------------------------------------------
# Frame: TransmissionStatus (0x301, 8 bytes, multiplexed PDU)
#
# Bits [0..3] = GearInfoMux selector (DBC: M)
# Mux value 0 = gear position data
# Mux value 1 = torque converter data
# --------------------------------------------------------------------------
- name: Frame_TransmissionStatus
type: can
description: Transmission status from TransmissionECU, multiplexed on GearInfoMux.
length: 8
can_id: 769 # 0x301
id_format: standard_11bit
packed_pdus:
- pdu_ref: PDU_TransmissionStatus
bit_position: 0
timing:
cyclic_timings:
- cycle: 0.020
event_timings:
- final_repetitions: 3
repeating_time_range: 0.005
-
class CANBus
Bases: FLYNCBaseModel
CAN bus configuration.
Parameters
- namestr
Unique name of the CAN bus.
- descriptionstr, optional
Optional human-readable description.
- versionstr
Version string. Defaults to "".
- baud_rateint
Nominal bit rate in bits/s. Must be one of: 10 000, 20 000, 50 000, 100 000, 125 000, 250 000, 500 000, or 1 000 000.
- fd_enabledbool
Whether CAN FD is enabled on this bus. Defaults to False.
- fd_baud_rateint, optional
Data-phase bit rate in bits/s. Required when fd_enabled is True; must be None otherwise. Must be one of: 2 000 000,
4 000 000, 5 000 000, or 8 000 000.
- frameslist of
CANFrame | CANFDFrame Frames transmitted on this bus. CANFDFrame entries are only permitted when fd_enabled is True.
- state_membershipslist of
StateMembershipRef, optional Assignments of this bus to a state management group. A bus membership enrols the whole bus as one participant β the entire bus
stays awake or sleeps as a unit, never expanded into per-attached-node participants. It contributes one relevance bit by default
(the bus name) and may reference several when the bus serves several functions. On CAN you may instead give the individual nodes
their own memberships for selective, per-function participation.
LIN Bus
Expand for Schematic
classDiagram
class LINScheduleEntry {
frame_name: str
period: float
}
class Category {
<<Enumeration>>
VALUE_RANGE: int = 1
REQUIRED: int = 2
CONSISTENCY: int = 3
UNIQUENESS: int = 4
REFERENCE: int = 5
FORMAT: int = 6
COMPATIBILITY: int = 7
STRUCTURAL: int = 8
LIFECYCLE: int = 9
}
class LINScheduleTable {
name: str
description: str | None = None
entries: list[LINScheduleEntry] = list
}
class LINFrame {
name: str
length: int
frame_usage: Literal['application', 'bap', 'diag_request', 'diag_response', 'diag_state', 'network_management', 'other', 'service', 'tpl', 'xcp_pre_configured', 'xcp_runtime_configured'] | None = None
description: str | None = None
packed_pdus: list[PDUInstance] = list
type: Literal['lin'] = 'lin'
lin_id: int
checksum_type: Literal['classic', 'enhanced'] = 'enhanced'
timing: FrameTransmissionTiming | None = None
}
class LINBus {
name: str
description: str | None = None
lin_protocol_version: Literal['1.3', '2.0', '2.1', '2.2A']
lin_language_version: Literal['1.3', '2.0', '2.1', '2.2A']
baud_rate: int
channel_name: str | None = None
time_base: float = 5.0
jitter: float = 0.0
schedule_tables: list[LINScheduleTable] = list
frames: list[LINFrame] = list
state_memberships: list[StateMembershipRef] | None = list
}
class FLYNCBaseModel {
}
class StateMembershipRef {
group: str
role: Literal['participant', 'observer'] = 'participant'
relevance_bits: list[str] | None = None
extensions: dict[str, str] | None = None
}
LINFrame ..> FrameTransmissionTiming
LINFrame ..> PDUInstance
LINScheduleTable ..> LINScheduleEntry
LINBus ..> LINScheduleTable
LINBus ..> StateMembershipRef
LINBus ..> LINFrame
Expand for a YAML example - π communication/channels/lin/<bus_name>.flync.yaml
Note
Each LIN bus is stored in its own .flync.yaml file under
communication/channels/lin/. A LIN bus must have exactly one
master node and any number of slave nodes. Schedule tables
reference frames by name β all frame names used in
schedule_tables must be defined in frames.
This directory is optional β omit it when the system has no
LIN buses.
name: BodyLIN
description: LIN 2.2A body bus managed by ZonalPlatform1. Controls exterior mirrors and cabin ambient lighting.
lin_protocol_version: "2.2A"
lin_language_version: "2.2A"
baud_rate: 19200
channel_name: LIN1
time_base: 5.0
jitter: 0.5
frames:
- name: Frame_MirrorLeftStatus
type: lin
description: Left mirror horizontal and vertical position.
length: 2
lin_id: 1
checksum_type: enhanced
packed_pdus:
- pdu_ref: PDU_MirrorLeft
bit_position: 0
- name: Frame_MirrorRightStatus
type: lin
description: Right mirror horizontal and vertical position.
length: 2
lin_id: 2
checksum_type: enhanced
packed_pdus:
- pdu_ref: PDU_MirrorRight
bit_position: 0
- name: Frame_CabinLightStatus
type: lin
description: Cabin light level and mode.
length: 2
lin_id: 5
checksum_type: enhanced
packed_pdus:
- pdu_ref: PDU_CabinLight
bit_position: 0
schedule_tables:
- name: NormalSchedule
description: Normal operation β mirrors and light polled every 20 ms.
entries:
- frame_name: Frame_MirrorLeftStatus
period: 20.0
- frame_name: Frame_MirrorRightStatus
period: 20.0
- frame_name: Frame_CabinLightStatus
period: 20.0
- name: MirrorAdjustSchedule
description: High-rate mirror polling during active adjustment.
entries:
- frame_name: Frame_MirrorLeftStatus
period: 10.0
- frame_name: Frame_MirrorRightStatus
period: 10.0
# Bus-level membership on the Comfort function. LIN carries NO NM message and
# no relevance vector β the LIN master (zonal_platform1) learns the vehicle NM
# state on Ethernet and unilaterally sleeps/wakes this bus. The bus therefore
# participates as one bit; its representative (the master) is derived by
# validation, never a frame on LIN.
state_memberships:
- group: VEHICLE
role: participant
relevance_bits: [Comfort]
-
class LINBus
Bases: FLYNCBaseModel
LIN bus configuration.
Models the complete LIN bus, including the protocol header information needed for LDF file generation,
the schedule tables, and the set of frames on the bus. Node participation (master/slave role, NAD,
timing parameters) is declared on the controllerβs LIN interface, not here.
LDF file mapping:
lin_protocol_version β LIN_protocol_version
lin_language_version β LIN_language_version
baud_rate β LIN_speed (bits/s)
channel_name β Channel_name
time_base β Time_base (ms)
jitter β Jitter (ms)
frames β Frames section
schedule_tables β Schedule_tables section
Signal encoding types and Signal_representation are derived from the Signal.factor, Signal.offset,
Signal.lower_limit, Signal.upper_limit, Signal.unit, and Signal.value_encoding fields during LDF export.
Parameters
- namestr
Unique name of the LIN bus.
- descriptionstr, optional
Optional human-readable description.
- lin_protocol_versionLiteral[β1.3β, β2.0β, β2.1β, β2.2Aβ]
LIN protocol version for the LIN_protocol_version LDF header field.
- lin_language_versionLiteral[β1.3β, β2.0β, β2.1β, β2.2Aβ]
LIN description language version for the LIN_language_version LDF header field.
- baud_rateint
Bus bit rate in bits/s.
Must be one of the standard LIN baud rates: 1 200, 2 400, 4 800, 9 600, 10 400, or 19 200 bits/s.
Written as-is to the LDF LIN_speed field.
- channel_namestr, optional
Optional LIN channel name for the LDF Channel_name field.
- time_basefloat
Scheduling time base in milliseconds.
Defaults to 5.0. Corresponds to the LDF Time_base field.
- jitterfloat
Maximum scheduling jitter in milliseconds.
Defaults to 0.0. Corresponds to the LDF Jitter field.
- schedule_tableslist of
LINScheduleTable Named schedule tables for the LDF Schedule_tables section.
- frameslist of
LINFrame Unconditional LIN frames for the LDF Frames section.
- state_membershipslist of
StateMembershipRef, optional Assignments of this bus to a state management group. A bus membership enrols the whole bus as one participant β the entire bus
stays awake or sleeps as a unit, never expanded into per-attached-node participants. It contributes one relevance bit by default
(the bus name) and may reference several when the bus serves several functions. LIN has no per-node NM, so a LIN bus always
participates as a whole.
Schedule Tables
-
class LINScheduleTable
Bases: FLYNCBaseModel
LIN schedule table.
A named sequence of frame transmissions with associated slot periods.
Corresponds to a single Schedule_tables entry in the LDF file.
Parameters
- namestr
Unique name of the schedule table.
- descriptionstr, optional
Optional human-readable description.
- entrieslist of
LINScheduleEntry Ordered list of frame-slot entries.
-
class LINScheduleEntry
Bases: FLYNCBaseModel
Single entry in a LIN schedule table.
Each entry specifies a frame to be transmitted and the slot period after which the next frame is scheduled.
Parameters
- frame_namestr
Name of the LINFrame to transmit.
Must reference a frame present in the owning LINBus.
Corresponds to the frame name in the LDF Schedule_tables entry.
- periodfloat
Slot period in milliseconds.
Corresponds to delay <period> ms in the LDF Schedule_tables block.
Must be greater than zero.