Contents

Drivers & hardware abstraction on an MCU-based ECU

Microcontroller drivers and board-specific abstraction turn electrical inputs and outputs into interfaces that control software can use predictably.

4 min read · Discipline stake: BSW Hardware Safety Software

What runs here

On an MCU-based brake, steering or battery-management ECU, this layer connects software to the actual electronics. In AUTOSAR Classic, the Microcontroller Abstraction Layer (MCAL) handles microcontroller peripherals; ECU Abstraction hides how devices are connected on the board. Together, they let higher software use hardware without embedding register addresses or wiring details. AUTOSAR Classic Platform

Component Role
MCU Driver (Mcu) and Port Driver (Port) Configure supported clock, reset and power functions, and pin modes.
I/O drivers: Adc, Dio, Pwm, Icu Acquire analog values, access digital signals, generate pulses and capture input edges.
Peripheral drivers such as Spi, Can and Wdg Operate serial peripherals, CAN controllers and watchdog hardware where supported.
I/O Hardware Abstraction (IoHwAb) Map board-specific sensor and actuator access to interfaces used by higher software.
Other ECU abstraction modules Abstract communication transceivers and other onboard devices through appropriate interfaces.

The exact set depends on the hardware and the selected AUTOSAR release. A Complex Driver may handle specialized acquisition or actuation that standard interfaces cannot adequately support; it belongs to a separate BSW architectural area. MCAL and Complex Driver overview

Why it looks like this

Control functions need predictable sampling and actuation. Hardware timers, ADC triggers and interrupts can coordinate these operations without relying on an application task to toggle every signal. Driver configuration therefore affects the control loop’s timing, even when the application algorithm remains unchanged.

Embedded flash and RAM constrain code size and buffering. Static configuration helps keep resource use visible. Board abstraction also supports reuse: moving a sensor to another channel should primarily affect configuration and hardware-facing software, provided its electrical and timing characteristics remain compatible.

Safety requirements determine the necessary integrity of each software element. An ECU supporting ASIL D functions does not automatically make every driver ASIL D. Integration must satisfy allocated requirements and the MCU and driver safety manuals, including assumptions about monitoring, initialization and fault response. ISO 26262-6 covers development at the software level. ISO 26262-6:2018

Hardware-facing software is closely tied to silicon revisions and board variants. Updating it can require broader regression testing than changing an isolated application feature, so reuse saves engineering effort only when compatibility and configuration are controlled.

How it connects

Below, drivers access peripheral registers, interrupts and, where applicable, direct memory access (DMA). External sensor interfaces or power-stage ASICs may be reached through SPI and digital control pins.

Above, application software components normally access local I/O through RTE-connected ECU abstraction interfaces. IoHwAb can expose signal-oriented operations and encapsulate board-specific conversion or access sequences; its interfaces must be designed for the ECU rather than assumed to be one universal sensor API. AUTOSAR Specification of I/O Hardware Abstraction

Network traffic follows a different path. For CAN, the Can driver connects upward to the CAN Interface (CanIf), with routing and communication services above it. Other nodes receive network messages, not direct access to this ECU’s peripheral drivers. Initialization, scheduling and interrupt integration involve the wider BSW and operating system.

Compared with other node classes

  • HPC application processor: A BSP, Linux drivers and possibly VirtIO support richer operating systems and virtual devices; their resource and execution models differ from a statically configured MCU stack.
  • HPC safety island: MCAL serves similar peripheral-access needs, with additional attention to ownership and communication boundaries with the application processor.
  • Zone controller: The same MCAL and ECU abstraction concepts apply, often across a broader mix of local I/O, external devices and power-control interfaces.
  • Smart node or LIN slave: A small peripheral-driver implementation or ASIC logic may provide the required behavior without a full AUTOSAR Classic stack.

Best practices

  • Maintain a reviewed mapping from schematic signals to pins, peripheral channels, driver configuration and application interfaces.
  • Budget the complete acquisition-to-actuation delay, including conversions, transfers, interrupts, buffering and task scheduling.
  • Define ownership of registers, interrupts and DMA channels, especially where Complex Drivers coexist with MCAL.
  • Specify signal units, scaling, validity and failure behavior at abstraction interfaces.
  • Verify startup, reset, sleep and wake transitions on target hardware, including output behavior before initialization completes.
  • Control driver versions, generated configuration, silicon errata and safety-manual assumptions together.

Common pitfalls

  • Assuming a standardized API guarantees identical timing or capabilities across MCU families.
  • Treating AUTOSAR conformance or a supplier safety claim as proof that the integrated ECU meets its safety requirements.
  • Allowing application code to change peripheral registers behind the driver’s back, creating conflicting ownership.
  • Returning an old or failed measurement as an ordinary valid value, leaving higher software unable to detect the fault.

What it means for your discipline

  • Base software Core

    Configure and integrate MCAL, ECU abstraction and any Complex Drivers. Own peripheral resource allocation, initialization dependencies and interfaces to the RTE and other BSW modules.

  • Hardware & silicon Core

    Translate schematics, electrical limits and device behavior into driver configuration requirements. Review pin assignments, sampling constraints and reset-state outputs with the BSW team.

  • Functional safety Partial

    Allocate safety requirements to hardware-facing software and check supplier safety-manual assumptions. Review fault detection and reaction paths through the integrated ECU.

  • HPC & application software Partial

    Use the abstracted I/O interfaces with the correct units, validity information and timing assumptions. Keep application behavior independent of peripheral register details.

No direct stake: E/E architecture · Cybersecurity · Networks & communication · Diagnostics & lifecycle · Software update & OTA

Where it sits in the software stack

Generic layered software of a central HPC (application processor with hypervisor, plus a safety island) and of a classic MCU-based ECU (AUTOSAR Classic). Highlighted modules matter for this topic. Click any module to open its page.

HPC · application processor (MPU) and safety island (MCU)

Not directly involved on this node type.

MCU-based ECU · AUTOSAR Classic
  • Microcontroller abstraction (MCAL) — Drivers configure MCU peripherals and provide controlled access to ADC, PWM, communication controllers and watchdogs.
  • ECU abstraction — ECU abstraction maps board-specific sensors, actuators and external devices to interfaces usable by higher software.
  • Complex drivers — Complex Drivers implement specialized acquisition or actuation when standard interfaces cannot meet hardware or timing requirements.