×

Happy to Help!

This website doesn't store cookies. Enjoy the experience, without worrying about your data!

Great, thanks!

Decoding the “Component Concept” of the Application Layer in AUTOSAR

  • 0

Decoding the “Component Concept” of the Application Layer in AUTOSAR

As you know, the AUTOSAR or AUtomotive Open System Architecture was  developed to create a common standardized software architecture for designing automotive electronic control units (ECUs). The AUTOSAR architecture is based on a 3-layered architecture model, developed jointly by the stakeholders of the automotive industry including – the automobile manufacturers, the suppliers, and the tool developers.

The 3-Layered AUTOSAR Architecture

Let us have a quick look at the AUTOSAR software architecture. The AUTOSAR specifies a three-layer architecture, which are categorized into following modules:

  • Basic software (BSW): can be defined as standardized software module offering various services necessary to run the functional part of the upper software layer. This layer consists of the ECU specific modules along with the generic AUTOSAR modules.

    It is divided into three sub layers namely the Services layer, ECU (Electronic Control Unit) abstraction layer, and the Microcontroller Abstraction Layer (MCAL).

    The MCAL is a software module that abstracts all the upper layers ( the application layer and the BSW) Microcontroller. Thus, MCAL helps in making the upper layers independent of the low lying hardware platform.

  • Runtime environment (RTE): acts as a middleware between the AUTOSAR application layer and the lower layers. Basically, the RTE layer manages the inter- and intra-ECU communication between application layer components as well as between the BSW and the application layer.
  • Application layer: The AUTOSAR application layer includes various application specific software components that are designed to execute specific set of tasks, as per the use-case.

In this blog, we would be discussing about the AUTOSAR Application layer in detail.

1 AUTOSAR Archtecture

The 3-Layer AUTOSAR Software Architecture; Image Credit: researchgate

The Application Layer in AUTOSAR

The AUTOSAR Application layer constitutes the topmost layer within an AUTOSAR software architecture and is identified to be critical for all the vehicle applications. The AUTOSAR standard specifies the application layer implementation using a “component” concept.

While talking about the application layer implementation, three of the most important parts that should be considered are:

  • The AUTOSAR application software components
  • The AUTOSAR ports of these components
  • The AUTOSAR Port Interfaces

AUTOSAR application software components: A typical E2E(End to End) functionality includes many interconnected AUTOSAR Application Software Components (SW-C). The application software component constitutes the simplest form of an application with certain functionality. AUTOSAR defines standardized interfaces associated with all the application software components required to develop automotive applications.

These software components are connected with the help of well-defined ports. These ports facilitate communication between the software components as well as with the AUTOSAR BSW. In the context of the Application Software Components, there are certain entities called the Runnables, which are basically the  procedures that contain the actual implementation of the software components.

Runnable or Runnable Entities are defined within the VFB specifications and is part of an atomic software component (described in a later section). Runnable are defined as the smallest fragments of code or a sequence of instructions given by component and executed by RTE. A runnable entity is triggered either cyclically or during an event such as data reception.

AUTOSAR Software Component

Image: Depiction of a typical Software Component

An AUTOSAR SWC can be considered only as an atomic entity, this means that every instance of an AUTOSAR SWC is assigned to only one ECU and cannot be distributed across many ECUs.

Types of Software Components of  AUTOSAR Application Layer:

To understand the AUTOSAR software component in further detail, it is vital to look at  the various types in which AUTOSAR SW-Cs are available within the application layer

  1. Sensor/Actuator Software Component: A type of AUTOSAR Software Component for handling sensor evaluation and actuator control functions. This particular AUTOSAR Software Component depends on the associated sensor/actuator and is independent of the specific ECU, to which it is mapped to.
  2. Composite Software Component: A composite component offers a logical interconnection of other components, which could be either atomic or composite. These components are called prototypes and usually are not required to be deployed on the same ECU. Instead these can be distributed over several ECUs.
  3. Atomic Software Component: An atomic software component is the smallest form of software component that cannot be decomposed further into smaller units. And contrary to the composite type, an Atomic Software Component can be assigned to only one ECU.

The AUTOSAR ports: The AUTOSAR Software Components use well-defined ports, which encapsulate certain interfaces as a guarantee for type safety while components are communicating with each other.

A port is mapped to a single component and represents a communication point between the components.  This inter-component communication is managed by the Virtual Function Bus (VFB).

The AUTOSAR Interfaces:

