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

On-SoC Gateway Topology: Classic + Adaptive on Same SoC

Modern SoCs (Renesas R-Car H3, NXP S32G) integrate Cortex-R cores for Classic CP and Cortex-A cores for Adaptive AP on the same die. The inter-domain IPC bridge uses a shared memory region with defined ownership per domain — no hypervisor required for data exchange.

On-SoC Classic ↔ Adaptive Gateway
  Cortex-R Core 0 (AUTOSAR Classic)          Cortex-A Core (AUTOSAR Adaptive)
  ┌─────────────────────────────────┐         ┌────────────────────────────────┐
  │ AUTOSAR Classic BSW             │         │ AUTOSAR Adaptive Middleware     │
  │  CAN Rx → COM signal buffer     │         │  SOME/IP skeleton: SpeedSvc     │
  │  Gateway SWC:                   │         │  ara::com::EventSendHandler     │
  │    Com_ReceiveSignal(SPEED, &v) │         │  SpeedSvc_Skeleton::Send()      │
  │    Serialize → SOME/IP payload  │         └────────────────┬───────────────┘
  │    Write to shared SRAM region  │                          │ Reads shared SRAM
  └────────────────┬────────────────┘                          │ via IPC bridge
                   │ Writes to shared SRAM                     │
                   └──────────── Shared SRAM (0x40000000) ─────┘
                                  (write: Classic owns; read: Adaptive)
                                  Protected by hardware semaphore or spinlock
SoC PlatformClassic CoresAdaptive CoresIPC Mechanism
Renesas R-Car H32× Cortex-R74× Cortex-A57ICCOM shared memory + hardware semaphore
NXP S32G34× Cortex-M7 + 2× Cortex-R524× Cortex-A53MU (Message Unit) + shared DDR
STM32MP252× Cortex-M331× Cortex-A35OpenAMP RPMsg over shared SRAM

Data Path: Classic COM → SOME/IP Serialization

CGateway_Classic_to_SOMEIP.c
/* Gateway SWC: Classic side (runs as BSW SWC on Cortex-R) */
FUNC(void, GW_CODE) Gateway_SpeedToSomeIP_Runnable(void)
{
    uint16 speedRaw;
    SomeIP_SpeedEvent_t payload;

    /* 1. Read signal from COM (populated by CanIf → PduR → COM) */
    (void)Com_ReceiveSignal(COM_SIG_VEHICLE_SPEED, &speedRaw);

    /* 2. Serialize to SOME/IP payload format */
    /* SOME/IP: 4-byte header (MsgID, Length, RequestID, ProtoVer) + payload */
    payload.header.messageId   = SOMEIP_MSG_ID_SPEED_EVENT;
    payload.header.length      = sizeof(SomeIP_SpeedPayload_t) + 8;
    payload.header.returnCode  = 0x00; /* E_OK */
    payload.data.vehicleSpeed  = speedRaw; /* Big-endian in SOME/IP */
    payload.data.timestamp_ms  = GetSystemTime_ms();

    /* 3. Write to IPC shared memory region (owned by Classic side) */
    HwSemaphore_Acquire(HW_SEM_IPC_SPEED);
    memcpy(&ipc_shared_mem.speed_event, &payload, sizeof(payload));
    ipc_shared_mem.speed_event_new_flag = 1;
    HwSemaphore_Release(HW_SEM_IPC_SPEED);
}

Latency Budget: Classic Task → Adaptive Consumer

StageTypical LatencyWorst Case
CAN frame Rx → CanIf_RxIndication0.1 ms0.3 ms (under bus load)
CanIf → PduR → COM signal buffer0.05 ms0.1 ms
COM_MainFunctionRx cycle0–1 ms1 ms (depends on task period)
Gateway SWC runnable (5ms task)0–5 ms5 ms
IPC shared memory write + HW semaphore0.01 ms0.05 ms
Adaptive GetNewSamples() polling cycle0–10 ms10 ms (event cycle time)
Total end-to-end~8 ms nominal~17 ms worst case

⚠️ SOME/IP Event Cycle Time Drives Latency

The dominant latency contributor is the Adaptive consumer's SOME/IP event cycle time — how often it calls GetNewSamples(). A 20ms Adaptive event cycle adds up to 20ms worst-case latency regardless of how fast the Classic CAN side delivers data. For functions requiring <10ms end-to-end latency, the Adaptive polling rate must be tuned accordingly — at the cost of higher CPU load on the Cortex-A core.

Error Propagation Across Domains

Error Path: Classic Fault → Adaptive Safe State
  Classic Domain                           Adaptive Domain
  ─────────────────────────────────────────────────────────
  CanSM: bus-off on CAN1
       │ COM_InvalidateSignal(SPEED_SIG)
       │ DEM event: CAN1_BusOff
       ▼
  Gateway SWC:
    Com_ReceiveSignal returns RTE_E_COM_STOPPED
    → sets ipc_shared_mem.speed_validity = INVALID
    → HW semaphore write
                                           Adaptive SpeedService proxy:
                                             GetNewSamples() → E2E check FAILS
                                             (validity flag = INVALID)
                                             → SamplePtr status = kInvalid
                                             → ProcessingApp: apply safe default
CppAdaptive_SpeedConsumer.cpp
void SpeedProcessingApp::SpeedEventReceived(
    const ara::com::SamplePtr& sample)
{
    // Check E2E status from SOME/IP serialization
    if (sample.GetE2ECheckStatus() == ara::com::e2e::ProfileCheckStatus::kOk) {
        currentSpeed_ = sample->vehicleSpeed;
        ApplySpeedDependentFunction(currentSpeed_);
    } else {
        // E2E or validity failure from Classic domain
        ApplySafeDefault();
        ara::log::LogError() << "SpeedEvent E2E failure — safe state applied";
    }
}

Summary

Classic ↔ Adaptive gateway design must address three concerns: data path (COM signal → SOME/IP serialization → IPC shared memory), latency budget (Classic task period + gateway period + Adaptive polling = worst-case E2E), and error propagation (Classic bus-off → COM invalidation → SOME/IP validity flag → Adaptive safe state). All three must be explicitly designed, documented, and tested — error propagation is the most commonly missed in gateway implementations.

🔬 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.

← PreviousHands-On: Production Build PipelineNext →SOME/IP to Classic Signal Mapping