Svashasan Logo
Simulated data

Software-Defined Vehicles · Low-level software

Hardware Abstraction LayerHAL

Also known as MCAL (AUTOSAR Classic), hardware abstraction

IntermediateSource-checked · awaiting technical reviewLast reviewed 6 December 2026

A software layer between physical hardware and the software above it that exposes hardware resources through stable programming interfaces, so higher layers do not depend on a particular chip, board or peripheral implementation.

Explanation

The AUTOSAR glossary defines a hardware abstraction layer (HAL) as a software layer between physical hardware and its software that gives access to hardware resources through programming interfaces. In the AUTOSAR Classic Platform the role is filled by the Microcontroller Abstraction Layer (MCAL), which contains drivers for on-chip peripherals and makes higher layers independent of the microcontroller, and the ECU Abstraction Layer, which hides the board layout.

Android uses the term for a standard interface that hardware vendors implement, defined in AIDL (or the older HIDL), so the Android framework stays separate from device-specific code. A HAL abstracts chips and boards, whereas a vehicle abstraction layer abstracts vehicle-level signals and functions.

A HAL trades some performance and access to vendor-specific features for portability. Its interfaces need careful versioning, because changing them forces changes in every layer above.

How it works

The HAL defines functions or interface methods, for example read an ADC channel, configure a CAN controller or start a DMA transfer. Each hardware target gets its own implementation behind that interface, selected at build time or loaded at runtime, and higher layers call only the interface. In AUTOSAR Classic, MCAL modules are configured with tools and generated per microcontroller, while their APIs stay standardised.

Automotive applications

  • Porting ECU software between microcontroller families
  • Android device bring-up (camera, audio and vehicle HALs)
  • Supporting several board variants from one code base
  • Unit testing against mocked hardware interfaces

Example

An AUTOSAR Classic body-control application uses the standardised CAN and digital I/O driver interfaces. When the supplier moves to a different microcontroller, only the MCAL implementation and its configuration change; the application software components and Runtime Environment stay the same.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. Glossary (AUTOSAR_FO_TR_Glossary, Document ID 55), Release R24-11 (opens in a new tab)

    AUTOSAR · Specification · 4.149 Hardware Abstraction Layer; 4.199 Microcontroller Abstraction Layer · retrieved 6 December 2026

    “A hardware abstraction layer is a software layer that serves as an abstraction layer between the physical hardware and its software.”
  2. Hardware abstraction layer (HAL) overview (opens in a new tab)

    Android Open Source Project · Project documentation · HAL overview · retrieved 6 December 2026

    “A hardware abstraction layer (HAL) is type of abstraction layer with a standard interface for hardware vendors to implement.”

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.