As we discussed earlier, the AUTOSAR standard defines certain standardized interfaces for the application software components that are required to develop various automotive applications. This definition of the interfaces helps in obtaining the required functionality of the vehicle application.
In order to better define the communication of data or services through port of a typical component, the AUTOSAR introduced the Interface concept. The port interface required by an application software component serves as the input to the RTE port creation.  An AUTOSAR Interface is categorized into:

  1. Client-Server interface: This interface defines a set of operations that can be invoked based on the client-server pattern. Here the client initiates the communication, and requests the server to perform a service.

    The server performs the request service and sends a response to the request. The direction of the message initiation can be used to identify if the AUTOSAR Software Component is a client or a server. In the diagram below, the client the AUTOSAR SWCs, client 1 and 2 respectively , request a service through the RPorts ( Request Port) which is sent to the, the server AUTOSAR SWC which offers the required services through the PPort ( provider Port).

    AUTOSAR Communications

    Image: The client server communication between AUTOSAR software components.
  2. Sender-Receiver interface: This interface defines an asynchronous information distribution and allows for a more data-oriented information exchange over the virtual function bus.
  3. The decision related to what all information should be exchanged through sender-receiver communication and which of the services should be called by the client-server communication – are taken by the interface.

    Data Distribution

    Image: Data distribution through the sender-receiver interface type

Communication Between the Software Components ( SW-C)

During design time of an AUTOSAR application, the VFB is used to manage the communication between the software components. This virtual bus abstracts the applications from the infrastructure. VFB is an abstract component that is represented usually by the Runtime Environment (RTE) at the runtime, and generated uniquely for each ECU in the AUTOSAR system. The VFB connects the various SWCs in the design model .

The VFB communicates via dedicated ports, which means that the communication interfaces of the application software must be mapped to these ports. The VFB handles communication both within the individual ECU and between ECUs.

ECU Communication

Image: Types of communication between the SW-Cs; Image credit: techiscafe

The communications between the applications software component can be:

  • Inter-ECU. Or
  • Intra-ECU

as explained in the diagram above. Both the inter and intra-ECU communication between the application software components communication is managed through the RTE.

The interaction between ECU I and ECU II  is an example of inter-ECU communication and takes place through and beneath the RTE  and goes via the Basic Software Module. The BSW handles the functions like  interactions with the memory, diagnostics,  along with communication services ( if needed) for the inter-ECU communication.

The intra-ECU communication, that is the communication within the ECU between the software component B ( SW-C B) and the software component C (SW-C C ) , is entirely through the RTE.As evident from the diagram , the software components that are mapped to a single ECU use the Intra-ECU method.

The Role of RTE: The implementation of the AUTOSAR software components is made independent of available communication mechanisms by the RTE by offering a uniform environment to these to AUTOSAR Software Components ( SWC).

Application layer exchanges data with the underlying layers via the sender and receiver ports of the RTE. Whenever an AUTOSAR software component calls for the service objects, the RTE maps these requests to the actual service object symbols on the local ECU.

The Complex Device Driver Exception – offering direct access to hardware

As the layered nature of the AUTOSAR software architecture does not allow direct access of the hardware by the upper layers, an additional concept was needed to bypass this restriction especially for the resource critical and/or Non-AUTOSAR compliant software components.

And it is here that the Complex Device Driver comes into scenario. The Complex Device Driver basically offers an AUTOSAR Interface to the application layer and thus gains direct access to values on the physical layer.

The concept of Complex driver is useful for application components that call for a direct access to the hardware devices on the ECU. Injection control or electronic valve control applications are good examples of such applications that require direct access to the hardware.

If we look at the AUTOSAR application layer implementation process, it is a function of the AUTOSAR Software Component which is independent of:

  1. The type of Microcontroller of the ECU being mapped.
  2. Type of ECU being mapped
  3. The location of the AUTOSAR Software Component
  4. The number of times a software component is instantiated within the system or an ECU.

The application software implementation within the AUTOSAR is encapsulated within the software components and forms the core of the AUTOSAR application implementation process.


  • 0

Decoding the Implementation of UDS Vehicle Diagnostics in AUTOSAR Base Software Module

For all the automotive technology enthusiasts, AUTOSAR needs no introduction. The AUTOSAR consortium was formed by the automotive OEMs to counter the complexities created due to increase in the use of ECUs (Electronic Control Units) in the automobiles.

This AUTOSAR software Architecture ensured the decoupling of product functionalities from the hardware and software services.

This standardization has helped the automotive embedded developers in focusing primarily on the innovations in the product feature development rather than working on different architectures.

This shift in automotive ECU development approach has proved to be equally beneficial for the automotive OEMs and their Tier-1 suppliers. Why, you ask? Post-AUTOSAR, OEMs’ and Tier-I Suppliers have been able to save costs spent on different software development tools required in era of non-standard architecture.

AUTOSAR software architecture has brought about a standardization that the OEMs and suppliers follow to develop software without facing any compatibility issues.

When Vehicle Diagnostics Met AUTOSAR Software Architecture

In automotive, diagnostics is required to be performed on all ECUs to ensure there is no issue with any electronically controlled component of the vehicle. Any issue encountered by the automotive ECU is stored as Diagnostics Trouble Code (DTC) in the Electrically Erasable Programmable Read-Only Memory (EEPROM). These codes can be retrieved later using an automotive diagnostic tool.

Now the vehicle diagnostics system needs to be implemented in the AUTOSAR architecture and this is what this blog aims to explore.

To understand how the diagnostics is implemented in AUTOSAR architecture, let us quickly revisit the architecture.

