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

Three-App Architecture

Capstone System Architecture
  SensorApp (50 Hz SOME/IP producer)
      │ ImuEvent (E2E P04)
      ▼
  ProcessingApp (consumer + algorithm + Field update)
      │ ProcessedResult Field (SOME/IP)
      ▼
  DiagApp (ara::diag UDS server over DoIP)
      │ Reports ProcessingHealth DTC
      ▼
  External OBD Tester (Ethernet DoIP)

  State Manager (always running in MachineFG)
      ├─ Controls SensorFG (contains SensorApp + ProcessingApp)
      └─ Controls DiagFG  (contains DiagApp)

  PHM monitors ProcessingApp via Alive Supervision
      └─ RecoveryAction → SM → restart SensorFG

💡 Capstone Goals

  • Build all three apps with correct ara::core lifecycle
  • Wire all manifests: Application, Service Instance, Machine
  • Test FG start/stop via SM trigger
  • Verify PHM supervision failure triggers restart
  • Package and OTA deploy ProcessingApp update

Full Manifest Set

JSONmachine_manifest_capstone.json
{
  "functionGroups": [
    {"shortName": "MachineFG", "states": ["Off","Startup","Driving","Shutdown"]},
    {"shortName": "SensorFG",  "states": ["Inactive","Active"]},
    {"shortName": "DiagFG",    "states": ["Inactive","Active"]}
  ],
  "doipConfig": {"logicalAddress": "0x0E80", "networkInterface": "eth0"}
}
JSONsensor_app_manifest.json
{
  "shortName": "SensorApp",
  "executable": {"path": "bin/SensorApp",
    "startupConfig": {"schedulingPolicy": "FIFO", "schedulingPriority": 70,
                      "startupTimeout": 3000, "shutdownTimeout": 1500}},
  "functionGroupStateMembership": [
    {"functionGroup": "SensorFG", "states": ["Active"]}
  ]
}

PHM + SM Integration

C++capstone_phm_sm.cpp
// ProcessingApp: report alive checkpoint every 20 ms
while (running) {
    auto result = RunAlgorithm(GetSensorData());
    skel.ProcessedResult.Update(result);

    supervision.ReportCheckpoint(ara::phm::CheckpointId{1});
    std::this_thread::sleep_for(std::chrono::milliseconds(20));
}

// SM: handle PHM recovery for SensorFG
phm.SetRecoveryHandler([&](auto action) {
    ara::log::LogWarn() << "PHM recovery triggered: " << action;
    // Report processing fault DTC
    diagMonitor.ReportMonitorAction(ara::diag::MonitorAction::kFailed);
    // Restart SensorFG (stop then start)
    stateClient.SetState({"SensorFG"}, {"Inactive"})
    .then([&](auto) {
        stateClient.SetState({"SensorFG"}, {"Active"});
        diagMonitor.ReportMonitorAction(ara::diag::MonitorAction::kPassed);
    });
});

OTA Simulation

Shellterminal
# Step 1: Build ProcessingApp v2 with performance fix
cmake --build build/ProcessingApp

# Step 2: Package
autosar-packager --manifest manifests/ProcessingApp_v2/ \
  --binary build/ProcessingApp/bin/ProcessingApp \
  --output ProcessingApp_v2.0.0.swcl --sign oem_key.pem

# Step 3: Transfer via OTA client
./ota_client --package ProcessingApp_v2.0.0.swcl --ucm 192.168.0.10

# Step 4: Activate (stops SensorFG, replaces binary, restarts)
./ucm_ctl activate

# Step 5: Monitor health for 30 seconds, then commit
sleep 30 && ./ucm_ctl finish

# Step 6: Test rollback
./ucm_ctl rollback
# Verify ProcessingApp v1 running: ps aux | grep ProcessingApp

💡 Expected Results

After activation: SensorApp and ProcessingApp restart; ImuEvent resumes at 50 Hz; ProcessedResult Field updates resume within 3 seconds. After rollback: previous ProcessingApp binary runs; KVS state from v2 runtime is intact.

Summary

This capstone integrates every major Adaptive Platform concept: ara::com SOA, ARXML service interfaces, Execution Manager lifecycle, Function Group orchestration, PHM alive supervision, ara::diag UDS diagnostics, ara::per persistence, and UCM OTA updates — into a complete, testable Adaptive ECU application.

🎓 Course Complete

You have covered the full AUTOSAR Adaptive Platform stack from architecture fundamentals through production-grade implementation patterns. The next step is to apply these patterns on real middleware (Vector MICROSAR Adaptive, EB corbos, or APEX.AI) with an actual ADAS compute target.

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

← PreviousPerformance Profiling & Optimization