Communication Stack Overview

Micael Coutinho,autosarbswcom

The communication stack is a prime example of how the Autosar layered architecture works. Learn how to go from Software Component data to CAN bus here

One of the most important abilities of an ECU is to communicate with the outside world. If you have learned about Software Components (if not, here is a good place to start Types of Software Components (opens in a new tab)), you know you won't care about which is the underlying hardware that will communicate with the outisde world. You just want to send and receive data. For this, Autosar implements a group of BSW (Basic SoftWare) modules, which make up the communication stack (COM stack, for short). The idea of this stack is not only to create indirection at the SW-C level. As long as you have an upper layer, you add a level of indirection, which makes reusability easier, the act of not having to reconfigure everything every time you have a new project. Today, we'll look at the very essential COM stack modules, the bare minimum for you to communicate.

In a working environment, the communication stack gets partially configured through a file delivered by the OEM (if you are a tier 1, let's assume that's the case), such as a dbc (database CAN). The dbc is a readable file that contains all the information on the CAN bus messages of a specific ECU, or vehicle network. There are a lot of people involved in reverse-engineering these files, so that one can learn about their vehicles. You can check an example of this in the opendbc (opens in a new tab) repository. Maybe, you can even check if your car is part of the list and have a fun weekend project. Bottom line, this file "somehow" (let's leave it this way, it's not the scope of this article and we'll cover it eventually) gets converted to ARXML and imported into your Autosar environment. Often, this ARXML file does not contain all the necessary information and you will have to go manually and solve the problems within the COM stack, or even add PDU's and signals, in a worst-case scenario situation. This is where knowing the COM stack comes in handy.

Another scenario where knowing the COM stack is useful is while debugging it. Imagine that your messages do not reach their destination correctly, in any direction. You will have to verify the COM stack from the top to bottom (or bottom-up, depending on the direction of your communication). You will have to verify which is the point of failure inside the stack, and reconfigure it in a way to make it work. Bottom line, it's an important part of the layered architecture to master.

So, after this thorough explanation, this is the COM stack (at least partially, as there can be more modules involved, which we'll introduce gradually in future article, but to simplify and make it understandable more easily, today we'll look at this partial implementation), with a possible path of communication highlighted:

Modules involved in the Autosar communication stack (simplified) { w: 393, h: 660 }

Modules involved in the Autosar communication stack (simplified)

In the picture, you can see a possibility of the modules involved in sending and receiving data from a Software Component to the CAN bus signals. Let's go one by one, the modules involved:

In our example, you can see we limited our example to CAN communication, but Autosar also supports other communication layers, such as FlexRay, Ethernet and Lin. These modules all contain their specific BusTP, BusIf, and MCAL drivers. They have their own quirks, characteristic to the communication protocol.

As some final notes, we want you to understand that there can be more modules involved in the COM stack. Today, our main focus was to deliver a limited overview, with only the necessary modules for you to communicate. Some modules we left out are the CAN-SM (CAN State Manager) and I-PDUM (I-PDU Multiplexer), which we'll cover in the near future. For today, we hope you got to grips with the basics of the communication stack.

Author: Micael Coutinho (opens in a new tab)

References:

© AutosarToday —@LinkedIn