In the base software layer, there are hundreds of software modules including those categorized under the Microcontroller Abstraction Layer (MCAL), ECU Abstraction Layers and Service layer.

The blog will focus on the service layer of the AUTOSAR Base Software Module as the vehicle diagnostics services are stored here.

There are essentially three modules inside this layer tasked with different responsibility with respect to vehicle diagnostics. We will discuss them in the subsequent sections.

In the diagram below, the different components of the diagnostic stack(DCM, DEM, FIM etc.) can be seen.


AUTOSAR DIAGNOSTIC STACK
Source: Mathworks

  1. Diagnostics Communication Manager (DCM)

    The diagnostic communication manager (DCM) has the responsibility of reading and writing the fault codes or diagnostic trouble code in the fault memory of the automotive ECU. It supports the implementation of the diagnostic protocols such as UDS (ISO 14229) and OBD II.

    When an automotive ECU receives a diagnostics request from the tester tool, the DCM preprocesses it. While it handles majority of the requests, any other request is routed to the functional software. Every new version of DCM has an enhanced functional range which increases its ability to handle diverse types of diagnostic requests

    DCM comprises of the service identifiers (SID), data identifiers (DID) sub-functions and routine identifiers to handle the vehicle diagnostics requests.

    While handling the diagnostics requests from external testing tools during ECU software development, vehicle program production or garage servicing, the DCM also manages the session and security states.

    For instance, the DCM checks whether a particular diagnostic request can be supported and also if the execution of that service will be carried out in the current session.

    We will delve little deeper into the different components of DCM and how they interact with each other.

    Diagnostic Session Layer: This sub-module is tasked with ensuring the flow of data related to the diagnostic requests and the responses. Diagnostic session and security states are managed by this layer along with the supervision of timing parameters of the diagnostic protocol.

    Diagnostic Service Dispatcher: The validity of the incoming diagnostic requests needs to be checked and this is where this sub-module comes into the picture. In addition to ensuring the validity of the request, it also keeps track of the progress of the request.

    After the validation is done, this sub-module processes a stream of diagnostic data and also transmits the response post data processing.

    Diagnostic Service Processing (DSP) Module: This is the place where the real processing happens. DSP analyzes the format of the service request and interacts with other components of the AUTOSAR BSW to fetch the data required for the processing. The service response is also assembled by it.

    These three sub-modules interact with each other with the help of defined interfaces. Describing these interfaces is beyond the scope of the blog and we will discuss them in detail in the subsequent blogs.

    In order to make the automotive ECU an AUTOSAR compliant product, DCM needs to be first configured using tools like Vector Tool Chain. During the development process, all the necessary APIs are coded in the DCM including the general DCM definitions.

    Unit testing and integration testing follows the development process. Unit testing is performed using tools like Tessy Test Systems where the source module is analyzed and the functions are tested.

    Integration test is performed on the evaluation board where the data exchanged between the modules is verified. Basically, it tests if all the interfaces are functioning without any issue.

  2. Diagnostics Event Manager (DEM)

    DEM is responsible for storing and processing diagnostic errors (events) and all the data associated with it. In addition to it, DEM provides the diagnostic trouble codes (DTC) to the Diagnostic Communication Manager (DCM) as and when required.

    Providing the interface to the application layer of the ECU and to other modules of the AUTOSAR Base Software Module is also one of the responsibilities of DEM.

    There can be two type of event that can be reported to DEM:

    • Base Software Event- Event reported by the base software
    • Software Component Event reported by the AUTOSAR application layer

    The events reported to the DEM need to be first qualified to ensure that whether it is a fault (failure of a component) or just an occurrence (irregular system behavior).

    After the event is qualified, DEM records the event data and communicates with DCM for event handling and FIM (Function Inhibition Module) for functional control (Described in next section).

  3. Function Inhibition Module (FIM):

    FIM is essentially the control mechanism for AUTOSAR Base Software and software components. The FIM has to control the functionality available to these components depending on their inhibit conditions.

    An identifier is assigned to the functionalities with an inhibit condition. Only in the scenario of inhibit condition being not true, the functionality is executed.

    The role of FIM is to configure and modify the inhibiting conditions of the functionalities. By doing so, a particular functionality can be adapted easily to a new system context.

    FIM services are primarily focused on the applications residing in the software components; however, the AUTOSAR Base Software (BSW) can also use the services of FIM when required.

    The FIM has a close connection with DEM as the diagnostic events and their status info are considered as inhibit function by the FIM. When a failure is detected, it is reported to the DEM and it is the job of FIM to stop the particular functionality.

Conclusion

The implementation of UDS in the Base Software of AUTOSAR architecture requires two states of designing and highly complex coding during the configuration.

Moreover, the configuration of the Diagnostic Communication Manager (DCM) needs to be done with respect to certain parameters defined by AUTOSAR. This is where AUTOSAR Tool Chains become very important.

These platforms help the developers’ auto-generate certain code and write the rest. Configuration of the parameters also becomes quite easy with the tool chain programs like Electrobit, Vector Tool Chain and a few others.