Git commit / merge request
|
v
CI Server (Jenkins / GitLab CI)
+-- Stage 1: Build (5 min)
| +-- Compile ECU SW (GCC ARM cross-compile)
| +-- Run static analysis (MISRA check)
| +-- Run unit tests (cmocka, coverage > 90%)
| +-- Flash ECU via JTAG (or UDS programming)
|
+-- Stage 2: HIL Regression (60-120 min)
| +-- Reserve HIL rig from lab scheduler
| +-- Load plant model + rest-bus config
| +-- Run pytest HIL test suite (300 test cases)
| +-- Generate test report (HTML + MDF4 archive)
| +-- Release HIL rig
|
+-- Stage 3: Results
+-- Upload report to Polarion / JIRA
+-- Update requirements traceability matrix
+-- Block merge if any ASIL-D test fails
+-- Email notification to teamCI/CD with HIL: Architecture
Jenkins Declarative Pipeline for HIL
// Jenkins Declarative Pipeline: ECU SW build + HIL regression
pipeline {
agent { label "build-server" }
environment {
ECU_SW_VERSION = sh(script: "git describe --tags", returnStdout: true).trim()
HIL_RIG = "SCALEXIO-01"
MODEL_VERSION = "VehicleDynamics_v2.3"
}
stages {
stage("Build ECU SW") {
steps {
sh "make clean && make all CONFIG=release"
sh "python3 tools/run_misra_check.py src/ --fail-on-mandatory"
archiveArtifacts "build/*.hex, build/misra_report.html"
}
}
stage("Flash ECU and Run HIL Tests") {
agent { label "hil-lab-host" }
steps {
sh "python3 tools/flash_ecu.py --firmware build/ecu_fw.hex --rig ${HIL_RIG}"
sh """
pytest tests/hil/ -v \
--html=reports/hil_report.html \
--junitxml=reports/hil_junit.xml \
--hil-rig=${HIL_RIG} \
--sw-version=${ECU_SW_VERSION}
"""
}
post {
always {
archiveArtifacts "reports/**"
junit "reports/hil_junit.xml"
sh "python3 tools/upload_to_polarion.py reports/hil_junit.xml"
}
}
}
}
post {
failure {
emailext to: "ecu-team@company.com",
subject: "HIL FAIL: ${ECU_SW_VERSION}",
body: "Build ${BUILD_URL} failed HIL regression."
}
}
}Summary
Integrating HIL tests into CI/CD reduces the feedback loop from "days to weeks" (manual HIL testing after sprint completion) to "hours" (automated HIL run on every merge request). The key enablers: HIL rig availability management (lab scheduler that queues CI jobs and prevents conflicts between engineers and CI), ECU flashing automation (JTAG or UDS-based flashing without human intervention), and deterministic test ordering (tests that modify ECU state must be isolated with proper fixture cleanup). A typical automotive CI pipeline runs 200-400 HIL test cases in 60-90 minutes, catching regressions before they reach integration testing.
🔬 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
- 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'.
- 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.
- 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.
- 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.