AUTOSAR Communication Stack
Communication stack or COM stack provides the communication services to the BSW modules and Application layer. it supports the following communication protocols such as CAN, LIN, FlexRay and Ethernet.
The Communication services are group of modules for vehicle network communication (CAN, LIN, FlexRay). these are interfacing with the communication drivers via communication hardware abstraction. In this article we are discussing the COM module of CAN stack.
CAN stack contains the following modules: COM, PDUR, CanTP, CanIf, CanDriver, ComM, CanNm, CanSM and CanTrcv.
AUTOSAR Com stack overview.
Com stack Glossary
- Signal: Basic communication object. Refer: OSEK/VDX Communication (COM) Part4
- A signal in the AUTOSAR COM module’s context is equal to a message OSEK COM
- In AUTOSAR, message is re-placed by signal but with the same meaning.
- Data types supported: primitive datatypes such as int, Char, float
- Signal Group: grouping of signals are called signalgroup. it is like in a C struct. it is supporting complex datatype "Struct".
- PDU (Protocol Data Unit): Basic unit for data transfer. Signals are bundled into PDUs for transmission
- – Prefix I-, N-, L-
- I-PDU: The Interaction Layer Protocol Data Unit (I-PDU) is assembled and disassembled in AUTOSAR COM.
- N-PDU: An N-PDU is a PDU of the network layer.
- L-PDU: An L-PDU is a Data Link Layer Protocol Data Unit which is assembled and disassembled in AUTOSAR Hardware Abstraction layer.
- SDU(Service Data Unit): In the transmitter side, a layer N receives data from layer N+1 and this data is called the SDU
SDU and PDU Naming Conventions:
The naming of PDUs and SDUs respects the following rules:
For PDU: <bus prefix> <layer prefix> - PDU
For SDU: <bus prefix> <layer prefix> - SDU
SF -Single Frame, FF-First Frame, CF- Consecutive Frame, FC- Flow Control
For SDU: <bus prefix> <layer prefix> - SDU
SF -Single Frame, FF-First Frame, CF- Consecutive Frame, FC- Flow Control
System Description and Global PDUs
Below picture shows that system signals are map to com signal and PDU mapping.In the configuration of an ECU there is information which needs to be shared between multiple BSW Modules. Since it can not be defined who owns this shared information the virtual module EcuC has been introduced to the AUTOSAR ECU Configuration Parameter Definition
ECU Configuration has two input sources.
- First of all, all configuration that must be agreed across ECUs is defined in the System Configuration, which results in a System Configuration Description (and the resulting ECU Extract of the System Configuration for the individual ECUs).
- Secondly, the ECU BSW is built using BSW modules. The specifics of these module implementation are defined in the BSW Module Descriptions
PDU Properties:
PDU Communication Modes
I-PDU Groups
ComFilter
ComFilter container contains the configuration parameters of the AUTOSAR COM module's Filters.Basic APIs and Each module details
- Com_SendSignal: The service Com_SendSignal shall update the signal object identified by SignalId with the signal referenced by the SignalDataPtr parameter. If the updated signal has the ComTransferProperty TRIGGERED and it is assigned to an I-PDU with ComTxModeMode DIRECT or MIXED, then Com_SendSignal shall perform an immediate transmission (within the next main function at the latest) of that I-PDU.
- Com_SendDynSignal/Com_ReceiveDynSignal: Dynamic length signals must be of type UINT8[n]. Dynamic length signal must be placed last in I-PDU.
- Com_ReceiveSignal: Com_ReceiveSignal copies the data of the signal identified by SignalId to the location specified by SignalDataPtr.
- Com_SendSignalGroup: The service Com_SendSignalGroup copies the content of the associated shadow buffer to the associated I-PDU buffer. Prior to this call, all group signals should be updated in the shadow buffer by the call of Com_SendSignal.
- Com_ReceiveSignalGroup: The service Com_ReceiveSignalGroup shall copy the received signal group from the I-PDU to the shadow buffer. After this call, the group signals could be copied from the shadow buffer to the RTE by calling Com_ReceiveSignal.
- Com_MainFunctionRx: This function performs the processing of the AUTOSAR COM module's receive processing that are not directly handled within the COM's functions invoked by the PDU-R
- ComRxTimeBase : Com_MainFunctionRx is scheduled according to the value configured here.
- Com_MainFunctionTx: The function must be called on task level, This function performs the processing of the AUTOSAR COM module's transmission activities that are not directly handled within the COM's function invoked by the RTE.
- ComTxTimeBase : Com_MainFunctionTx is scheduled according to the value configured here.
- ComTxModeTimeOffset: Defines the period in seconds between the start of the I-PDU by Com_IpduGroupStart and the first transmission request in case ComTxModeMode is configured to PERIODIC or MIXED.
- Com_ReceiveShadowSignal: The service Com_ReceiveShadowSignal updates the group signal data referenced by SignalDataPtr with the data in the shadow buffer. The data in the shadow buffer should be updated before the call of Com_ReceiveShadowSignal by a call of the service Com_ReceiveSignalGroup: The service Com_ReceiveSignalGroup copies the received signal group to the shadow buffer. After this call, the group signals could be copied from the shadow buffer to the upper layer by a call of Com_ReceiveShadowSignal.
- Com_UpdateShadowSignal: The service Com_UpdateShadowSignal updates a group signal with the data, referenced by SignalDataPtr. The update of the group signal data is done in the shadow buffer, not in the I-PDU. To send out the shadow buffer, Com_SendSignalGroup has to be called.
- Com_InvalidateShadowSignal: This function invalidates the group signal by calling Com_SendSignal with the configured invalid value. An additional call to Com_SendSignalGroup is needed to update the signal group data.
Communication block diagram with Basic APIs
Main functionality of each module
Error handling mechanisms
Following Requirement for error detection and recovery- [SRS_Com_02058] The AUTOSAR COM module shall support deadline monitoring for updated signals/signal groups on receiver side.
- [SRS_Com_02100] The AUTOSAR COM module shall support configuring the properties of the I-PDU Counter
- [SRS_Com_02102] The AUTOSAR COM module shall support the detection of out of sequence I-PDUs
- [SRS_Com_02099] The AUTOSAR COM module shall provide a mechanism to detect out of sequence received I-PDUs
- [SRS_Com_02103] The AUTOSAR COM module shall provide a mechanism to detect corrupted received I-PDUs and to recover from this failure mode
========================================================================================================
Thanks for visiting the post..!!
========================================================================================================
No comments:
Post a Comment