AUTOSAR LÀ GÌ

 - 
Home > Automotive và IoT Blog > What is AUTOSAR MCAL? Learn about the Software Architecture, Device Drivers & MCAL Development

This blog is part of our series on understanding AUTOSAR better. Our Automotive sầu Product Engineering team, who has in-depth AUTOSAR expertise, will help us underst& the essential components of the layered architecture of AUTOSAR.

Bạn đang xem: Autosar là gì

To kick start our journey of learning more about AUTOSAR, in this blog we will first focus on AUTOSAR MCAL.

Understanding the Basics of AUTOSAR MCAL Architecture:

MCAL stands for Microcontroller Abstraction Layer. In the context of embedded software development, the MCAL can be defined as follows:

MCAL is a software module that has direct access to lớn all the on-chip MCU peripheral modules & external devices,which are mapped lớn memory. And it makes the upper software layers (Basic software layer, or BSW, Application Layer) independent of the MCU.

(Source – Renesas)

MCAL enables a very significant advantage of the layered architecture of the AUTOSAR compliant thiết kế – it makes the application and also the middleware (Basic Software layer) independent of the underlying hardware platkhung.

This renders immense benefit lớn the sản phẩm development cost and time, as there is a shift in the ECU kiến thiết approach from coding to lớn configuration.

Software Architecture of AUTOSAR MCAL (Microcontroller Abstraction Layer):

*

MCAL has a range of software modules designed to lớn serve a particular purpose. Each Software Module (Driver) accesses the corresponding On-chip peripheral function. For instance, CAN Driver will ensure that CAN messages can be received và transmitted by the MCU.

What are the Different Device Drivers of AUTOSAR MCAL Module?

Microcontroller Drivers:

GPT Driver: GPT (General Purpose Timer) device driver uses on-chip MCU timer. Initializes GPT and performs timer count.WDG Driver: WDG (Watchdog) Driver, this on-chip device driver Initializes WDG and performs WDG mode settings.MCU Driver: MCU (Micro Controller Unit) Driver, this device driver helps configure MCU settings, initializes cloông chồng and helps configure power mode settings.

Memory Drivers

FLS Driver: FLS (Flash) Driver initializes FLS và reads/writes to lớn FLS memory.

Communication Drivers

SPI Handler/Driver: SPI (Serial Peripheral Interface) is a Handler/Driver Device with on-chip clochồng serial function that Initializes SPI, performs SPI input/output và SPI I/O buffer settingsLIN Driver: LIN (Local Interconnected network) is a device driver that initializes LIN & performs LIN input/output.CAN Driver: CAN (Controller Area Network) is a device driver that initializes CAN and performs CAN input/output.FlexRay Driver: FlexRaydevice driver initializes FlexRay và performs FlexRay input/output.Ethernet Driver: Ethernet device driver initializes Ethernet Driver and performs Ethernet Driver input/output.

I/O Drivers

ICU Driver: ICU (Input Capture Unit) is a device driver using on-chip MCU timer and initializes ICU. It also measures PWM waveforms.PWM Driver: PWM (Pulse Width Modulation) is a device driver using on-chip MCU timer. It initializes PWM & sends PWM waveforms as outputADC Driver: ADC (Analog Digital Converter) is a device driver for on-chip ADC. It Initializes ADC, starts/stops AD conversion, sets AD conversion result buffer và reads AD conversion results.DIO Driver:DIO (Digital Input/Output) is an MCU port device driver thatperforms port signal (input/output).PORT Driver:PORT Driver is a MCU port device driver that performs MCU pin settings (I/O, shared functions)

Development và Configuration of AUTOSAR MCAL

All the MCAL drivers are designed for a specific microcontroller platkhung. This is because the device drivers access the on-chip peripherals of the system MCU.

As a result, every microcontroller comes equipped with its very ownMCALsoftware.

This MCAL software (which is part of the package that includes the hardware platform) now needs lớn be configured for the specific automotive application.

For example, CAN BUS (MCAL) driver needs to be configured for in-vehicle networking application. Similarly, several drivers lượt thích LIN BUS, FlexRay, PWM, SPI, and Ethernet have khổng lồ be configured based on specific requirements of an automotive application.

Xem thêm: Bà Bầu Nên Ăn Gì Vào Buổi Tối, Giúp Mẹ Và Thai Nhi Đều Khỏe Mạnh

The configuration of these drivers is carried out by using specialized tools for code generation và configuration.

Let’s underst& the process of AUTOSAR MCAL driver development và configuration, in detail:

The following three steps are involved in this process:

Configuration và Code Generation for AUTOSAR MCAL DriversAUTOSAR MCAL Driver DevelopmentTesting and Validation of AUTOSAR MCAL Drivers

Let’s explore them!

Configuration & Code Generation for MCAL Drivers: Configuration of MCAL drivers implies configuration of certain parameters associated with a particular MCAL driver. An example with help you understvà better.A CAN MCAL driver needs to be configured with specific baud rates depending on the application. Here, the baud rate is the parameter that must be configured.

In order khổng lồ carry out this configuration, the developers require the following files & tools:

Parameter Definition File (PDF): This tệp tin consists of the parameters to lớn be configured for the MCAL driver. This tệp tin contains the description of the parameters as well as their min and max values.PDF is created in .XML or .arxml format so that it can be accessed by the tools. In case of a CAN BUS Driver, the PDF will have sầu the baud rate range of the driver.Configuration Tool: The PDF tệp tin is an input đầu vào for the AUTOSAR configuration tool. As the tool is equipped with a graphical user interface (GUI), loading the PDF into lớn it and subsequent configuration becomes easy.Code Generation Tool: The Code Generation Tool runs in the background of the Configuration Tool và is responsible for processing of Parameter Definition File (PDF).It is a Perl/Pyhẹp script that takes in PDF as the đầu vào & gives Post Build và Pre Config source files (*_PBCfg.c / *_PBCfg.h và *_Cfg.h) as outputs. Another output, called the ECU mô tả tìm kiếm tệp tin is also generated.

Let’s analyze the outputs now!

Configuration Source Files: These source files consist of structures with elements such as configuration values. These configuration files are generated based on the values specified in the Parameters Definition File. The configuration values need khổng lồ be fed to lớn the peripheral registers, address pointers, macro definition, etc.ECU Description Files: This tệp tin is similar to lớn Parameter Definition File in terms of format (xml/arxml). The only difference is that the parameters stored in this tệp tin are already configured.In a scenario, where an AUTOSAR MCAL Driver development project is shared within different teams, ECU Desc file acts as an đầu vào khổng lồ the Code Generation Tool.

In such cases, this tool is not a part of Configuration Tool.AUTOSAR MCAL Driver DevelopmentDriver Static Code is the core MCAL driver that enables access to the on-chip peripherals of the microcontroller.The Driver Static Code file has an extension .c .

For example, the- driver static code for CAN BUS Driver will be CAN.c. Similarly, for a General Input/Output, it will be GPIO.c and so on.

This .c file along with the Configuration Source file (Obtained in Step1), together act as an AUTOSAR MCAL Driver, which is configured for a particular automotive application.

Driver Static Code is developed based on requirements specified in AUTOSAR MCAL Driver Software Specifications along with the Microcontroller Hardware Specification.

The AUTOSAR MCAL Driver Software Specification consists of every software requirement that needs to be met by the MCAL Driver. It consists of API details, parameters lớn be passed khổng lồ the API & their return value.

Details lượt thích Data Types to be used and Configurable Parameters lớn be provided, can also be found in this specification.

Considering all these specifications, the Driver Static Code is developed.Source Code Testing and Validation of the AUTOSAR MCAL DriverThe validation of the MCAL Drivers is important to lớn keep the bugs at cất cánh. The validation process involves creating a thử nghiệm bench using an Integrated Development Environment (IDE) or a compiler.The PDF, Configuration Source File và the Driver Static Code are tested in this Test Environment.

One important point khổng lồ be noted here is that AUTOSAR BSW is required for scheduling of the MCAL Driver verification. In its absence, stub files need khổng lồ be created that replicates AUTOSAR BSW with similar APIs.

Test Applications Files are written using the compiler or the IDE lớn kiểm tra functions of the MCAL Driver Component.

For instance, a separate kiểm tra application needs to be written for CAN Driver khổng lồ thử nghiệm if the ECU communication is happening uninterrupted. Similarly, thử nghiệm applications for memory functions, Input/Output, etc. also needs lớn be written.

Xem thêm: Mô Hình Nhà Trường Là Gì ? Để Xây Dựng Nhà Trường Hiệu Quả Cần

Conclusion

Different layers of AUTOSAR architecture are developed independent of each other & MCAL Drivers are no exceptions. This is how the required abstraction and thus the standardization is achieved.MCAL Drivers also commvà a lot of importance, as they are the bridge between the upper layers of AUTOSAR architecture and the microcontroller unit.