RTA Knowledge Base

Table of content

Introduction

Scope

The scope of this Application Note is to provide an overview on how to integrate the CanTrcv configuration (CAN Transceiver) in an existing RTA-CAR project.

This document does not pretend to be a complete guide on how to configure a specific Transceiver device model, but rather provide guidelines on how to integrate the module in an AUTOSAR project. The configuration of each device will change depending on the HW and supported functionalities.

Definitions and Abbreviations -

BSW: AUTOSAR Basic Software, Hardware independent service layer.

RTE: AUTOSAR Real Time Environment.

OS: AUTOSAR Operating System.

SWC: Software Component.

AR: AUTOSAR

AN: Application Note

CanTrcv: Can Transceiver

Toolchain

It is assumed you are using the RTA-CAR 9.2.0 toolchain:

RTA-CAR 9.2.0 toolchain

ISOLAR-ABv 9.2.0
RTA-RTEv 7.5.0
RTA-BSWv 6.1.2
RTA-OSv 6.2.0

Prerequisites

It is assumed that the Reader has good knowledge of AUTOSAR Methodology and Architecture, as well a good understanding of the Communication Stack specified by AUTOSAR.
It also assumed that the Reader has experience with the RTA-CAR Toolchain. If not, please read the Getting started & AUTOSAR Workflow in our RTA Knowledge Base first.

CanTrcv Support in RTA-CAR

Module overview

The Can Transceiver Driver module (CanTrcv) abstracts the CAN Transceiver device with the objective to offer standardized interfaces to upper modules (Canif, EcuM, CanSM). The mainf functionalities supported by the CanTrcv are:

  • change the transceiver state
  • read the current transceiver state
  • detect CAN Bus errors
  • detect wakeup events/reasons

Currently the RTA-CAR Configuration Generator does not support the automatic configuration of the CanTrcv, therefore it must be manually configured following the steps highlighted in this document.

Further information on the Can Transceiver Driver module (CanTrcv) are available in the RTA-BSW Reference Guide (RTA-Hwd_Can_Reference_Guide_EN.pdf) released with RTA-CAR 9.2.0.

Supported Devices

RTA-CAR 9.2 supports the following hardware devices:

  • NXP Semiconductors: TJA1040, TJA1041, TJA1042, TJA1043, TJA1044GT, TJA1046TK, TJA1048, TJA1059, TJA1145, TJA1145AT, TJA1463
  • Infineon Technologies: TLE6250G, TLE6250GV33, TLE6251, TLE8250GVIO, TLE9255W
  • Atmel: ATA6570, ATA6571, ATA6572

If your device is not in the list of the supported hardware, it might be supported using a specific CDD (Complex Device Driver) which abstracts the functionalities and offer the expected standardized interfaces to upper layers.

Integration steps

Assumption on the RTA-CAR project

It is assumed that your project already have the Communcation Stack (CAN) BSW modules configured. This can be achieved exploiting the RTA Configuration Generator (ConfGen) which is able to generate the complete COM Stack configuration automatically starting from the System Template configuration (e.g. importing a DBC or an existent ECU Extract). The Stack can also be manually configured (but we discourage it).

If you don't know how to configure the COM Stack for your project, please consult our Getting started & AUTOSAR Workflow and/or the RTA-CAR documentation.

Creation of the SPI/DIO modules (only for project reference)

The Can Transceiver usually communicates with SPI or DIO modules. According to the HW model chosen for your project, you will need to configure the MCAL accordingly.

However, also RTA-BSW needs the references to the SPI/DIO configuration in order to generate the correct source code for the CanTrcv. For this reason, it is required that you create a dummy configuration in RTA-CAR (ISOLAR) to satisfy the need of these references, even if the actual configuration of those modules will be done in the MCAL Configurator tool of your HW provider (for example in Tresos if you use Infineon Tricore devices).

The SPI/DIO Modules can be created right clicking on the BSW Modules and selecting the module you want to add. In the example, since we are using the TJA1041 with DIO, we will create the DIO module.

You will then need to configure the DIO channels used for the CanTrcv, for example:

We will reference to these DIO Channels in the CanTrcv Configuration.

Creation of the RTA-BSW CanTrcv module

Now we can create the CanTrcv module

And we can start configuring it. For example, you can create a new CanTrcvChannel and set the HW device model you intend to use in your project (if supported)

You need then to configure the CanTrcvAccess with the peripheral you will use. In our example, I'm configuring the CanTrcvDioChannelAccess container to use the DIO. You also need to add the reference to the DIO channels that we previously configured in the dummy DIO Module.

In case your device is using the SPI, the procedure is exactly the same. The only difference will be that you will configure the CanTrcvSpiAccess container instead, and you will be required to create the SPI dummy configuration instead of the DIO one.

Update CanIf and CanSM configuration

There are some CanIf and CanSM configurations that requires references to the CanTrcv module.


Update the BswM/EcuM Initialization Sequence

The last step before the code generation is to add the CanTrcv to the initialization list. In this example, we add the Init call in the EcuM list, but it could be alternatively added to the BswM Init list. 

RTA-BSW Code Generation

The configuration part is now concluded and we can proceed with the BSW code generation. Before the code generation, you need to open the RTA Code Generation Dialog to select the CanTrcv module. If the module doesn't appear to be highlighted, please press the "restore defaults" button and this will refresh the module list.

If you configured the RTA-BSW correctly, you should now get the BSW code generated.

MCAL configuration (SPI/DIO)

The last step is to configure the MCAL accordingly. This guide does not go into the details on how to configure the MCAL because this depends on the HW device and the tool you use for the configuration. In general the steps are to configure SPI or the DIO modules according to the line used by the Can Transceiver. Obviously the configuration must be coherent with the one used in the dummy modules created as reference in the BSW.