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 general/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 general/channels/pdus/ (see PDU).

CAN Bus

Expand for Schematic
        classDiagram

    class CANFrame {
        name: str
        length: int
        frame_usage: str | None = None
        description: str | None = None
        can_id: int
        id_format: Literal['standard_11bit', 'extended_29bit']
        packed_pdus: list[PDUInstance] = list
        timing: FrameTransmissionTiming | None = None
        type: Literal['can'] = 'can'
        is_remote_frame: bool = False
    }

    class UniqueName {
        name: str
    }

    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
    }

    class CANFDFrame {
        name: str
        length: int
        frame_usage: str | None = None
        description: str | None = None
        can_id: int
        id_format: Literal['standard_11bit', 'extended_29bit']
        packed_pdus: list[PDUInstance] = list
        timing: FrameTransmissionTiming | None = None
        type: Literal['can_fd'] = 'can_fd'
        bit_rate_switch: bool = True
        error_state_indicator: bool = False
    }

    CANFDFrame ..> FrameTransmissionTiming
    CANFDFrame ..> PDUInstance
    CANFrame ..> FrameTransmissionTiming
    CANFrame ..> PDUInstance
    CANBus ..> CANFrame
    CANBus ..> CANFDFrame


    
Expand for a YAML example - 📄 general/channels/can/<bus_name>.flync.yaml

Note

Each CAN or CAN FD bus is stored in its own .flync.yaml file under general/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: UniqueName

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.

LIN Bus

Expand for Schematic
        classDiagram

    class UniqueName {
        name: str
    }

    class FLYNCBaseModel {
    }

    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
    }

    class LINScheduleEntry {
        frame_name: str
        period: float
    }

    class LINScheduleTable {
        name: str
        description: str | None = None
        entries: list[LINScheduleEntry] = list
    }

    class LINFrame {
        name: str
        length: int
        frame_usage: str | None = None
        description: str | None = None
        type: Literal['lin'] = 'lin'
        lin_id: int
        checksum_type: Literal['classic', 'enhanced'] = 'enhanced'
        packed_pdus: list[PDUInstance] = list
        timing: FrameTransmissionTiming | None = None
    }

    LINFrame ..> FrameTransmissionTiming
    LINFrame ..> PDUInstance
    LINScheduleTable ..> LINScheduleEntry
    LINBus ..> LINScheduleTable
    LINBus ..> LINFrame


    
Expand for a YAML example - 📄 general/channels/lin/<bus_name>.flync.yaml

Note

Each LIN bus is stored in its own .flync.yaml file under general/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
class LINBus

Bases: UniqueName

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_versionLIN_protocol_version

  • lin_language_versionLIN_language_version

  • baud_rateLIN_speed (bits/s)

  • channel_nameChannel_name

  • time_baseTime_base (ms)

  • jitterJitter (ms)

  • framesFrames section

  • schedule_tablesSchedule_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_descriptions 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.

Schedule Tables

class LINScheduleTable

Bases: UniqueName

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.