Home Learning Paths ECU Lab Assessments Interview Preparation Arena Pricing Log In Sign Up

Vector vFlexRay Cluster Definition

ParameterValueNotes
gdCycle2 ms2000 µs communication cycle
gNumberOfStaticSlots50Slots 1–50 reserved for static assignment
gdStaticSlot2500 ns2.5 µs per static slot
gPayloadLengthStatic12 words (24 bytes)All slots carry up to 24 bytes
Data rate10 MbpsPer channel (A and B)
Cold-start nodeECU_A (Slot 1)First node to transmit after wakeup
Sync nodesECU_A (Slot 1), ECU_B (Slot 2)Minimum 2 sync nodes required
Shellvflexray_export_fibex.sh
# Vector vFlexRay: define cluster, assign slots, export FIBEX for CANoe
# (typically done via vFlexRay GUI — equivalent CLI workflow shown)

vflexray_cli --create-cluster FlexRay_Cluster_0     --gdCycle 2000     --gNumStaticSlots 50     --gdStaticSlot 2500     --gPayloadLength 12     --data-rate 10

# Assign nodes to slots
vflexray_cli --assign-slot 1 --node ECU_A --channel AB --coldstart --sync
vflexray_cli --assign-slot 2 --node ECU_B --channel AB --sync
vflexray_cli --assign-slot 3 --node ECU_C --channel AB
vflexray_cli --assign-slot 4 --node ECU_A --channel A   # Channel A only (non-redundant)

# Export FIBEX for CANoe import
vflexray_cli --export-fibex FlexRay_Cluster_0.xml

CANoe FlexRay Simulation

CAPLflexray_monitor.can
/* CANoe CAPL: monitor FlexRay cluster status and slot activity */
variables {
    int sync_frame_count  = 0;
    int normal_active_seen = 0;
}

/* Triggered when FlexRay CC enters NORMAL_ACTIVE state */
on flexrayPOCState FR_POCSTATE_NORMAL_ACTIVE {
    if (!normal_active_seen) {
        normal_active_seen = 1;
        write("FlexRay cluster SYNCHRONISED at t=%.1f ms", timeNow()/100000.0);
    }
}

/* Monitor sync frame reception */
on flexrayFrame * {
    if (this.syncFrame) {
        sync_frame_count++;
        if (sync_frame_count % 1000 == 0) {
            write("Sync frames received: %d (%.0f per second)",
                  sync_frame_count, sync_frame_count / (timeNow()/1e8));
        }
    }
}

/* Detect slot errors */
on flexraySlotStatus * {
    if (this.errorFlag) {
        write("Slot error: slot=%d cycle=%d channel=%s",
              this.slotId, this.cycleCount,
              this.channel == FR_CHANNEL_A ? "A" : "B");
    }
}

Slot Timing Verification

Verification MethodToolPass Criterion
Slot monitor (colour-coded)CANoe FlexRay StatisticsAll assigned slots green; unassigned slots grey; no red (collision/error) slots
Synchronised state indicatorCANoe FlexRay StatisticsStatus = Synchronised within 200 ms of startup
Oscilloscope on TXD/RXD pinsAny oscilloscope + FlexRay triggerSlot boundaries visible; inter-frame gaps match NIT timing
Active star monitorTJA1080A monitor portAll branches show consistent signal amplitude; no branch powered-down
Cycle counter in traceCANoe FlexRay trace windowCycle counter increments monotonically; no missed cycles

Adding a New Message: Steering Angle

Pythonadd_new_flexray_message.py
# Exercise: add steering_angle to FlexRay cluster
# Requirements: 16 bytes, 5 ms rate (every 2nd cycle of a 2 ms cluster)

import vflexray_api as vfr

cluster = vfr.LoadCluster("FlexRay_Cluster_0.xml")

# Check slot 5 is free
slot = cluster.GetSlot(5)
assert slot.node is None, f"Slot 5 already assigned to {slot.node}"

# Assign: ECU_EPS in slot 5, Channel A+B, every 1st and 2nd cycle
cluster.AssignSlot(
    slot_id=5,
    node="ECU_EPS",
    channel=vfr.CHANNEL_AB,
    cycle_repetition=2,     # transmit every 2nd cycle (→ 5 ms effective rate)
    cycle_base_offset=0,    # start transmitting from cycle 0
)

# Add I-PDU mapping
cluster.AddPDU(
    slot_id=5,
    pdu_name="SteeringAngle_PDU",
    start_byte=0,
    length=16,  # 16 bytes; fits in 24-byte slot
)

# Verify no slot conflicts
conflicts = cluster.ValidateSlotMatrix()
assert len(conflicts) == 0, f"Slot conflicts: {conflicts}"

# Re-export FIBEX
cluster.ExportFIBEX("FlexRay_Cluster_0_updated.xml")
print("SteeringAngle added to slot 5 — re-import FIBEX in CANoe")

Summary

FlexRay schedule configuration in vFlexRay produces a FIBEX file that serves as the single source of truth for all CANoe simulations, AUTOSAR FrIf ARXML generation, and hardware node configuration. Adding a new signal requires checking slot availability, setting cycle repetition for the required rate, and re-exporting FIBEX. Verify in CANoe that the new slot appears green in the slot monitor and the PDU decodes correctly before releasing the FIBEX to the team.

🔬 Deep Dive — Core Concepts Expanded

This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.

Key principles to reinforce:

  • Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
  • Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
  • Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.

🏭 How This Topic Appears in Production Projects

  • Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
  • Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
  • Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.

⚠️ Common Mistakes and How to Avoid Them

  1. Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
  2. Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
  3. Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
  4. Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.

📊 Industry Note

Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.

← PreviousFlexRay Communication Cycle DesignNext →SOME/IP Protocol Fundamentals